chmod -R only files or only directories?



This question started when I wasn't able to tar up a directory because the permissions where set in such a way that tar wasn't able to read some things, even as root,

brute force chmod -R +x on the directory and everything under it helps, but might open up some vulnerabilities.

Can you tell chmod -R +x to only effect directories or conversely only to effect 'actual' files?

Many thanks in advance.
.



Relevant Pages

  • Re: R: Linux kernel source archive vulnerable
    ... those are actually the permissions we want in the tar archive. ... I seem to recall the UNIX way to do that is umask which works perfectly with tar as a normal user and kernel tarballs. ... Should they get UID 0 because I have chown permissions and the author of the tar archive was tarring as root? ...
    (Linux-Kernel)
  • Re: Setting permissions for SFTP transfer (during transfer, not after)
    ... the permissions from when it first exists. ... To specify the requirement ... i.e. tar the file on the remote end, transfer over ssh and untar on the ... Tar preserves permissions ...
    (Ubuntu)
  • tar changing permissions on /tmp?
    ... Checking the permissions, it was indeed incorrect. ... not set and the perms were dr-xr-xr-x ... moved the suspect tar file there and untarred. ... Sure enough, once the tar commend finished, it changed the permissions ...
    (comp.unix.solaris)
  • Re: Copy a directory tree WITH preserving owner and flags ?
    ... As far as I know the standard copy command overwrites e.g. the owner ... of the copied directory tree with "root" (resp. ... they will retain their original ownership and permissions. ... Tar will do this. ...
    (comp.os.linux.misc)
  • Re: R: Linux kernel source archive vulnerable
    ... The Linux kernel tar archive contains files with world-writeable ... permissions. ... This began in early git history. ...
    (Linux-Kernel)