public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Groups command failing me in Windows 10
@ 2020-05-12 19:45 David
  2020-05-12 20:33 ` David Macek
  2020-05-13  0:43 ` Chris Wagner
  0 siblings, 2 replies; 6+ messages in thread
From: David @ 2020-05-12 19:45 UTC (permalink / raw)
  To: cygwin

Hello,

The groups command in the cmd window on Windows 10 shows None as my first group.
When I use the dir command to create a file, the security display shows no error.
When I use the touch command to create a file, I get "The permissions on ... are incorrectly ordered [NULL if first]
I bought two refurbished Windows 10 machines and this is the same on both.
I am on local machines with no outside domain connection.
In the fewest steps, how do I assign this user to a group?
What group should I assign the user to - so that when I create a file the group is set.
Can I do that with net localgroup newgroup Admin /Add
I have been working on this for a couple of weeks and cannot figure it out by myself
and I can't find a wonder answer on google. I am going to take a chance that my
email will be spammed because I really would like to know the answer to this.

This is influenced in a number of ways.
Let compare:
	C:\Users\Admin: groups
	C:\Users\Admin: None docker-users Performance Log Users Users INTERACTIVE CONSOLE LOGON Authenticated Users ...
	C:\Users\Admin: dir > admin.dir.out
        C:\Users\Admin: ls -ls admin.dir.out
	C:\Users\Admin: 8 -rwxrwxrwx+ 1 Admin None 6127 May 12 15:05 admin..dir.out
        C: explorer: No error when Security is clicked
	C:\Users\Admin: touch admin.touch.out
        C:\Users\Admin: ls -ls admin.touch.out
	C:\Users\Admin: 0 -rw-r--r--+ 1 Admin None 0 May 12 15:05 admin.touch.out
        C: explorer: The permissions on ... are incorrectly ordered [NULL is first]

        C:\Users\Admin: run as admministrator

	C:\Users\Admin: groups
	C:\Users\Admin: None Local account and member of Administrators group docker-users Administrators Performance Log Users INT...
        C:\Users\Admin: dir > administrator.dir.out
        C:\Users\Admin: ls -ls administrator.dir.out
	C:\Users\Admin: 8 -rwxrwxrwx+ 1 Administrators None 6245 May 12 15:05 administrator.dir.out
        C: explorer: No error when Security is clicked
        C:\Users\Admin: touch administrator.touch.out
        C:\Users\Admin: ls -ls administrator.touch.out
	C:\Users\Admin: 0 -rw-r--r--+ 1 Admin None 0 May 12 15:05 administrator.touch.out
        C: explorer: The permissions on ... are incorrectly ordered [NULL is first]

David



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Groups command failing me in Windows 10
  2020-05-12 19:45 Groups command failing me in Windows 10 David
@ 2020-05-12 20:33 ` David Macek
  2020-05-13  0:43 ` Chris Wagner
  1 sibling, 0 replies; 6+ messages in thread
From: David Macek @ 2020-05-12 20:33 UTC (permalink / raw)
  To: David; +Cc: cygwin

I found a few old references to incorrect ordering on the Internet,
but the alleged solutions of using `noacl` don't explain much.

The Cygwin user guide does explain it, but I guess it doesn't contain
the right keywords for Google to find it.  See
<https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-files>, especially
this part:

> This works on all supported versions of Windows. Only the GUIs aren't able (or willing) to deal with that order.

-- 
David Macek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Groups command failing me in Windows 10
  2020-05-12 19:45 Groups command failing me in Windows 10 David
  2020-05-12 20:33 ` David Macek
@ 2020-05-13  0:43 ` Chris Wagner
  2020-05-13  5:34   ` Brian Inglis
  2020-05-14 10:04   ` Andrey Repin
  1 sibling, 2 replies; 6+ messages in thread
From: Chris Wagner @ 2020-05-13  0:43 UTC (permalink / raw)
  To: David; +Cc: cygwin

On 2020-05-12 3:45 pm, David wrote:
> The groups command in the cmd window on Windows 10 shows None as my 
> first group.
> When I use the dir command to create a file, the security display
> shows no error.
> When I use the touch command to create a file, I get "The permissions
> on ... are incorrectly ordered [NULL if first]

Hi David.  The first thing to realize is that POSIX permissions and 
Windows ACLs are almost impossible to reconcile.  Best to pick one and 
ignore the other.

https://cygwin.com/cygwin-ug-net/ntsec.html has additional information.

To set your group you should do it in /etc/passwd.
If you don't have one, do: mkpasswd > /etc/passwd

Then edit the file and change the 4th field on the line with your 
username to the group Id for Users.

david:*:123456:197153:
->
david:*:123456:545:

Then restart ALL Cygwin processes and id should show Users as your 
primary group.  Any files created by a Windows process however will 
still put None as the group.

Hope that helps.


