in reply to Writing a file as someone else

Fellow monks, feel for the many sysadmins that don't have root access, because that is only reserved for security departments. It is an unbelieveable pain in the butt.

However the sysadmin needs to be put in the www-data group in this situation (They definately need someone with root access to modify the /etc/group file). Then within the controlling script the following should work:

system("chgrp www-data file.bar"); system("chmod 664 file.bar"); #For the directories that are created: system("chgrp -R www-data foodir"); system("chmod -R 664 foodir");

I'm sure there's a more perlesque way to handle group and mode permissions but this way gets it done.

Hope it helps.

Replies are listed 'Best First'.
Re: Re: Writing a file as someone else
by merlyn (Sage) on Dec 14, 2000 at 21:12 UTC
      I knew your were out there waiting to pounce on that! (even said as much:) Ok I was too lazy to pick up the book and look it up... I claim TIMTOWTDI! :)) [coreolyn}