Steve Briggs
2008-Apr-08 16:56 UTC
[Samba] Username case mangling -- Linux username is mixed-case, Samba returns lower-case
I have a problem that I first observed when I upgraded from 3.0.24 to 3.0.28 and is, I believe, related to the introduction of the "printjob username" configuration parameter. I print via CUPS and the Cups-PDF driver wants to know the Linux username (so it can put the PDF in the proper location). The problem is that "printjob username = %U" results in a lowercase username ("steve"), even though the Linux account is "Steve". The Samba logs clearly show me authenticating as "Steve" and the last message I see (with logging at 20) with an obvious user name shows me connecting to the Cups-PDF printer share with username "Steve". But, the Cups logs show a username of "steve" -- which ends up mapped to anonymous. I see I'm not the first to observe this change: http://www.mail-archive.com/samba@lists.samba.org/msg85076.html Linux prints fine to Cups-PDF, the username in the Cups logs is shown as "Steve", and the older samba (3.0.24 on Fedora Core 6) printed fine with username "Steve", it just seems to be the newer Samba is lowercasing the username. "%U" give "steve", "%u", "%$USER", "%$(USER)" are all taken literally (i.e. "%u" gives "%u"). Is there anyway to get Samba to output the *real* Linux username? As an aside.... while checking the samba documentation, I saw references to how Linux usernames should "always" be all lower case. Why? I've had mixed-case names for over 6 years and am unaware of any problems until now. Certainly, standard tools let you create mixed-case usernames without complaint. TIA, Steve ____________________________________________________________________________________ You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com
Wes Deviers
2008-Apr-08 17:28 UTC
[Samba] Username case mangling -- Linux username is mixed-case, Samba returns lower-case
On Tue 8 Apr 2008 12:56:45 pm Steve Briggs wrote:> > As an aside.... while checking the samba documentation, I saw > references to how Linux usernames should "always" be all lower > case. Why? I've had mixed-case names for over 6 years and > am unaware of any problems until now. Certainly, standard > tools let you create mixed-case usernames without complaint. > > TIA, > Steve >Basically...for exactly the problem you have here. That's a convention that's been around for many years, for various reasons. First, you'll occasionally run into problems like that. Second, on large production environments, if you allow mixed case usernames people will forget them daily; it's best to just say lowercase only. Third, you never know when you might need to expand into a system that *is* case sensitive. On modern Linux systems it's not such a problem, but it used to be, and the Proper Ettiquite for Systems Administrators Guidebook still says lowercase. I'll note that Debian and children do not, by default, allow uppercase names: root@skeletor:/home/wes# adduser YonNewblette adduser: Please enter a username matching the regular expression configured via the NAME_REGEX[_SYSTEM] configuration variable. Use the `--force-badname' option to relax this check or reconfigure NAME_REGEX or NAME_REGEX_SYSTEM. root@skeletor:/home/wes# adduser yonnewblette Adding user `yonnewblette' ... And I would submit that no well-behaved GNU/Linux system should allow uppercase in usernames. Unfortunately, I can't help you with your -actual- problem. As a workaround, you could create a second username, "steve", with the same UID/GID and $HOME, and add it to the "Steve" group and it should work effectively the same way. I don't like workarounds, but if it's a toLower() in the Samba code then you're either SOL or you'll have to change the code. Wes> > > > ___________________________________________________________________________ >_________ You rock. That's why Blockbuster's offering you one month of > Blockbuster Total Access, No Cost. > http://tc.deals.yahoo.com/tc/blockbuster/text5.com
Jeremy Allison
2008-Apr-08 20:20 UTC
[Samba] Username case mangling -- Linux username is mixed-case, Samba returns lower-case
On Tue, Apr 08, 2008 at 09:56:45AM -0700, Steve Briggs wrote:> I have a problem that I first observed when I upgraded from > 3.0.24 to 3.0.28 and is, I believe, related to the introduction > of the "printjob username" configuration parameter. > > I print via CUPS and the Cups-PDF driver wants to know the > Linux username (so it can put the PDF in the proper location). > > The problem is that "printjob username = %U" results in > a lowercase username ("steve"), even though the Linux account > is "Steve". The Samba logs clearly show me authenticating > as "Steve" and the last message I see (with logging at 20) > with an obvious user name shows me connecting to the > Cups-PDF printer share with username "Steve". But, the > Cups logs show a username of "steve" -- which ends up mapped > to anonymous.I think you want to use '%u', not '%U'. From the man page : %U session username (the username that the client wanted, not necessarily the same as the one they got). this is the incoming Windows username. %u is : %u username of the current service, if any. which is a UNIX username. Jeremy.
Steve Briggs
2008-Apr-12 21:49 UTC
[Samba] Username case mangling -- Linux username is mixed-case, Samba returns lower-case
--- Steve Briggs <zzybaloobah@yahoo.com> wrote:> > --- Jeremy Allison <jra@samba.org> wrote: > > > On Tue, Apr 08, 2008 at 09:56:45AM -0700, Steve Briggs wrote: > > > I have a problem that I first observed when I upgraded from > > > 3.0.24 to 3.0.28 and is, I believe, related to the introduction > > > of the "printjob username" configuration parameter. > > > > > > I print via CUPS and the Cups-PDF driver wants to know the > > > Linux username (so it can put the PDF in the proper location). > > > > > > The problem is that "printjob username = %U" results in > > > a lowercase username ("steve"), even though the Linux account > > > is "Steve". The Samba logs clearly show me authenticating > > > as "Steve" and the last message I see (with logging at 20) > > > with an obvious user name shows me connecting to the > > > Cups-PDF printer share with username "Steve". But, the > > > Cups logs show a username of "steve" -- which ends up mapped > > > to anonymous. > > > > I think you want to use '%u', not '%U'. From the man page : > > > > %U > > session username (the username that the client wanted, not necessarily the same as > > the one > > they got). > > > > this is the incoming Windows username. %u is : > > > > %u > > username of the current service, if any. > > > > which is a UNIX username. > > > > Jeremy. > > > Well, as I tried to explain in my original posting, > I tried "%u", but (at least for the printjob username > parameter) "%u" didn't get mapped to *anything* > ... it just went through as "%u". I noted in > the documentation that not every substitution > necessarily works in all cases; this seems like > a case where only(?) "%U" gets mapped. > > I can try "%u" again, I assumed it should work > and was surprised when it didn't.... > > Thanks for the suggestion... > > SteveI tried "%u" again... it just gets mapped to "%u". Similarly, %$USER, %$(USER), %($USER) are all taken literally. In each case, the "printjob username" parameter doesn't recognize it as a variable requiring substitution at all.... Any other ideas, or is samba just broken here and I need to make extra usernames with lower case? ....sigh TIA, Steve __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Apparently Analagous Threads
- Username case mangling: Linux username is mixed-case, Samba returns lower-case
- Leave mail on server leads to dup messages
- Wrong UIDs returned from mailbox_transaction_commit_get_uids()
- directory of R "consultants for hire"
- Retrieving locations of element of a vector or matrix