Thanks.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Groups command failing me in Windows 10
  2020-05-13  0:43 ` Chris Wagner
@ 2020-05-13  5:34   ` Brian Inglis
  2020-05-14 10:04   ` Andrey Repin
  1 sibling, 0 replies; 6+ messages in thread
From: Brian Inglis @ 2020-05-13  5:34 UTC (permalink / raw)
  To: cygwin

On 2020-05-12 18:43, Chris Wagner wrote:
> On 2020-05-12 3:45 pm, David wrote:
>> The groups command in the cmd window on Windows 10 shows None as my first group.
>> When I use the dir command to create a file, the security display
>> shows no error.
>> When I use the touch command to create a file, I get "The permissions
>> on ... are incorrectly ordered [NULL if first]
> 
> Hi David.  The first thing to realize is that POSIX permissions and Windows ACLs
> are almost impossible to reconcile.  Best to pick one and ignore the other.
> 
> https://cygwin.com/cygwin-ug-net/ntsec.html has additional information.
> 
> To set your group you should do it in /etc/passwd.
> If you don't have one, do: mkpasswd > /etc/passwd
> 
> Then edit the file and change the 4th field on the line with your username to
> the group Id for Users.
> 
> david:*:123456:197153:
> ->
> david:*:123456:545:
> 
> Then restart ALL Cygwin processes and id should show Users as your primary
> group.  Any files created by a Windows process however will still put None as
> the group.
> 
> Hope that helps.

Instead of groups, use id, which shows both ids and names by default, in a form
where you can easily distinguish names.

Cygwin can use AD DC and SAM entries, so it's better *NOT* to create /etc/passwd
and /etc/group files, and make tweaks in /etc/nsswitch.conf if required.

For user settings, you can change your primary group in Cygwin for a local SAM
account using e.g.:

	$ net user $USER /Comment:"<cygwin group=\"Users\">"

among other options; see the *Note* below *The desc schema*:

https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch-desc

for full details.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Groups command failing me in Windows 10
  2020-05-13  0:43 ` Chris Wagner
  2020-05-13  5:34   ` Brian Inglis
@ 2020-05-14 10:04   ` Andrey Repin
  1 sibling, 0 replies; 6+ messages in thread
From: Andrey Repin @ 2020-05-14 10:04 UTC (permalink / raw)
  To: Chris Wagner, cygwin

Greetings, Chris Wagner!

> On 2020-05-12 3:45 pm, David wrote:
>> The groups command in the cmd window on Windows 10 shows None as my 
>> first group.
>> When I use the dir command to create a file, the security display
>> shows no error.
>> When I use the touch command to create a file, I get "The permissions
>> on ... are incorrectly ordered [NULL if first]

> Hi David.  The first thing to realize is that POSIX permissions and 
> Windows ACLs are almost impossible to reconcile.  Best to pick one and 
> ignore the other.

> https://cygwin.com/cygwin-ug-net/ntsec.html has additional information.

> To set your group you should do it in /etc/passwd.
> If you don't have one, do: mkpasswd > /etc/passwd

Nope.
getent group

It will configure correct group file according to current NSS settings.
But you don't need to store it. (Or, well, you do, but for very, very, very
rare occasions.)

> Then edit the file and change the 4th field on the line with your 
> username to the group Id for Users.

No need.

> david:*:123456:197153:
->>
> david:*:123456:545:

> Then restart ALL Cygwin processes and id should show Users as your 
> primary group.  Any files created by a Windows process however will 
> still put None as the group.

> Hope that helps.

If you want to configure your user's primary group for Cygwin, you'd have to
do it in your user's settings. This is explained in the same article[1],
which you quoted, but seemingly not read yourself.

[1] https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch


-- 
With best regards,
Andrey Repin
Thursday, May 14, 2020 13:00:31

Sorry for my terrible english...


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Groups command failing me in Windows 10
@ 2020-05-13 11:39 David
  0 siblings, 0 replies; 6+ messages in thread
From: David @ 2020-05-13 11:39 UTC (permalink / raw)
  To: cygwin

Hello,

The groups command in the cmd window on Windows 10 shows None as my first group.
When I use the dir command to create a file, the security display shows no error.
When I use the touch command to create a file, I get "The permissions on ... are incorrectly ordered [NULL if first]
I bought two refurbished Windows 10 machines and this is the same on both.
I am on local machines with no outside domain connection.
In the fewest steps, how do I assign this user to a group?
What group should I assign the user to - so that when I create a file the group is set.
Can I do that with net localgroup newgroup Admin /Add
I have been working on this for a couple of weeks and cannot figure it out by myself
and I can't find a wonder answer on google. I am going to take a chance that my
email will be spammed because I really would like to know the answer to this.
So, I have added bcc to myself hoping you can forward to me or answer to me.
David

This is influenced in a number of ways.
Let compare:
	C:\Users\Admin: groups
	C:\Users\Admin: None docker-users Performance Log Users Users INTERACTIVE CONSOLE LOGON Authenticated Users ...
	C:\Users\Admin: dir > admin.dir.out
        C:\Users\Admin: ls -ls admin.dir.out
	C:\Users\Admin: 8 -rwxrwxrwx+ 1 Admin None 6127 May 12 15:05 admin..dir.out
        C: explorer: No error when Security is clicked
	C:\Users\Admin: touch admin.touch.out
        C:\Users\Admin: ls -ls admin.touch.out
	C:\Users\Admin: 0 -rw-r--r--+ 1 Admin None 0 May 12 15:05 admin.touch.out
        C: explorer: The permissions on ... are incorrectly ordered [NULL is first]

        C:\Users\Admin: run as admministrator

	C:\Users\Admin: groups
	C:\Users\Admin: None Local account and member of Administrators group docker-users Administrators Performance Log Users INT...
        C:\Users\Admin: dir > administrator.dir.out
        C:\Users\Admin: ls -ls administrator.dir.out
	C:\Users\Admin: 8 -rwxrwxrwx+ 1 Administrators None 6245 May 12 15:05 administrator.dir.out
        C: explorer: No error when Security is clicked
        C:\Users\Admin: touch administrator.touch.out
        C:\Users\Admin: ls -ls administrator.touch.out
	C:\Users\Admin: 0 -rw-r--r--+ 1 Admin None 0 May 12 15:05 administrator.touch.out
        C: explorer: The permissions on ... are incorrectly ordered [NULL is first]

David



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-14 10:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 19:45 Groups command failing me in Windows 10 David
2020-05-12 20:33 ` David Macek
2020-05-13  0:43 ` Chris Wagner
2020-05-13  5:34   ` Brian Inglis
2020-05-14 10:04   ` Andrey Repin
2020-05-13 11:39 David

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).