set the permissions properly for installer

This commit is contained in:
Evan Prodromou 2011-05-05 14:38:19 -07:00
parent 763229aede
commit 78a9d4966e
2 changed files with 19 additions and 1 deletions

View File

@ -212,7 +212,23 @@ class DomainStatusNetworkInstaller extends Installer
foreach (array('AVATARBASE', 'BACKGROUNDBASE', 'FILEBASE') as $key) { foreach (array('AVATARBASE', 'BACKGROUNDBASE', 'FILEBASE') as $key) {
$base = $config[$key]; $base = $config[$key];
mkdir($base.'/'.$this->nickname, 0777, true); $dirname = $base.'/'.$this->nickname;
// Make sure our bits are set
$mask = umask(0);
mkdir($dirname, 0770, true);
umask($mask);
// If you set the setuid bit on your base dirs this should be
// unnecessary, but just in case. You must be root for this
// to work.
if (array_key_exists('WEBUSER', $config)) {
chown($dirname, $config['WEBUSER']);
}
if (array_key_exists('WEBGROUP', $config)) {
chgrp($dirname, $config['WEBGROUP']);
}
} }
} }

View File

@ -16,3 +16,5 @@ export WILDCARD=example.net
export MAILTEMPLATE=/etc/statusnet/newsite-mail.txt export MAILTEMPLATE=/etc/statusnet/newsite-mail.txt
export MAILSUBJECT="Your new StatusNet site" export MAILSUBJECT="Your new StatusNet site"
export POSTINSTALL=/etc/statusnet/morestuff.sh export POSTINSTALL=/etc/statusnet/morestuff.sh
export WEBUSER=www-data
export WEBGROUP=www-data