mkdir differences between 1.5.25 and 1.7

View: New views
6 Messages — Rating Filter:   Alert me  

mkdir differences between 1.5.25 and 1.7

by Egerton, Jim :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

        I'm seeing a few things with mkdir and acl's I don't quite understand - OS is Server 2008.

First, from the shell I see different behaviors with mkdir on 1.5.25 and 1.7.

On 1.5.25 ($ filever \\usr\\bin\\cygwin1.dll --a-- W32i   DLL ENU     1005.25.0.0 shp  1,872,884 06-12-2008 cygwin1.dll)
bash-3.2$ getfacl /tmp
# file: /tmp
# owner: root
# group: Administrators
user::rwx
group::rwx
group:Users:rwx
mask:rwx
other:rwx
default:user::rwx
default:group:SYSTEM:rwx
default:group:Administrators:rwx
default:group:Users:rwx
default:mask:rwx

bash-3.2$ mkdir /tmp/test
bash-3.2$ getfacl /tmp/test
# file: /tmp/test
# owner: Administrator
# group: None
user::rwx
group::rwx
mask:rwx
other:rwx
default:user::rwx
default:group::rwx
default:other:rwx

on 1-7 (filever \\usr\\bin\\cygwin1.dll --a-- W32i   DLL ENU      1007.0.0.0 shp  2,472,737 10-23-2009 cygwin1.dll)
bash-3.2$ getfacl /tmp
# file: /tmp
# owner: root
# group: Administrators
user::rwx
user:LocalService:rwx
group::rwx
group:Users:rwx
mask:rwx
other:rwx
default:user::rwx
default:group:SYSTEM:rwx
default:group:Administrators:rwx
default:group:Users:rwx
default:mask:rwx

bash-3.2$ mkdir /tmp/test
bash-3.2$ getfacl /tmp/test
# file: /tmp/test
# owner: Administrator
# group: None
user::rwx
group::r-x
mask:rwx
other:r-x

It looks like the default acls are getting lost.  

I also ran into a problem with the mkdir "C" API which may or may not be related.   As far as I can tell, the permissions mask passed to mkdir with 1.7 is ignored.   The chmod API works fine.

Are either of these changes expected?

Thanks for looking,
jim

--
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: mkdir differences between 1.5.25 and 1.7

by Corinna Vinschen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 28 11:11, Egerton, Jim wrote:

> Hi,
>
> I'm seeing a few things with mkdir and acl's I don't quite understand - OS is Server 2008.
> [...]
> bash-3.2$ mkdir /tmp/test
> bash-3.2$ getfacl /tmp/test
> # file: /tmp/test
> # owner: Administrator
> # group: None
> user::rwx
> group::r-x
> mask:rwx
> other:r-x
>
> It looks like the default acls are getting lost.  

That's fixed in CVS.

> I also ran into a problem with the mkdir "C" API which may or may not
> be related.   As far as I can tell, the permissions mask passed to
> mkdir with 1.7 is ignored.   The chmod API works fine.

Works fine for me.  Are you sure the directory you tested this on is
not mounted with the "noacl" option?


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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: mkdir differences between 1.5.25 and 1.7

by Egerton, Jim :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> That's fixed in CVS.

Excellent!   I'm not familiar with the Cygwin build schedule - how often are the packages updated so I can give this another try?

> > I also ran into a problem with the mkdir "C" API which may or may not
> > be related.   As far as I can tell, the permissions mask passed to
> > mkdir with 1.7 is ignored.   The chmod API works fine.
>
> Works fine for me.  Are you sure the directory you tested this on is
> not mounted with the "noacl" option?

It isn't mounted noacl - sorry I didn't mention that.

$ mount | grep ' / '
C: on / type ntfs (binary)

I know you frown on mounting C: as /, but unfortunately there is a lot of history predating my presence that depends on this.

Test program:
$ cat x.cc
#include <stdio.h>
#include <sys/stat.h>

int main(int argc, char *argv[]) {
   mkdir("/tmp/foo", 0777);
}

$ ls -ld /tmp/foo
ls: cannot access /tmp/foo: No such file or directory

$ ./x

$ ls -ld /tmp/foo
drwxr-xr-x 1 root Administrators 0 Oct 29 20:27 /tmp/foo

For what it's worth, this isn't nearly as problematic as the lost ACL's as I can always follow each mkdir call with a chmod - that seems to work fine.

Thanks Corinna,

jim



--
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: mkdir differences between 1.5.25 and 1.7

by Corinna Vinschen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 29 14:33, Egerton, Jim wrote:

> Test program:
> $ cat x.cc
> #include <stdio.h>
> #include <sys/stat.h>
>
> int main(int argc, char *argv[]) {
>    mkdir("/tmp/foo", 0777);
> }
>
> $ ls -ld /tmp/foo
> ls: cannot access /tmp/foo: No such file or directory
>
> $ ./x
>
> $ ls -ld /tmp/foo
> drwxr-xr-x 1 root Administrators 0 Oct 29 20:27 /tmp/foo

That's a umask thingy.  Your umask is probably set to 0022, and per
POSIX, mkdir(2) has to take the umask into account.  If you use mkdir(1)
from coreutils:

  mkdir -m 777 /tmp/foo

it should create the permissions as desired, though, since mkdir(1)
sets the umask to 0 if the -m option has been given.


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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: mkdir differences between 1.5.25 and 1.7

by Egerton, Jim :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> > $ ls -ld /tmp/foo
> > drwxr-xr-x 1 root Administrators 0 Oct 29 20:27 /tmp/foo
>
> That's a umask thingy.  Your umask is probably set to 0022, and per
> POSIX, mkdir(2) has to take the umask into account.  If you use
> mkdir(1)
> from coreutils:
>
>   mkdir -m 777 /tmp/foo
>
> it should create the permissions as desired, though, since mkdir(1)
> sets the umask to 0 if the -m option has been given.

Thanks - that is the problem.   I don't see umask being set explicitly in /etc/profile on either 1.5.25 or 1.7.   Can you please confirm that it's being set explicitly somewhere else for 1.7?

Appreciate the help!
jim

--
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: mkdir differences between 1.5.25 and 1.7

by Corinna Vinschen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Nov  2 08:22, Egerton, Jim wrote:

> > > $ ls -ld /tmp/foo
> > > drwxr-xr-x 1 root Administrators 0 Oct 29 20:27 /tmp/foo
> >
> > That's a umask thingy.  Your umask is probably set to 0022, and per
> > POSIX, mkdir(2) has to take the umask into account.  If you use
> > mkdir(1)
> > from coreutils:
> >
> >   mkdir -m 777 /tmp/foo
> >
> > it should create the permissions as desired, though, since mkdir(1)
> > sets the umask to 0 if the -m option has been given.
>
> Thanks - that is the problem.   I don't see umask being set explicitly in /etc/profile on either 1.5.25 or 1.7.   Can you please confirm that it's being set explicitly somewhere else for 1.7?

The default umask is set to 0022 in Cygwin 1.7 due to security
considerations.


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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