This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: File owner set to Unknown+User on cygwin 1.7.35 via samba 3.6.6 on debian

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.
> 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.
> Looking at files in my home directory on my debian host mounted via
> samba gives this kind of output:
> #: john@johndesktop:~ ; ls -l /cygdrive/l/.bashrc
> -rw-r--r-- 1 Unknown+User john 3833 Aug 22  2013 /cygdrive/l/.bashrc
> On the debian host, I am:
> #: john@johnwl:~ ; id
> uid=1000(john) gid=1000(john) groups=1000(john),4(adm),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev)
> On cygwin, I got this from the SAM database:
> #: john@johndesktop:~ ; net user john
> User name                    john
> [...]
> 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


(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
> #: john@johndesktop:~ ; net user john /comment:'<cygwin group="Administrators" unix="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=Administrors" first.


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

Attachment: pgpdm5gRQFkxV.pgp
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]