in reply to Script not setting ownership of new directory
It would be better for the web transaction to create some sort of signal or other symptom that could be picked up by a separate, root-owned process (not directly accessible via http), so that this root-owned process could do the right thing in terms of changing ownership on specific files, so that a web process does not need to do this.
Or, you could run a process under your "sftp" user account that copies the uploaded files and thereby assumes ownership of the copies. If you want to keep the files where they are with original names intact, and the "sftp" user is able to have write access in the directory where the "www-data" user puts uploaded files (e.g. if they are both included in a given group, and there's group write access on the directory), "sftp" can rename the uploaded files, copy them to the original names (thereby taking ownership) and then delete the www-owned originals. "Look, ma! No root privileges!" (Generally better and certainly safer that way, IMHO.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Script not setting ownship of new directory
by pc88mxer (Vicar) on Jul 29, 2008 at 05:18 UTC | |
by graff (Chancellor) on Jul 29, 2008 at 05:29 UTC | |
|
Re^2: Script not setting ownship of new directory
by JavaFan (Canon) on Jul 29, 2008 at 13:09 UTC | |
by MidLifeXis (Monsignor) on Jul 29, 2008 at 17:19 UTC |