File permissions not preserved with copy function?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Murtari

    File permissions not preserved with copy function?

    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@follow ing domain 315.635-1968(x-211) "TheBook.Co m" (TM)
    Domain name, TheBook.com, evokes a sense of knowledge, storytelling, and exploration. It represents a versatile and powerful tool for startups in the publishing, education, or reading industries. With only 7 letters and 2 syllables, it is e

  • =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?=

    #2
    Re: File permissions not preserved with copy function?

    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
    --

    Comment

    Working...