admserv/newinst/src/AdminServer.pm.in | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
New commits:
commit a997fc5610de4acde28043a4711004be57a96c33
Author: Noriko Hosoi <nhosoi(a)jiji.usersys.redhat.com>
Date: Thu Feb 10 14:05:14 2011 -0800
Bug 604881 - admin server log files have incorrect permissions/ownerships
https://bugzilla.redhat.com/show_bug.cgi?id=604881
Description: Log files first generated by the Admin Server/Apache
has the owner (root, root), but the log files created later via
Console/CGI are owned by the Admin User/Group (e.g., nobody, nobody).
To make them consistent, this patch modifies the install script to
call chown to change the owner to the original log files.
diff --git a/admserv/newinst/src/AdminServer.pm.in
b/admserv/newinst/src/AdminServer.pm.in
index 1293a96..5f235c9 100644
--- a/admserv/newinst/src/AdminServer.pm.in
+++ b/admserv/newinst/src/AdminServer.pm.in
@@ -542,6 +542,22 @@ sub createAdminServer {
return 0;
}
+ # Force to make log files owned by admin user and group
+ # to maintain consistency with the log files created via CGI/Console
+ my $uid = getpwnam $setup->{inf}->{admin}->{SysUser};
+ my $gid = getgrnam $setup->{inf}->{General}->{SuiteSpotGroup};
+ # chown log files appropriately
+ for (glob("$logdir/*")) {
+ $! = 0; # clear errno
+ debug(1, "Changing the owner of $_ to \($uid, $gid\)\n");
+ chown $uid, $gid, $_;
+ if ($!) {
+ $setup->msg($FATAL, 'error_chowning_file', $_,
+ $admConf->{sysuser}, $!);
+ return 0;
+ }
+ }
+
if ($reconfig) {
$setup->msg('end_reconfig_adminserver');
} else {