[Techtalk] writing persmission on binary executables...

Kathryn Hogg kjh at flyballdogs.com
Thu Jun 27 14:37:54 EST 2002


> The question is why do all binary executables have the -rwxr-x-r-x
> permision when the owner will never temper with the data in the file?
>
> In updating or removing a file system looks in permision of the parent
> directory, that is in the inode of the directory in which the file is,
> so that's not the reason, because we can update and put new versions of
>  a file even if it doesn't have write permision.
>
> Hamster's reply was the best I got untill now. She said that it's it
> because of the default umask.

If the file doesn't have write set for the owner and she tries to copy a new
version of the file, it will fail.  This isn't a problem if your "make
install" does something like:

install:  program
        rm -f $(BINDIR)/program
        cp program $(BINDIR)/program
        chmod 555 $(BINDIR)/program

As a converse, if the directory is r-xr-xr-x and the file is rwxr-xr-x then
cp program $(BINDIR)/program will succeed because we are modifying the
directory.

-- 
Kathryn





More information about the Techtalk mailing list