|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Folks,
Just noticed this with PHP 5 on RHEL 4 -- started using the copy function to move some files around and saw that executable permissions were being lost? The documentation didn't say anything about that? Is this a bug or a feature? Thanks. -- John __________________________________________________ _________________ John Murtari Software Workshop Inc. jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM) http://thebook.com/ |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
John Murtari escribió:
> Just noticed this with PHP 5 on RHEL 4 -- started using > the copy function to move some files around and saw that > executable permissions were being lost? The documentation didn't > say anything about that? Is this a bug or a feature? It sounds sensible. Copying means reading the original file, creating a new file and dumping contents in the new file. Let's see an extreme example: -rw-r--r-- root root /usr/share/foo/splash.png Obviously, john should not be able to create a new file owned by root. But he should be able to copy the file if he can read the source and has permissions in the destination directory. Check these functions: umask() stat() chmod() chown() chgrp() -- -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain -- Mi sitio sobre programación web: http://bits.demogracia.com -- Mi web de humor al baño María: http://www.demogracia.com -- |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On May 1, 5:43 pm, John Murtari <jmurt...@thebook.com> wrote:
> Folks, > > Just noticed this with PHP 5 on RHEL 4 -- started using > the copy function to move some files around and saw that > executable permissions were being lost? The documentation didn't > say anything about that? Is this a bug or a feature? > > Thanks. > -- > John > __________________________________________________ _________________ > John Murtari Software Workshop Inc. > jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM)http://thebook.com/ I would think that it's probably a feature, a copy is basically creating a new file using the contents of the old as contents. If user B copied a file owned by user A but which he had permission to read, then if permissions were copied then the result would be another file owned by user A. User B may have made a copy of the file belonging to user A in order to make his own modified version, so if the permissions were identical then he wouldn't be able to edit his copy either. |
|
![]() |
| Outils de la discussion | |
|
|