diff -Nur e-smith-ibays-2.4.0/root/etc/e-smith/events/actions/ibay-modify e-smith-ibays-2.4.0.bz7011/root/etc/e-smith/events/actions/ibay-modify --- e-smith-ibays-2.4.0/root/etc/e-smith/events/actions/ibay-modify 2013-01-31 22:31:37.000000000 +0100 +++ e-smith-ibays-2.4.0.bz7011/root/etc/e-smith/events/actions/ibay-modify 2015-01-03 22:24:18.806618131 +0100 @@ -158,6 +158,10 @@ #-------------------------------------------------- # main directory is writeable only by root #-------------------------------------------------- +##create the upload_tmp_folder in the ibay if PHPTmpDir is set to 'enabled' +my $tmpdir = $ibay->prop('PHPTmpDir') || 'enabled'; +$tmpdir = ('/home/e-smith/files/ibays/' . $ibay->key . '/tmp') if $tmpdir eq 'enabled'; +mkdir $tmpdir unless (-d $tmpdir || $tmpdir eq "disabled"); chdir "/home/e-smith/files/ibays/$ibayName" or ( $x = 255, warn "Could not chdir to /home/e-smith/files/ibays/$ibayName" ); @@ -227,6 +231,13 @@ $experm |= $::fileperm; chmod $experm, $_; } + ##chmod 0700 ; chown www:www if upload_tmp_folder exists + my $tmpdirperm = (('/home/e-smith/files/ibays/' . $ibay->key . '/tmp')||''); + if ( -d $tmpdirperm) + { + system ('/bin/chown', '-R', 'www:www' , $tmpdirperm); + system ('/bin/chmod' ,'-R', '0700' , $tmpdirperm ); + } } } diff -Nur e-smith-ibays-2.4.0/root/etc/e-smith/events/actions/init-ibays e-smith-ibays-2.4.0.bz7011/root/etc/e-smith/events/actions/init-ibays --- e-smith-ibays-2.4.0/root/etc/e-smith/events/actions/init-ibays 2015-01-04 15:42:23.594891869 +0100 +++ e-smith-ibays-2.4.0.bz7011/root/etc/e-smith/events/actions/init-ibays 2015-01-04 15:43:54.275788309 +0100 @@ -25,6 +25,7 @@ use strict; use Errno; use esmith::util; +use esmith::AccountsDB; # Populate pre-defined Primary i-bay # Start with top level owner/permissions @@ -59,5 +60,27 @@ "/home/e-smith/files/ibays/Primary/html/index.htm"); } +#we want to create the folder tmp if enabled in all Ibays(enabled by default) +#introduced by the bug [SME: 7011] +my $accounts = esmith::AccountsDB->open_ro or warn "Could not open account database: $!"; +my @ibays = $accounts->ibays; +my $uid = '102'; #or www +my $gid = '102'; #or www + +foreach my $ibay (@ibays) +{ + #Then we retrieve the name of the ebay + my $key = $ibay->key; + my $tmpdb = $ibay->prop('PHPTmpDir') || 'enabled'; + my $path = (('/home/e-smith/files/ibays/') . $key . '/tmp'); + + #we test the condition if /tmp exists or if it is disabled in the Ibay + unless (-d $path || $tmpdb eq "disabled") + { + mkdir $path, 0700 or warn "Could not create dir $path: $!"; + chown $uid, $gid, $path or warn "Could not chown dir $path: $!"; + } +} + exit (0); diff -Nur e-smith-ibays-2.4.0/root/etc/e-smith/skel/ibay/tmp/.cvs_ignore e-smith-ibays-2.4.0.bz7011/root/etc/e-smith/skel/ibay/tmp/.cvs_ignore --- e-smith-ibays-2.4.0/root/etc/e-smith/skel/ibay/tmp/.cvs_ignore 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-ibays-2.4.0.bz7011/root/etc/e-smith/skel/ibay/tmp/.cvs_ignore 2015-01-03 23:58:20.889702229 +0100 @@ -0,0 +1 @@ +#added to create the /etc/e-smith/skel/ibay/tmp folder