/[smeserver]/rpms/e-smith-base/sme9/e-smith-base-5.6.0-ensure_apache_alias_www.patch
ViewVC logotype

Contents of /rpms/e-smith-base/sme9/e-smith-base-5.6.0-ensure_apache_alias_www.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Sun Nov 2 21:53:22 2014 UTC (10 years ago) by vip-ire
Branch: MAIN
CVS Tags: e-smith-base-5_6_0-13_el6_sme
* Sun Nov 2 2014 Daniel Berteaud <daniel@firewall-services.com> 5.6.0-13.sme
- Ensure www group exists and that apache is an alias of www [SME: 8549]

1 diff -Nur e-smith-base-5.6.0/root/etc/e-smith/events/actions/init-accounts e-smith-base-5.6.0_bz8549/root/etc/e-smith/events/actions/init-accounts
2 --- e-smith-base-5.6.0/root/etc/e-smith/events/actions/init-accounts 2014-03-24 03:47:24.000000000 +0100
3 +++ e-smith-base-5.6.0_bz8549/root/etc/e-smith/events/actions/init-accounts 2014-11-02 22:49:34.550000000 +0100
4 @@ -30,7 +30,29 @@
5 my $conf = esmith::ConfigDB->open_ro
6 or die "Could not open Config DB";
7
8 -my $ldapauth = $conf->get('ldap')->prop('Authentication') || 'disabled';
9 +system(qw(/usr/sbin/groupadd -g 102 -r -o -f apache))
10 + unless getgrnam("apache");
11 +
12 +# Make sure apache exist and has the same uid/gid as www
13 +if ( !getpwnam("apache") )
14 +{
15 + die "Error creating apache user or group" unless (
16 + system(qw(/usr/sbin/groupadd -g 102 -o apache)) == 0 &&
17 + system(qw(/usr/sbin/useradd -u 102 -g 102 -o -c 'Apache' -d /var/www -M -s /bin/nologin apache)) == 0
18 + );
19 +}
20 +else
21 +{
22 + my $id = `/usr/bin/id -u apache`;
23 + chomp($id);
24 + if ( $id ne '102')
25 + {
26 + die "Error changing apache uid or gid" unless (
27 + system(qw(/usr/sbin/groupmod -g 102 -o apache)) == 0 &&
28 + system(qw(/usr/sbin/usermod -u 102 -g 102 -o apache)) == 0
29 + );
30 + }
31 +}
32
33 # fix permissions for www and apache
34 warn "failed to fix permissions for www" unless (

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed