Re: Help with ACL and POSIX permissions for external flash/HD.

2011-11-01 Thread David Sastre
On Tue, Nov 01, 2011 at 01:38:41PM +0200, Oleksandr Gavenko wrote:
 31.10.2011 23:00, David Sastre пишет:
 YMMV, but 'bash -l' should source your profile settings, both
 system-wide and user defined.
 
 Do you mean bash -i?

From the manpage:

-i   If the -i option is present, the shell is interactive.
-l   Make bash act as if it had been invoked as a login shell.

And:

When bash is invoked as an interactive login shell, or as a 
non-interactive shell with the --login option, it first reads and 
executes commands from the file /etc/profile, if that file exists.  
After reading that file, it looks for ~/.bash_profile, ~/.bash_login, 
and ~/.profile, in that order, and reads and executes commands from  
the first one that exists and is readable.  
The --noprofile option may be used when the shell is started to inhibit 
this behavior.

When an interactive shell that is not a login shell is started, bash 
reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if 
these files exist. This may be inhibited by using the --norc option.  
The --rcfile file option will force bash to read and execute commands 
from file instead of /etc/bash.bashrc and ~/.bashrc.

HTH.

-- 
Huella de clave primaria: AD8F BDC0 5A2C FD5F A179  60E7 F79B AB04 5299 EC56


signature.asc
Description: Digital signature


Re: Help with ACL and POSIX permissions for external flash/HD.

2011-11-01 Thread Andrey Repin
Greetings, Oleksandr Gavenko!


 Is it right to update /etc/fstab to:

 h: /cygdrive/h ntfs binary,noacl,user 0 0

 How can I set umask? In .bashrc?

Why not uncomment the last line in original /etc/fstab and add ,noacl there?

  What if I run
 Cygwin program from cmd?

Faster to try than to wait for answer :)
I'm using most of cygwin commands directly.
Most of environment variables that these programs would look for are defined
already, I'm no fan of hiding my personal settings into some obscure (for
system) files, or to have myself headache of remembering, where else i need to
adjust this or that setting to make all programs work transparently from bash
shell as well as when executed directly.

P.S.
My /etc/fstab :

# For a description of the file format, see the Users Guide
# http://cygwin.com/cygwin-ug-net/using.html#mount-table

# This is default anyway:
# none /cygdrive cygdrive binary,posix=0,user 0 0
none/   cygdrivebinary,posix=0,user,noacl   0   0
C:/home /home   bindbinary,posix=0,user,noacl   0   0

Where C:/home is a junction to C:\Documents and Settings (I'm using it on
WinXP)


--
WBR,
Andrey Repin (anrdae...@freemail.ru) 01.11.2011, 21:13

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Help with ACL and POSIX permissions for external flash/HD.

2011-10-31 Thread David Sastre
On Mon, Oct 31, 2011 at 10:39:27PM +0200, Oleksandr Gavenko wrote:
 30.10.2011 23:24, Oleksandr Gavenko пишет:
 How can I set umask? In .bashrc? 

Umask is already set system-wide in /etc/profile:

# Default to removing the write permission for group and other
#  (files normally created with mode 777 become 755; files created with
#  mode 666 become 644)
umask 022

And user-defined in ~/.bashrc

# /etc/profile sets 022, removing write perms to group + others.
# Set a more restrictive umask: i.e. no exec perms for others:
# umask 027
# Paranoid: neither group nor others have any perms:
# umask 077

Check under /etc/defaults/etc.

 What if I run
 Cygwin program from cmd?

YMMV, but 'bash -l' should source your profile settings, both
system-wide and user defined.

-- 
Huella de clave primaria: AD8F BDC0 5A2C FD5F A179  60E7 F79B AB04 5299 EC56


signature.asc
Description: Digital signature


Help with ACL and POSIX permissions for external flash/HD.

2011-10-30 Thread Oleksandr Gavenko

I have problem with permission (files stand non-readable sometimes) on
host when rsync or hg clone/pull done on external drive
on another host.

I read http://www.cygwin.com/cygwin-ug-net/ntsec.html
partially understand text but don't know how to resolve
my problem...

From manual:

  To use Windows security correctly, Cygwin depends on the files
  /etc/passwd and /etc/group

So if I carry external storage from one host to another
does second Cygwin stop understand permission on external storage
correctly?

I would like to see if all Cygwin operation set 666 permission
for files and 777 for directories for external drive and
don't set any host specific owners so I always can access to files.

It is possible that Cygwin set owners only from well knows SIDs?
Like S-1-1-0 (everyone), S-1-5-32-544 (Administrators)
so this IDs valid on any Windows host.

I try:

  $ mount -o noacl h:  /mnt
  $ mount
C:/opt/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/opt/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/opt/cygwin on / type ntfs (binary,auto)
H: on /mnt type ntfs (binary,noacl,user)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)

  $ umask 0111
  $ touch foo
  $ pwd
  /mnt
  $ mkdir dir
  $ touch dir/file

  $ ls -ld foo dir dir/file
  drw-r--r-- 1 user passwd/group_GID_clash(513/10513) 0 окт 30 23:05 dir
  -rw-r--r-- 1 user passwd/group_GID_clash(513/10513) 0 окт 30 23:05 
dir/file

  -rw-r--r-- 1 user passwd/group_GID_clash(513/10513) 0 окт 30 23:04 foo

  $ icacls foo
  foo Все:(I)(F)

  $ icacls dir
  dir Все:(I)(F)

  $ icacls dir/file
  dir/file desktop\user:(F)
   BUILTIN\Администраторы:(F)
   NT AUTHORITY\система:(F)

Look fine, is that way solve my problem?

Is it right to update /etc/fstab to:

  h: /cygdrive/h ntfs binary,noacl,user 0 0

How can I set umask? In .bashrc? What if I run
Cygwin program from cmd?


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple