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: [ANNOUNCEMENT] Updated: Cygwin 1.7.12

On Apr  4 20:51, Achim Gratz wrote:
> Corinna Vinschen writes:
> >
> > I just released 1.7.12.  This is mainly a bugfix release, but a couple
> > of bigger changes were required under the hood to fix some of the bugs.
> >
> I'm not really sure if that happens because of the changes in 1.7.12 or
> if I just never saw it before:

It's long-standing behaviour, already since 1.5 (maybe even 1.3) days.

> Using ~-expansion in the shell gives me the eight users that mkpasswd
> has created plus an additional "user" with ???????? as its name and the
> home directory set to /mnt/userdata, which gets me a funny prompt when

The weird home dir could be a bug in Cygwin.  I can't reproduce it,
but I could think of a reason.  Do you have a directory called
/mnt/userdata or an account called userdata in /etc/passwd?  Anyway,
I applied a patch which should result in:

  $ cd ~\?\?\?\?\?\?\?\?
  : No such file or directory.

> doing a cd into that directory.  Is there a way to drop such users from
> the expansion?

Not if we don't change Cygwin, but there's a workaround, more later.

As you know, Cygwin has to map between Windows SID and POSIX uid/gid
when mapping user accounts.  That's what /etc/passwd and /etc/group are
for.  If a file belongs to a user for which there's no entry in
/etc/passwd (same for group -> /etc/group), then the uid is set to -1.
ls then prints somthing like this:

  $ ls -l /cygdrive/c/pagefile.sys
  -rw-r-----  1 4294967295 4294967295 1073741824 Mar 24 17:40 pagefile.sys

At one point, way back when, somebody thought it is a good idea if ls
doesn't print the uid/gid 4294967295, but something more meaningful.
Since these times, Cygwin always adds an entry


at the end of the internal copy of /etc/passwd (analog for /etc/group).

If there's a consensus that we don't need this anymore and printing
the uid/gid 4294967295 is sufficient, I'm happy to remove this entries
from the passwd and group list.

Workaround:  Add an entry with uid/gid -1 to /etc/passwd and /etc/group
to override the ???????? entry:

  $ echo "dummy::-1:-1:::" >> /etc/passwd
  $ echo "dummy::-1:" >> /etc/group
  $ ls -l /cygdrive/c/pagefile.sys
  -rw-r-----  1 dummy dummy 1073741824 Mar 24 17:40 pagefile.sys
  $ cd ~<TAB>
  Administrator  cyg_server     krbtgt         sshd_server
  Administrators dummy          LocalService   SYSTEM
  corinna        Guest          sshd

Alternatively you can use an already existing user name:

  $ echo "corinna::-1:-1:::" >> /etc/passwd
  $ cd ~<TAB>
  Administrator  cyg_server     LocalService   SYSTEM
  Administrators Guest          sshd
  corinna        krbtgt         sshd_server

However, that's kind of misleading in ls -l:

  $ ls -l /cygdrive/c/pagefile.sys
  -rw-r-----  1 corinna dummy 1073741824 Mar 24 17:40 pagefile.sys

The pagefile is certainly not owened by my own user account. 


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Problem reports:
Unsubscribe info:

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