diff options
| author | Nathan Kinder <nkinder@redhat.com> | 2008-12-17 17:22:22 +0000 |
|---|---|---|
| committer | Nathan Kinder <nkinder@redhat.com> | 2008-12-17 17:22:22 +0000 |
| commit | e6a8fd3f45a96fbb7da3e472c36382d59fadad4e (patch) | |
| tree | 0d94d589b1e01dbd8e1a85b4ae533c7a640e7de4 /ldap/admin/src/scripts | |
| parent | 9d681c65647ad8d895ae3a3f818eb7ca006b241e (diff) | |
| download | ds-e6a8fd3f45a96fbb7da3e472c36382d59fadad4e.tar.gz ds-e6a8fd3f45a96fbb7da3e472c36382d59fadad4e.tar.xz ds-e6a8fd3f45a96fbb7da3e472c36382d59fadad4e.zip | |
Resolves: 445305
Summary: Ensure directories created by installer get the requested mode applied.
Diffstat (limited to 'ldap/admin/src/scripts')
| -rw-r--r-- | ldap/admin/src/scripts/DSCreate.pm.in | 11 | ||||
| -rw-r--r-- | ldap/admin/src/scripts/Util.pm.in | 6 |
2 files changed, 16 insertions, 1 deletions
diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in index 9430cf2d..efb1fa65 100644 --- a/ldap/admin/src/scripts/DSCreate.pm.in +++ b/ldap/admin/src/scripts/DSCreate.pm.in @@ -160,6 +160,7 @@ sub changeOwnerMode { 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 @@ sub changeOwnerMode { 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 @@ sub changeOwnerMode { 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 (); } diff --git a/ldap/admin/src/scripts/Util.pm.in b/ldap/admin/src/scripts/Util.pm.in index 9600fc9b..20aea64b 100644 --- a/ldap/admin/src/scripts/Util.pm.in +++ b/ldap/admin/src/scripts/Util.pm.in @@ -860,6 +860,7 @@ sub makePaths { 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 @@ sub makePaths { 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 (); |
