This is a discussion on umask problem within the Linux General forums, part of the Linux Forums category; when i execute command : umask 000 as a user or root, then when i want to create some file thanks ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
opexoc@wp.pl wrote:
> when i execute command : > > umask 000 > > as a user or root, then when i want to create some file thanks to touch > for example: > > touch file1 > > then file1 has mode rw-rw-rw. Why isn't x set in this access mode ? Because 'touch' by default creates files with those permissions (i.e., without the x permission). If you had a different umask, you could take away some of the r or w permissions. But umask can't add permissions that the creating program (in this case, touch) didn't ask for. Try compiling something, for example, since by default (IIRC) gcc makes its output executable. That should demonstrate that your umask is working the way you expect it. It's touch that's to blame. |
|
|||
|
On 2006-05-29, opexoc@wp.pl <opexoc@wp.pl> wrote:
> when i execute command : > > umask 000 > > as a user or root, then when i want to create some file thanks to touch > for example: > > touch file1 > > then file1 has mode rw-rw-rw. Why isn't x set in this access mode ? This sounds like a homework question. The general answer is most files should not have the x bit set. It just wouldn't make sense to have the touch command create an empty executable file. If you want a file to be executable, you need to set the x bit(s). -- Robert Riches spamtrap42@verizon.net (Yes, that is one of my email addresses.) |
|
|||
|
John-Paul Stewart napisal(a): > opexoc@wp.pl wrote: > > when i execute command : > > > > umask 000 > > > > as a user or root, then when i want to create some file thanks to touch > > for example: > > > > touch file1 > > > > then file1 has mode rw-rw-rw. Why isn't x set in this access mode ? > > Because 'touch' by default creates files with those permissions (i.e., > without the x permission). If you had a different umask, you could take > away some of the r or w permissions. But umask can't add permissions > that the creating program (in this case, touch) didn't ask for. > > Try compiling something, for example, since by default (IIRC) gcc makes > its output executable. That should demonstrate that your umask is ok i think so... thx > working the way you expect it. It's touch that's to blame. |