[PLUG] Chmod question, before I mess things up

Tony Rick tonyr42 at gmail.com
Thu Dec 17 17:28:48 UTC 2009


On Wed, Dec 16, 2009 at 6:33 PM, Rich Shepard <rshepard at appl-ecosys.com>wrote:

> On Wed, 16 Dec 2009, John Jason Jordan wrote:
>
> > -rw-r--r--.  1 jjj jjj  11968 test_pdf_form.pdf
> > -rw-------.  1 jjj jjj  1552141 thinkpad_ultrabay.pdf
> > -rwx------.  1 jjj jjj  2240700 ubuntupocketguide-v1-1.pdf
> > -rw-------.  1 jjj jjj  4822994 ultrabay_adapter_40y8746.pdf
> > -rw-rw-r--.  1 jjj jjj 20839 Baker03.odt
> > -rw-r--r--.  1 jjj jjj  70 VLC_radio_playlist
>
> John,
>
>   None of the above should be executable. All you'll do with the .pdf files
> is read them; they can be 444 without harm since no one can directly write
> to them. The .odt file is an OpenOffice.org text file; also with the proper
> permissions.
>
> [snip...snip]
>


>    1.) Ignore all this unless you have nothing better to obsess over.
> You're
> getting so wrapped up in insignificant details (at your level of use) that
> you're missing the big picture.
>
>   2.) Look at 'man umask' to see default perms on new files.
>
>   3.) The permissions won't change or affect anything if you change
> distributions.
>
>
> Rich
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>

John (et. al.),

Another piece of random noise about finding out stuff.   The 'file' command
will tell you sort of thing a file is.  Executables and shell scripts
should generate a message that contains 'executable', even if it does not
have executable permission set (at least on my Debian based system; I should
expect RH based systems to do the same).  Binaries will have 'ELF' in the
message, for current  distributions.  Scripts will have 'script' in the
message, and usually something indicating the language (perl, python, bash,
etc.).  Attached is a result of applying 'file' to a slice of /usr/bin.  I
can write a script to use it to identify executables and modify the
permissions accordingly, but that exercise seems appropriate as
homework/research 'left to the reader'.

- tony
-------------- next part --------------
readelf:         ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
readom:          ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
recode-sr-latin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
rename:          symbolic link to `/etc/alternatives/rename'
rename.ul:       ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
renice:          ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
reset:           symbolic link to `tset'
resize:          ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
rev:             ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
rfcomm:          ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
rgrep:           POSIX shell script text executable
rgview:          symbolic link to `/etc/alternatives/rgview'
rgvim:           symbolic link to `/etc/alternatives/rgvim'
rhd_conntest:    ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
ristretto:       ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
rlogin:          symbolic link to `/etc/alternatives/rlogin'
routef:          POSIX shell script text executable
routel:          POSIX shell script text executable


More information about the PLUG mailing list