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: Still testing needed: New passwd/group AD/SAM integration

On 04/10/2014 01:04 PM, Corinna Vinschen wrote:

> A local cygwin user told me that the users in their company would
> probably be confused by the '+ or, FWIW, any other non-backslash char,
> because they were drilled to see and use usernames always in domain\name
> form, or even in domain\\user form when logging in to Linux.
> I like slashes a lot more for obvious reasons.  But maybe, and that
> wouldn't be too hard to implement, we could accept account names with
> slash and with backslash, just as we do with pathnames.  Output of
> usernames would be with slashes, of course.

POSIX says:
> User Name
> A string that is used to identify a user; see also User Database. To be portable across systems conforming to POSIX.1-2008, the value is composed of characters from the portable filename character set. The <hyphen> character should not be used as the first character of a portable user name.

It also says this for shell tilde expansion:
>  If none of the characters in the tilde-prefix are quoted, the characters in the tilde-prefix following the <tilde> are treated as a possible login name from the user database. A portable login name cannot contain characters outside the set given in the description of the LOGNAME environment variable in XBD Other Environment Variables.

and following that link:
> For a value of LOGNAME to be portable across implementations of POSIX.1-2008, the value should be composed of characters from the portable filename character set.

In short, in POSIX systems, user names are solely from the set
[-_.a-zA-Z0-9]; which excludes +, \, or any other separator we come up
with.  I'm fine with using a non-portable character (this is, after all,
a cygwin extension of how to map Windows user names to a Linux emulation
environment).  But keeping in mind the rules on tilde expansion,


can undergo tilde expansion for username 'a+b', but


cannot do so, because the \ is necessarily always quoted.  There is no
way to get tilde expansion to work for a username containing a shell
metacharacter, which frowns on quite a few otherwise useful characters,
including \.

Worse, the thought of using / as the separator gives me the willies - it
is BOUND to go wrong.  The expression


is NOT requesting 'file' within user 'a/b's home, but 'b/file' within
user 'a's home.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

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