delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/04/22/04:43:56

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=o+zU9fe5aEFq6VJrlp59ScrM0H7tKmB0a9Ab5txxkgsCOkSt+LWx4
dz6uyv5Sq9Yqz4GMlr9IYaAeQ8BF37MZNlrGE0Fv2s6TfVlalPFnpJPGB9z3hyqm
aMYTM5VjQ4fT5XHdh0YTI4EYHdnlkyZxNcVOUabZqNZTb54937JRQg=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=MmUk88cr9ocA7Dcth30C/DmkdW0=; b=Qizw4asNfPSFLtohHPksvJFsLdfO
noUrX2Q/Q9FS1Vz4L4M+ROvL64bv9EXNNX8LHNKX3Yf/CUDwF2RiC8ZWQEtpMpMH
s3/EaO//ad6fW1Joi5E4MBNdcpekukt/b6AmMN4n13bnkljo5L1pCiVatsG8lHwA
EaTXm8CQM5nNDbY=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,TBC autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Wed, 22 Apr 2015 10:43:33 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: File owner set to Unknown+User on cygwin 1.7.35 via samba 3.6.6 on debian
Message-ID: <20150422084333.GA3657@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <1883631812 DOT 201190 DOT 1429592754813 DOT JavaMail DOT zimbra AT ceos DOT com DOT au> <20150421085053 DOT GW3657 AT calimero DOT vinschen DOT de> <1277097406 DOT 207429 DOT 1429664315268 DOT JavaMail DOT zimbra AT ceos DOT com DOT au>
MIME-Version: 1.0
In-Reply-To: <1277097406.207429.1429664315268.JavaMail.zimbra@ceos.com.au>
User-Agent: Mutt/1.5.23 (2014-03-12)

--kjwfQs4m3ZHLWJuw
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Apr 22 10:58, John Orr wrote:
> Thank you Corinna, for this and all your other fantastic work for the
> cygwin community.

Thank you!

> Thanks.  First up - when I first read of all the changes to
> permissions, I thought I read that the /etc/passwd and /etc/group
> files should no longer be necessary, and I thought I'd deleted them,
> [...]
> > So, what does `id' print for you?
>=20
> #: john AT johndesktop:~ ; id
> uid=3D197608(john) gid=3D545(Users) groups=3D545(Users),197121(None),114(=
Local account and member of Administrators group),544(Administrators),4(INT=
ERACTIVE),66049(CONSOLE LOGON),11(Authenticated Users),15(This Organization=
),113(Local account),4095(CurrentSession),66048(LOCAL),262154(NTLM Authenti=
cation),405504(High Mandatory Level)

This is in an elevated shell, and it's with the passwd file still
present, right?  Otherwise, as a local account, your primary group
should be "None".  This is not changable in Windows for local SAM
accounts.

> [...]
> > No, that's not the case.  All user are members in the Users group.  `net
> > localgroup Users' should show this.
>=20
> Ok, that makes sense - I guess I was confused by the lines in my previous=
ly posted 'net user john' output saying:
>=20
> Local Group Memberships      *Administrators=20=20=20=20=20=20=20
> Global Group memberships     *None=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20
>=20
> Why no mention of Users?  Also:
>=20
> #: john AT johndesktop:~ ; net localgroup Users
> Alias name     Users
> Comment=20=20=20=20=20=20=20=20
>=20
> Members
>=20
> -------------------------------------------------------------------------=
------
> NT AUTHORITY\Authenticated Users
> NT AUTHORITY\INTERACTIVE
> The command completed successfully.
>=20
> (I can check with our Windows sysadmin about this if you like.)

Well, I can't really tell you why this is.  You're of course still
indirectly a member of the Users group, via the membership in
"Authenticated Users".  Why your account isn't directly a member of
Users, I don't know.  Usually, if you create local accounts on Windows,
the account is a direct member of Users.

