[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts DSCreate.pm.in, 1.14, 1.15 Util.pm.in, 1.17, 1.18

Nathan Kinder nkinder at fedoraproject.org
Wed Dec 17 17:22:24 UTC 2008


Author: nkinder

Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17143/ldap/admin/src/scripts

Modified Files:
	DSCreate.pm.in Util.pm.in 
Log Message:
Resolves: 445305
Summary: Ensure directories created by installer get the requested mode applied.



Index: DSCreate.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/DSCreate.pm.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- DSCreate.pm.in	23 Oct 2008 22:42:54 -0000	1.14
+++ DSCreate.pm.in	17 Dec 2008 17:22:22 -0000	1.15
@@ -160,6 +160,7 @@
 
     my $uid = getpwnam $inf->{General}->{SuiteSpotUserID};
     my $gid = -1; # default to leave it alone
+    my $mode_string = "";
 
     if (defined($inf->{General}->{SuiteSpotGroup})) {
         $gid = getgrnam $inf->{General}->{SuiteSpotGroup};
@@ -171,6 +172,10 @@
     if ($!) {
         return ('error_chmoding_file', $it, $!);
     }
+
+    $mode_string = sprintf "%lo", $mode;
+    debug(1, "changeOwnerMode: changed mode of $it to $mode_string\n");
+
     $! = 0; # clear errno
     if ( $gidonly ) {
         chown -1, $gid, $it;
@@ -181,6 +186,12 @@
         return ('error_chowning_file', $it, $inf->{General}->{SuiteSpotUserID}, $!);
     }
 
+    if ( $gidonly ) {
+        debug(1, "changeOwnerMode: changed group ownership of $it to group $gid\n");
+    } else {
+        debug(1, "changeOwnerMode: changed ownership of $it to user $uid group $gid\n");
+    }
+
     return ();
 }
 


Index: Util.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/Util.pm.in,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Util.pm.in	14 Jul 2008 23:25:41 -0000	1.17
+++ Util.pm.in	17 Dec 2008 17:22:22 -0000	1.18
@@ -860,6 +860,7 @@
     my ($path, $mode, $user, $group) = @_;
     my $uid = getpwnam $user;
     my $gid = -1; # default to leave it alone
+    my $mode_string = "";
 
     if ($group) {
         $gid = getgrnam $group;
@@ -882,7 +883,10 @@
         if ($!) {
             return ('error_chowning_directory', $_, $!);
         }
-        debug(1, "makePaths: created directory $_ mode $mode user $user group $group\n");
+        chmod $mode, $_;
+        $mode_string = sprintf "%lo", $mode;
+        debug(1, "makePaths: created directory $_ mode $mode_string user $user group $group\n");
+        debug(2, "\t" . `ls -ld $_`);
     }
 
     return ();




More information about the Fedora-directory-commits mailing list