delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/04/21/04:51:14

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=pT6F/yAaA7zAPX+KRhCQtuRyf81h7Oi9UWzgHiuK9PGFXCQLTCGXA
HE5dC/R/GRHzGLpOkLkBkpYUYL9eYC9VF2ZFTmHD081lwEoyd9XuAxRcMGpMWWO7
EqGio373/VVTLzu+GdT1qxtuksYJFuA+ACbXcqtPvH77Vg9Aa+CRAQ=
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=xy1NWTcU4pyI+M/vgKdMKVjSGQo=; b=id3/BAWeOXNBOgoeowX3IPumBRWZ
I4+L0WZsgMav3OxxQIeGKTr20zzCW7gdAxbtlv8ZmyDK5t8MeYJ2g+DjzRY9U0IQ
LAE2as8jjsG1XW44knXtSWi/PYnm56KcZ0b/tulGXlsNBm2w5tVsZAsFdnJSKEvv
7vIU5CReb0QSoAg=
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=-4.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Tue, 21 Apr 2015 10:50:53 +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: <20150421085053.GW3657@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>
MIME-Version: 1.0
In-Reply-To: <1883631812.201190.1429592754813.JavaMail.zimbra@ceos.com.au>
User-Agent: Mutt/1.5.23 (2014-03-12)

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

On Apr 21 15:05, John Orr wrote:
> I'm sorry to trouble the group with this, but I've tried hard to
> resolve it myself and I'm just not making progress.
>=20
> I have a windows box running the latest stable cygwin (1.7.35) from
> which I access a debian machine via samba.  I can't get the file owner
> showing correctly.  I've been reading the ntsec doco, especially the
> "Samba account mapping" section - but I'm failing to find the right
> solution.
>=20
> Looking at files in my home directory on my debian host mounted via
> samba gives this kind of output:
>=20
> #: john AT johndesktop:~ ; ls -l /cygdrive/l/.bashrc
> -rw-r--r-- 1 Unknown+User john 3833 Aug 22  2013 /cygdrive/l/.bashrc
>=20
> On the debian host, I am:
> #: john AT johnwl:~ ; id
> uid=3D1000(john) gid=3D1000(john) groups=3D1000(john),4(adm),24(cdrom),25=
(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev)
>=20
> On cygwin, I got this from the SAM database:
> #: john AT johndesktop:~ ; net user john
> User name                    john
> [...]
>=20
> I'm not sure how the group is being translated to "john" in the ls
> command above with an empty comment field, but that's just good, I
> suppose. (It's possible I did this when trying to fix this problem a
> month ago, but I can't work out what did it.)

That would be nice to know.  It might be an entry in your /etc/group
file, along the lines of

  john:S-1-22-2-1000:4278190180:

(Note the special UNIX SID)

So, what does `id' print for you?  What does `getent group john' print?
What are your /etc/nsswitch.conf settings?  Do you have an /etc/group
file by any chance, which does the name translation?

> Since I don't seem to be a member of Users (as mentioned in ntsec
> doco), but only Administrators,

No, that's not the case.  All user are members in the Users group.  `net
localgroup Users' should show this.  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).

You can change your primary group to another one in Cygwin, but you have
to make sure this group is in your user token.  The Administrators group
is not in the user token in a normal shell, unless you elevate it ("run
as admin...") so using None or Users is much more safe.

For getting this stuff working it might be better to start out by removing
all these settings and start from scratch, looking what's there and what's
not (passwd, group files, nsswitch.conf settings).

> I figured the commands I should run to
> match my debian box would be
>=20
> #: john AT johndesktop:~ ; net user john /comment:'<cygwin group=3D"Administ=
rators" unix=3D"1000"/>'
> The command completed successfully.

Hmm, that should do it, in theory.  I just tried this on one of my
machines with a local account, and while the "home" and "shell" settings
require "db_home: desc" or "db_shell: desc" in nsswitch.conf, the "unix"
setting works fine for me without any change to nsswitch.conf.

However, I wonder...

Yes, that may be the problem here.  Do you have an /etc/passwd file
with your user entry, and is the nsswitch.conf passwd setting either

  passwd: files db

or commented out (which amounts to the same)?

If so, the passwd entry shadows the request for user information from
the account DB (SAM in your case), and the description settings in
SAM are never read.  For testing, set nsswitch.conf to

  passwd: db
  group: db

and try again.  But make sure to remove the "group=3DAdministrors" first.


HTH,
Corinna

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

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

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

iQIcBAEBAgAGBQJVNg9tAAoJEPU2Bp2uRE+g2RIP/3XRiMVlTZ4nDjuNcAKuUg89
ai9LFV7qkz7BgugPB7TB56Bbo1BvShAdcEWE+VD7MTrJAJEeOI4vZMJRlXqYAWOM
MBJgituIac1DLaOtk/QoQ569M/unM/ggLQ0NnS+KuyrQWVH+S5qIe1w/jB56OqPB
UY3TZ/0dg2ZnTgYgnKmp57uAZuQ/+1ZEb5l9U+KQWskXjmA1PjGHFoRFd8z3xcIM
YSzTDY5nrsSNGBxk8gKbhiZJxwvU6TqD7a6qPkmR8kZcWevnX1B54sF2Ub7HR8Ew
rofNOp1onzl3Qm82IobJ59Mqfer7QfyINq2JhoIvjvNgFZJdMm6GJe3+2jWYsIWW
kSJj0qfQl2Lyj5cWcs+LLsFLobGhKIWmnLfCjD7NyP+uAezin1CJXRc/o1LRLiFq
cPEg4SeKJRc232OqzLa3YZb0h1Y3Q0JwNeMQmvdmtb2sXCyL/TKRPBC9fJ7kAsV/
FgOCb23fl9pzRbw6l1Yqu99l2GQBeyywcRdoBEIR2tAaZM6CD9lsZgYPMyqDAyP0
RDEMWyIxkk4+ui+LOGbk6HycCDxG9qBahyptltxw6m3UxgfBdUX2SC74EuW65NSj
EvE0SZ6PrAaUANsVZMwr6nw6vP2KtCsOFiIy3pVMiTnIuRkvNE4tR3HUHo1ue8sd
SHJwfUKh0rsI8Kpi+a35
=FRyv
-----END PGP SIGNATURE-----

--lzM1j1Hh4qIUNijn--

- Raw text -


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