f



File permissions; copying file from one directory to another

Hey guys... I'm a bit inexperienced with Linux, so I've been struggling
with this scenario;

I have a web app that creates a temporary data file (under the web
daemons user info - apache) in the temp directory, called - for example
- bla

Its just a file with some text in it.

The web app creates the data file, and then I want to move it to
another directory,

/var/spool/processor/outgoing

I'm getting permission denied trying to copy "bla" from the temp
directory (/var/tmp) to the above directory.

I've set the "outgoing" directory prermissions world writeable... but
I'm still getting the permission denied error.

SOOOO... given the scenario (the underprived web server account) trying
to copy the file to that outgoing directory, what do I have to do?  I
don't think I want to modify the permissions for "var" and "spool" and
"processor" to be world writeable, as I'm sure that would be "bad"...

Any help would be greatly appreciated...!

0
green (7)
10/7/2006 3:43:06 PM
comp.os.linux.misc 33599 articles. 1 followers. amosa69 (78) is leader. Post Follow

2 Replies
635 Views

Similar Articles

[PageSpeed] 42

green@ids.net wrote:
> Hey guys... I'm a bit inexperienced with Linux, so I've been struggling
> with this scenario;
>
> I have a web app that creates a temporary data file (under the web
> daemons user info - apache) in the temp directory, called - for example
> - bla
>
> Its just a file with some text in it.
>
> The web app creates the data file, and then I want to move it to
> another directory,
>
> /var/spool/processor/outgoing
>
> I'm getting permission denied trying to copy "bla" from the temp
> directory (/var/tmp) to the above directory.
>
> I've set the "outgoing" directory prermissions world writeable... but
> I'm still getting the permission denied error.
>
> SOOOO... given the scenario (the underprived web server account) trying
> to copy the file to that outgoing directory, what do I have to do?  I
> don't think I want to modify the permissions for "var" and "spool" and
> "processor" to be world writeable, as I'm sure that would be "bad"...
>
> Any help would be greatly appreciated...!

What are the permissions in the folder /var/spool/processor. On my
system, any user can switch over to /var/spool because of the
permissions -r-xr-xr-x. If processor doesn't have the r-x permission, a
user won't be able to navigate into it, hence into any subfolder in it.
You don't have to make the entire tree world writeable, but at least
have read and execute permissions allowing that non-privileged user the
right to navigate to the folder where they have write permissions.

In short, make sure that /var, and /var/spool and /var/spool/processor
have r-x by:

chmod og+rx /var/spool/processor

(the others I suspect are OK).

Then try your test.

Andrew.

0
mathenge (2)
10/8/2006 6:59:13 AM
Hmmm, ok - oddly enough, all of those directories have the correct
permissions set (as per your message), but I'm still getting permission
denied when trying to move the file...

It's just the following simple line that it's croaking on... saying
"permission denied" as the error message...

move($fname2, $callfile) or die "File can not be copied. '$!'";





On Oct 8, 2:59 am, "aamathenge" <mathe...@gmail.com> wrote:
> g...@ids.net wrote:
> > Hey guys... I'm a bit inexperienced with Linux, so I've been struggling
> > with this scenario;
>
> > I have a web app that creates a temporary data file (under the web
> > daemons user info - apache) in the temp directory, called - for example
> > - bla
>
> > Its just a file with some text in it.
>
> > The web app creates the data file, and then I want to move it to
> > another directory,
>
> > /var/spool/processor/outgoing
>
> > I'm getting permission denied trying to copy "bla" from the temp
> > directory (/var/tmp) to the above directory.
>
> > I've set the "outgoing" directory prermissions world writeable... but
> > I'm still getting the permission denied error.
>
> > SOOOO... given the scenario (the underprived web server account) trying
> > to copy the file to that outgoing directory, what do I have to do?  I
> > don't think I want to modify the permissions for "var" and "spool" and
> > "processor" to be world writeable, as I'm sure that would be "bad"...
>
> > Any help would be greatly appreciated...!What are the permissions in the folder /var/spool/processor. On my
> system, any user can switch over to /var/spool because of the
> permissions -r-xr-xr-x. If processor doesn't have the r-x permission, a
> user won't be able to navigate into it, hence into any subfolder in it.
> You don't have to make the entire tree world writeable, but at least
> have read and execute permissions allowing that non-privileged user the
> right to navigate to the folder where they have write permissions.
>
> In short, make sure that /var, and /var/spool and /var/spool/processor
> have r-x by:
>
> chmod og+rx /var/spool/processor
>
> (the others I suspect are OK).
>
> Then try your test.
> 
> Andrew.- Hide quoted text -- Show quoted text -

0
green (7)
10/9/2006 2:44:50 PM
Reply: