changing permissions in order to write a file in Mod_perl



I'm sending this question to the beginners perl list and the mod_perl
list as I'm not sure where it belongs.

In short: I'm trying to work out how to create a directory/file under
a specific user.

This is running on MP2 on Apache2 with suexec enabled. The vhost has:

SuexecUserGroup myuser myuser

When trying to create the file I get a permissions error.

I'm trying to create folders and files in the public_html folder who's
perms are:
drwxr-x--- 4 myuser apache 512 Apr 29 11:31 public_html


The uid and gid for the folder:
public_html: uid = 1009, gid = 1003

the perl scripts (module that's a handler in fact) uid and gid:
Real: uid = 1004, gid = 1003 1003 1003
Effective: uid = 1004, gid = 674124656 1003 1003


The control Panel (Direct Admin) created the public_html folder under
group apache, so I assume all sites will be created with that folder
under group apache.

Other files/folders created via ftp/file upload are user and group myuser.

So I'd like to be able to create folders and files under user/group
myuser and not havae to create them under group apache. so that site's
don't have access to each others files.

So it seems my mod_perl modules are running under a different user
than the suexec setting in httpd.conf

Do I have to open up the permissions (ie make group apache writeable
for the folder) or is there some way I can temoprarily switch to uid
1009, make my files, and then switch back to 1004. Or would this be a
really bad (crossing the beams kind of bad).

TIA
.



Relevant Pages

  • cannot do system() exec() or anything +cannot unlink
    ... & group apache. ... (lista). ... From the script, I can read files from the folder, I can ...
    (comp.lang.php)
  • Re: Database Results Hell
    ... FrontPage doesn't "know" that you've changed the data type of the field. ... the cleanest way to fix this is to delete the fpdb folder with the ... database in it, delete the global.asa, and delete the _fpclass folder. ... > these "ref" fields were text and not easy to use as a UID I chnaged ...
    (microsoft.public.frontpage.client)
  • Re: Samba, TVFS and NFS Question
    ... anything about default UID and PSW info. ... Where is the UID and PSW combination documented? ... In the File and print client resource browser folder - shows the workstation i am using, an NT4 system with printer share, another OS/2 computer in the basement. ... When i open the domain icon in LAN Server Administration, after a delay of about 15 seconds i get a domain window, and User Account icon. ...
    (comp.os.os2.misc)
  • Re: Recover encrypted file?
    ... get the old sid from the name of the folder that contain the private ... on the new system you must have a user with the same uid of the ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Windows crashed, EFS-Files lost???
    ... get the old sid from the name of the folder that contain the private ... on the new system you must have a user with the same uid of the ... you can also use the administrator, ...
    (microsoft.public.windowsxp.security_admin)