diff -Nur e-smith-base-5.2.0/root/etc/e-smith/events/actions/init-accounts e-smith-base-5.2.0_mod/root/etc/e-smith/events/actions/init-accounts --- e-smith-base-5.2.0/root/etc/e-smith/events/actions/init-accounts 2010-12-06 16:55:42.000000000 +0100 +++ e-smith-base-5.2.0_mod/root/etc/e-smith/events/actions/init-accounts 2010-12-06 22:40:10.000000000 +0100 @@ -188,6 +188,30 @@ } } +# Now that www exists, change uid/gid of user and group apache +# so they become alias of the www account +if ( !getpwnam("apache") ) +{ + die "Error creating apache user or group" unless ( + system("/usr/sbin/groupadd -g 102 -o apache") == 0 && + system("/usr/sbin/useradd -u 102 -g 102 -o -c 'Apache' -d /var/www -M -s /bin/nologin apache") == 0 + ); +} +else +{ + my $id = `/usr/bin/id -u apache`; + chomp($id); + if ( $id ne '102') + { + die "Error changing apache uid or gid" unless ( + system("/usr/sbin/groupmod -g 102 -o apache") == 0 && + system("/usr/sbin/usermod -u 102 -g 102 -o apache") == 0 + ); + warn "failed to fix permissions for apache" unless ( + system("/bin/rpm --setugids httpd mod_auth_tkt mod_ssl php 2> /dev/null") == 0 + ); + } +} # delete unwanted user accounts foreach my $user (qw(halt shutdown sync))