A user asked me how to setup his account so that the default permissions
were 755. Well I tried different permissions and found that for files I
could never set the execute bit on a file using a umask 022 gave me 644 not
755.
Does anyone know of a way to set the default so the it allows setting the execute bit on a file.
Thanks Joan _______________________________________________ Solaris-Users mailing list [email protected] http://www.filibeto.org/mailman/listinfo/solaris-users
hello Joan,
you cannot use umask to set the exacutable permissions on files. umask defaults are set in /etc/profile or in the user's .cshrc, .login or .profile file. if no umask is set the defaults are 777 for directories and 666 for files. as you notices umask of 022 will give you 644 for files (if you copy a file that is already executable it will have permissions of 755) and 755 for directories.
from anoter related post:
"When you create a *file* then the "open()" call has a mask in the call. For normal shell redirects this mask is 0666. This is then modify by the umask. Thus a file is not possible to be mode 0777 using normal shell commands eg:
echo test > filename
will do open("filename",....,0666)
You can't change this. In your own C (or Perl) programs you can change
it, but not in the shell."
this is a security feature - no file is created by default executable.
hope this helps,
Stoyan Angelov
_______________________________________________ Solaris-Users mailing list [email protected] http://www.filibeto.org/mailman/listinfo/solaris-users