> > However, your *real* primary group
> > as a local user is the group called "None" (unless you're using a
> > "Microsoft Account", but that doesn't seem to be the case here).
>=20
> Said sysadmin confirmed it's a standalone machine - though I don't
> know what a "Microsoft Account" is I don't think...

Logging in via your email address.

> For the record, I'll share my confusion that if my real group is None, I =
don't know why I get this:
> #: john AT johndesktop:~ ; net localgroup None
> System error 1376 has occurred.
>=20
> The specified local group does not exist.
>=20
> #: john AT johndesktop:~ ; net group None
> This command can be used only on a Windows Domain Controller.
>=20
> More help is available by typing NET HELPMSG 3515.
>=20
> #: john AT johndesktop:~ ; NET HELPMSG 3515
>=20
> This command can be used only on a Windows Domain Controller.

I share the confusion, too.  I don't know why Microsoft didn't allow to
show info on "None" in the command line nor in the GUI.  We'll probably
never know.  Ultimately it is possible to change the comment and other
stuff for group None programatically I think, but I never actually tried
it.

> > For getting this stuff working it might be better to start out by remov=
ing
> > all these settings and start from scratch, looking what's there and wha=
t's
> > not (passwd, group files, nsswitch.conf settings).
>=20
> Totally agree (and as I say, this was my original thought too).

Can we please start from scratch?  First, you removed passwd and group
files, ok?  Keep everything commented out in nsswitch.conf, or set it
to

  passwd: db
  group: db

Please also remove the comment settings for your user and any group in=20
the local SAM.  Stop all Cygwin processes.  Start a new shell.

Let's have a look at the output of

  $ id
  $ getent passwd $USER
  $ cd <some local directory>		# Not network share
  $ touch foo
  $ ls -l foo

Does it look correct?  Are you "john" and your primary group is "None"?

> Removing passwd and group immediately changes my output to=20
> #: john AT johndesktop:/etc ; ll /cygdrive/l/.bashrc
> -rw-r--r-- 1 Unknown+User Unix_Group+1000 3833 Aug 22  2013 /cygdrive/l/.=
bashrc

This is why you should start from scratch.  It totally baffles me that
you see an "Unknown+User" here.  Given that this is a Samba share, what
you *should* see is "Unix_User+$UID".  "Unknown+User" means that Cygwin
or rather, Windows can't resolve the SID Samba returns.  Fishy...

Next you do this aforementioned `ls -l' on the samba share.  So we
know your Linux account is john (uid 1000) and your primary group is
john (gid 1000).

Create a file "foo1" on the share via Windows, and create a file "foo2"
on the share directly from Linux.

Assuming the Samba machine is not running winbind, what you should see for
a just created file is this:

=46rom Linux shell:

  -rw-r--r-- 1 john  john  [...]  foo1
  -rw-r--r-- 1 john  john  [...]  foo2

=46rom Cygwin:

  -rw-r--r-- 1 Unix_User+1000  Unix_Group+1000  [...]  foo1
  -rw-r--r-- 1 Unix_User+1000  Unix_Group+1000  [...]  foo2

If you look into Explorer's "Properties" dialog for the files, the
"Security" tab should show something like this in both cases:

  Everyone
  john (Unix User\john)
  john (Unix Group\john)

However, if that's not the case, something else is going on.  The
Samba machine is running winbindd and access from your Windows machine
creates files under another Linux account which is then mapped back
to some Active Directory account.
If so, we're running into a problem here.  Is your machine an AD member
machine?  It doesn't seem so.  But then, Cygwin won't be able to resolve
the SID it gets back for these files.  I really wonder if there's some
configuration problem between your machine and the rest of the company
which just leaves Cygwin hanging in the rain.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--kjwfQs4m3ZHLWJuw
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJVN181AAoJEPU2Bp2uRE+gjDcP/2B2f2vrSWs8Lhvnx03SyRYH
Ol2nBUvphwzV3TfO9q5HpmouCdy/uBZIX7PWeKwt8OX5i7ADrSp/RuoRpbfw5ftC
9ZbrXeACq35h0Vc9GvOBVwc0/vugiiGOmgmp1UweVgaTzzgGnT071J0TR0wxOCsZ
sDsCA2aPoZHTXGWMLMep+yZ+xspoOUrxmNDpTgZJGQf/tT2Sr2dIwW3glvJj7hm/
K5vaBakbGz9bBd5fwu9kX68cJVOTFDDskS3pnLah+Sw00XwJeJgKiMlQUDYA6HDk
2W73SqHvx3+isDYWN/7J+emdWREjn4ULlQH9GTmM+tvqg9AhxN1XtWxE1D7j/W/C
MRbDX9pA13U3WVXIL3Qir+tUC4jgQ2QnzYDdsPb/DgH1oLtKCR71fTg7udtugr+D
qZoY2J7nUKx2PbR8PzWUrqSKHiRDw8fmfFlfpuW0VZ19gQnz0wQVzZYdJ2Zksm70
t11oclo5p3PqT+BJfgKfI508OgLGSYQc6bJUB8/XZ2mSBT/v3BhrODW56BK9muZb
mOxrxIreb9fLQjWehvIwX4IT8euh8479hwY82pSSptnoIL8D8V7dqGx7B9sn84vx
b4cu4pWfADFdsrxFfu8llswxSUtWGRliOg09f4BtIfv6jokxKjuck6awmw1/EnKD
812LfFJpvb68EougIU+b
=f98Q
-----END PGP SIGNATURE-----

--kjwfQs4m3ZHLWJuw--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019