aboutsummaryrefslogtreecommitdiff
path: root/gacopyz
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-08-16 21:31:06 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-08-16 21:31:06 +0000
commite3a51fa494518b991a2e7900bcafb880779ab250 (patch)
treea64adb8f1d485f29fe5e43f7454f405de67953ab /gacopyz
parent3144ca5ebf79cf864b987f2cb15a8ba9f88c05bd (diff)
downloadmailfromd-e3a51fa494518b991a2e7900bcafb880779ab250.tar.gz
mailfromd-e3a51fa494518b991a2e7900bcafb880779ab250.tar.bz2
Bugfixes.
* mflib/pp-setup (_, N_): If used without arguments, insert _ and N_ verbatim. * README: Update. * tests/Makefile.am (clean-local): Fix rule. * configure.ac: Fix check for res_query. * mfd/engine.c (mailfromd_daemon): Use mailfromd_umask instead of a hardcoded value. * mfd/mailfromd.h (mailfromd_umask): New prototype. * mfd/main.c (mailfromd_umask): New fucntion. * mfd/bi_system.m4 (umask): New built-in function. * gacopyz/gacopyz.c (do_connect): Ensure umask 0117 when binding the socket. * doc/mailfromd.texi: Improve usage of @deffn. (System functions): Document umask. git-svn-id: file:///svnroot/mailfromd/trunk@1659 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'gacopyz')
-rw-r--r--gacopyz/gacopyz.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gacopyz/gacopyz.c b/gacopyz/gacopyz.c
index 3cf919bd..9cba84d7 100644
--- a/gacopyz/gacopyz.c
+++ b/gacopyz/gacopyz.c
@@ -193,7 +193,8 @@ do_connect(gacopyz_conn_t conn,
} addr;
int socklen;
int fd, flags;
- int yes = 1;
+ int yes = 1, rc;
+ mode_t old_mask;
if (!proto
|| strcmp(proto, "unix") == 0 || strcmp(proto, "local") == 0) {
@@ -363,7 +364,10 @@ do_connect(gacopyz_conn_t conn,
return -1;
}
- if (bind(fd, &addr.sa, socklen) < 0) {
+ old_mask = umask(0117);
+ rc = bind(fd, &addr.sa, socklen);
+ umask(old_mask);
+ if (rc < 0) {
if (GACOPYZ_CONN_LOG_MATCH(conn, SMI_LOG_ERR))
gacopyz_log(SMI_LOG_ERR,
_("%s: Cannot bind to port %s: %s"),

Return to:

Send suggestions and report system problems to the System administrator.