Help!

new file mod's

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Genreal Discussions RSS
Next:  Accepted mail-notification 5.4.dfsg.1-2 (source i..  
Author Message
Aaron Gray
External


Since: Jun 01, 2005
Posts: 197



PostPosted: Wed Jul 22, 2009 11:10 am    Post subject: new file mod's
Archived from groups: alt>os>linux (more info?)

How do I make Cygwin ("GNU/Linux clone", horror of all horrors !) generate
new files with a different set of file attributes as even for text files it
is making them executable, and its pissing me off on using svn diff as it is
marking new files as being executable there too.

Anyway is there a command line chmod but sets the default file creation
attributes ?

Many thanks in advance,

Aaron
Back to top
Aaron Gray
External


Since: Jun 01, 2005
Posts: 197



PostPosted: Wed Jul 22, 2009 11:10 am    Post subject: Re: new file mod's [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Aaron Gray" <ang.usenet.RemoveThis@gmail.com> wrote in message
news:7cokjgF27r402U1@mid.individual.net...
> How do I make Cygwin ("GNU/Linux clone", horror of all horrors !) generate
> new files with a different set of file attributes as even for text files
> it is making them executable, and its pissing me off on using svn diff as
> it is marking new files as being executable there too.
>
> Anyway is there a command line chmod but sets the default file creation
> attributes ?

Ah umask ! Great but Windows is still WindoZ and is creating text files as
executable. Great nice security feature, I don't say.

Sorry for the noise,

Aaron
Back to top
Black Dragon
External


Since: Nov 05, 2005
Posts: 58



PostPosted: Wed Jul 22, 2009 11:10 am    Post subject: Re: new file mod's [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived
Back to top
Lew Pitcher
External


Since: May 16, 2007
Posts: 54



PostPosted: Wed Jul 22, 2009 11:10 am    Post subject: Re: new file mod's [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On July 22, 2009 10:40, in alt.os.linux, Black Dragon (bd@nomail.invalid)
wrote:

> Aaron Gray wrote:
>
>> How do I make Cygwin ("GNU/Linux clone", horror of all horrors !)
>> generate new files with a different set of file attributes as even for
>> text files it is making them executable, and its pissing me off on using
>> svn diff as it is marking new files as being executable there too.
>
> umask
>
> For example, add this to your .cshrc file;
>
> # file permissions: rwxr-xr-x
> #
> umask 022

And remember that the umask /removes/ permissions rather than setting them.
For instance, a umask of 022 will
- remove the group write permission, if it would otherwise have been set, &
- remove the other write permission, if it would otherwise have been set

You cannot use umask to /set/ permissions.

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
Back to top
Moe Trin
External


Since: Aug 12, 2004
Posts: 1732



PostPosted: Wed Jul 22, 2009 2:49 pm    Post subject: Re: new file mod's [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 22 Jul 2009, in the Usenet newsgroup alt.os.linux, in article
<7cokjgF27r402U1.RemoveThis@mid.individual.net>, Aaron Gray wrote:

>How do I make Cygwin ("GNU/Linux clone", horror of all horrors !)
>generate new files with a different set of file attributes

Generate how? Text editor? Copying? Downloading? What filesystem?

>as even for text files it is making them executable

That's something completely b0rken OR you have a configuration error,
as the executable should not be on by default. Initial mode is
normally controlled by the shell involved with the 'umask' command.
For a Bourne style shell like bash:

[compton ~]$ help umask
umask: umask [-S] [mode]
The user file-creation mask is set to MODE. If MODE is omitted, or if
`-S' is supplied, the current value of the mask is printed. The `-S'
option makes the output symbolic; otherwise an octal number is output.
If MODE begins with a digit, it is interpreted as an octal number,
otherwise it is a symbolic mode string like that accepted by chmod(1).
[compton ~]$ umask
022
[compton ~]$

Note that the mask says bits NOT to set, and a '2' turns off the Write
bit. Note also that even with a mask of zero, the eXecute bit is never
set by default.

THE EXCEPTION TO THIS RULE is if you have the filesystem set as one
that doesn't have UNIX permissions - such as FAT and friends. Because
they have no permissions (or ownership, etc.), these attributes are
faked with the 'mount' command used to make the filesystem accessible.
This may show up in /etc/fstab. For that, "man mount"

Old guy
Back to top
Aaron Gray
External


Since: Jun 01, 2005
Posts: 197



PostPosted: Wed Jul 22, 2009 3:10 pm    Post subject: Re: new file mod's [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Lew Pitcher" <lpitcher.RemoveThis@teksavvy.com> wrote in message
news:d5fa2$4a67299c$cef899d2$27635@TEKSAVVY.COM-Free...
> On July 22, 2009 10:40, in alt.os.linux, Black Dragon (bd@nomail.invalid)
> wrote:
>
>> Aaron Gray wrote:
>>
>>> How do I make Cygwin ("GNU/Linux clone", horror of all horrors !)
>>> generate new files with a different set of file attributes as even for
>>> text files it is making them executable, and its pissing me off on using
>>> svn diff as it is marking new files as being executable there too.
>>
>> umask
>>
>> For example, add this to your .cshrc file;
>>
>> # file permissions: rwxr-xr-x
>> #
>> umask 022
>
> And remember that the umask /removes/ permissions rather than setting
> them.
> For instance, a umask of 022 will
> - remove the group write permission, if it would otherwise have been set,
> &
> - remove the other write permission, if it would otherwise have been set
>
> You cannot use umask to /set/ permissions.

All very well, useful to know, and good, but that does not help poor old
Windows !

Aaron
Back to top
Aaron Gray
External


Since: Jun 01, 2005
Posts: 197



PostPosted: Wed Jul 22, 2009 5:10 pm    Post subject: Re: new file mod's [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Moe Trin" <ibuprofin.DeleteThis@painkiller.example.tld> wrote in message
news:slrnh6erad.pr8.ibuprofin@compton.phx.az.us...
> On Wed, 22 Jul 2009, in the Usenet newsgroup alt.os.linux, in article
> <7cokjgF27r402U1.DeleteThis@mid.individual.net>, Aaron Gray wrote:
>
>>How do I make Cygwin ("GNU/Linux clone", horror of all horrors !)
>>generate new files with a different set of file attributes
>
> Generate how? Text editor? Copying? Downloading? What filesystem?

Yep its the text editor + Windows !

Notepad does the same so it is Windows, doing it for bat and cmd but also
..txt files.

Thanks Moe,

Aaron
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Genreal Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum