diff options
author | ale <ale@FreeBSD.org> | 2004-04-19 20:37:06 +0800 |
---|---|---|
committer | ale <ale@FreeBSD.org> | 2004-04-19 20:37:06 +0800 |
commit | fdeecdb1c674b01c8cbdce75ab81d1dfa3f2650e (patch) | |
tree | 37ce904872ddfedb8519502f7c037d99ec318ed0 /mail | |
parent | 5fb7f2ca23dbc458b7903173f98747d52ed6b4d8 (diff) | |
download | freebsd-ports-gnome-fdeecdb1c674b01c8cbdce75ab81d1dfa3f2650e.tar.gz freebsd-ports-gnome-fdeecdb1c674b01c8cbdce75ab81d1dfa3f2650e.tar.zst freebsd-ports-gnome-fdeecdb1c674b01c8cbdce75ab81d1dfa3f2650e.zip |
Fix a file descriptor leak in opensmtp().
Obtained from: vpopmail CVS via oliver, roam and
Michael Bowe <mbowe@pipeline.com.au>
Diffstat (limited to 'mail')
-rw-r--r-- | mail/vpopmail-devel/Makefile | 1 | ||||
-rw-r--r-- | mail/vpopmail-devel/files/patch-vpopmail.c | 45 |
2 files changed, 46 insertions, 0 deletions
diff --git a/mail/vpopmail-devel/Makefile b/mail/vpopmail-devel/Makefile index 5fe1f09ed9a3..fb0bc5a5021a 100644 --- a/mail/vpopmail-devel/Makefile +++ b/mail/vpopmail-devel/Makefile @@ -7,6 +7,7 @@ PORTNAME= vpopmail PORTVERSION= 5.5.0 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/mail/vpopmail-devel/files/patch-vpopmail.c b/mail/vpopmail-devel/files/patch-vpopmail.c new file mode 100644 index 000000000000..71c6d5e4bed1 --- /dev/null +++ b/mail/vpopmail-devel/files/patch-vpopmail.c @@ -0,0 +1,45 @@ +--- vpopmail.c.orig Mon Mar 1 16:33:32 2004 ++++ vpopmail.c Sun Apr 18 01:11:37 2004 +@@ -2462,6 +2462,11 @@ + + mytime = time(NULL); + ++ ipaddr = get_remote_ip(); ++ if ( ipaddr == NULL ) { ++ return 0; ++ } ++ + #ifdef FILE_LOCKING + /* by default the OPEN_SMTP_LOK_FILE is ~vpopmail/etc/open-smtp.lock */ + if ( (fs_lok_file=fopen(OPEN_SMTP_LOK_FILE, "w+")) == NULL) return(-1); +@@ -2481,10 +2486,10 @@ + } + } + +- /* by default the OPEN_SMTP_TMP_FILE is ~vpopmail/etc/open-smtp.tmp */ ++ /* by default the OPEN_SMTP_TMP_FILE is ~vpopmail/etc/open-smtp.tmp.pid */ + snprintf(open_smtp_tmp_filename, sizeof(open_smtp_tmp_filename), + "%s.%lu", OPEN_SMTP_TMP_FILE, (long unsigned)getpid()); +- /* create the tmp file as open-smtp.tmp.pid */ ++ /* create the tmp file */ + fs_tmp_file = fopen(open_smtp_tmp_filename, "w+"); + + if ( fs_tmp_file == NULL ) { +@@ -2493,17 +2498,6 @@ + fclose(fs_lok_file); + #endif /* FILE_LOCKING */ + /* failed to create the tmp file */ +- return(-1); +- } +- +- ipaddr = get_remote_ip(); +- +- if ( ipaddr == NULL ) { +-#ifdef FILE_LOCKING +- unlock_lock(fileno(fs_lok_file), 0, SEEK_SET, 0); +- fclose(fs_lok_file); +-#endif /* FILE_LOCKING */ +- /* failed to get user's ip address */ + return(-1); + } + |