Mail Archives: cygwin/2015/04/21/04:51:14
--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 -