Is the directory you execdir from suid'd or sgid'd?
First of all try to do one manually, if that yields a different result, then something else is up.
It is possible that a shell is being invoked somewhere along the line - and the umask is being reset to your default.
There are a couple of ways around that - you could export ENV=~/.bashrc1; export POSIXLY_CORRECT="" prior to the find.
Then put umask 000 in ~/.bashrc1.
Then unset -v POSIXLY_CORRECT or replace ENV if you are already using POSIX.
Or you could switch in your default bashrc or bash_profile.
I am not so sure that -execdir is actually more secure then using -exec (and specifying a shell script). The docs do hint at it being more secure in avoiding race conditions, but the having to avoid ./ or the actual directory being changed to existing in $PATH does seem to make it less secure.
Unfortunately cp does not have a -m option like mkdir, thoguh you could also chmod the file afterwards.
The simplest way is to move the command into a script (I think you can chain commands on the -execdir or -exec but it is awkward).
|