Bluehost.com Web Hosting $6.95

umask problem

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 ...


Go Back   Usenet Forums > Linux Forums > Linux General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-30-2006
opexoc@wp.pl
 
Posts: n/a
Default umask problem

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 ?

best regards

Reply With Quote
  #2 (permalink)  
Old 05-30-2006
John-Paul Stewart
 
Posts: n/a
Default Re: umask problem

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.
Reply With Quote
  #3 (permalink)  
Old 05-30-2006
Robert M. Riches Jr.
 
Posts: n/a
Default Re: umask problem

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.)
Reply With Quote
  #4 (permalink)  
Old 05-30-2006
opexoc@wp.pl
 
Posts: n/a
Default Re: umask problem


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.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:53 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0