]> git.sur5r.net Git - openldap/commitdiff
temporarily change umask only if required
authorPierangelo Masarati <ando@openldap.org>
Sun, 15 Oct 2006 18:28:22 +0000 (18:28 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 15 Oct 2006 18:28:22 +0000 (18:28 +0000)
servers/slapd/daemon.c

index 4bc9e94a4d1a14e478d5c1f03bff399b435c7bfb..1cbfd5012fadb7491d2f5302ee35e4314b0bcbc2 100644 (file)
@@ -1330,11 +1330,15 @@ slap_open_listener(
                {
                        mode_t old_umask;
 
-                       old_umask = umask( 0 );
+                       if ( (*sal)->sa_family == AF_LOCAL ) {
+                               old_umask = umask( 0 );
+                       }
 #endif /* LDAP_PF_LOCAL */
                        rc = bind( l.sl_sd, *sal, addrlen );
 #ifdef LDAP_PF_LOCAL
-                       umask( old_umask );
+                       if ( (*sal)->sa_family == AF_LOCAL ) {
+                               umask( old_umask );
+                       }
                }
 #endif /* LDAP_PF_LOCAL */
                if ( rc ) {