Koozali.org: home of the SME Server

Samba network drives and UPPER- lowercase user names

mbachmann

Samba network drives and UPPER- lowercase user names
« on: November 24, 2006, 10:17:50 AM »
A SME 6.0.1 maps a Samba network drive to all windows users via
Code: [Select]
net use N: \\Nautilus1\%username%

A SME 7.0 maps a Samba network drive in the same way.

The difference between: SME 6.0.1 treats the Windows user names lowercase. SME 7.0 treats the Windows user names correctly. My Windows username is MBachmann, which, on SME 6.0.1 appears as mbachmann and on SME 7.0 as MBachmann.

Treating user names correctly is essentially a good thing. But the user accounts in the server-manager are all lowercase.  How and where may i force to SME 7.0/Samba to handle windows user names lowercase?

Strange: /etc/e-smith/templates/etc/smb.conf/11caseSensitive has the value case sensitive = no

Offline kruhm

  • *
  • 680
  • +0/-0
Samba network drives and UPPER- lowercase user names
« Reply #1 on: November 26, 2006, 02:07:26 PM »
Looks like you already have it but you can check the SAMBA man pages. Looks like they have some info about NAME MANGLING:
http://samba.org/samba/docs/man/manpages-3/smb.conf.5.html

mbachmann

Samba network drives and UPPER- lowercase user names
« Reply #2 on: November 27, 2006, 11:07:48 AM »
I don't get it. It's all the same on SME 6.0.1 and 7.0:

/etc/e-smith/templates/etc/smb.conf/11preserveCase

Code: [Select]
{
# Case Preservation can be handy - system default is _no_
# NOTE: These can be set on a per share basis
}
preserve case = yes

mbachmann

Samba network drives and UPPER- lowercase user names
« Reply #3 on: November 28, 2006, 01:06:47 PM »
Got it. It is not the way samba handles the user names, it is the way the CUPS pdf script in /usr/lib/cups/backend handles the user names.

Inside the script the variable $2 stores the user name. If I log on with MBachmann, it stores MBachmann, mbachmann stores mbachmann.

If i use the variable to copy a file to a user home dir, a logged on MBachmann results the script to fail, because it cannot  find the dir /home/mbachmann.

Can anyone tell, how i force the variable to treat my login lowercase?

Code: [Select]
OUTPUTFILENAME="$PDFDIR/$2-$PRINTTIME.pdf

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
change case on shell
« Reply #4 on: November 28, 2006, 03:36:40 PM »
If you script is shell, you can use this example:
Code: [Select]

#echo "ZaBBix"| tr [A-Z] [a-z]
results on: zabbix


Good luck!

Jáder
...

mbachmann

Samba network drives and UPPER- lowercase user names
« Reply #5 on: November 28, 2006, 04:45:21 PM »
Code: [Select]

[root@metrokles ~]# echo MBachmann | tr [:upper:] [:lower:]
mbachmann


Nice. Now i need the variable lowercase, not the output.

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Samba network drives and UPPER- lowercase user names
« Reply #6 on: November 28, 2006, 06:42:25 PM »
I´m not a programmer... so can BE COMPLETL WRONG, but I think this:

OUTPUTFILENAME="$PDFDIR/$2-$PRINTTIME.pdf
lower_output=echo $OUTPUTFILENAME | tr [:upper:] [:lower:]

and user lowe_output as you new variable.

What that looks to you mbachmann??

Jáder
...

mbachmann

Samba network drives and UPPER- lowercase user names
« Reply #7 on: December 01, 2006, 08:33:54 AM »
The idea is good. Unfortunately the $2 variable is used to identify the user. My Windows users all start with uppercase user names. This collides with way, SME user accounts are named, always beginning with lowercase letters. So i need to find a way, to convert $2 "on the fly".

mbachmann

Samba network drives and UPPER- lowercase user names
« Reply #8 on: December 08, 2006, 08:09:23 AM »
The correct expression is
Code: [Select]
$(echo $2 | tr '[:upper:]' '[:lower:]') "$OUTPUTFILENAME"

Maybe this should be moved to Linux general section.

Offline chris burnat

  • *****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Samba network drives and UPPER- lowercase user names
« Reply #9 on: December 08, 2006, 08:15:15 AM »
mbachmann, you could also lodge a bug report at Bugzilla under the documentation section,  In this way, what you have found will eventually migrate to documentation, or FAQ. Rgds. chris.
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

mbachmann

Samba network drives and UPPER- lowercase user names
« Reply #10 on: December 08, 2006, 12:44:17 PM »
This is no bug, it's logic. Samba in SME default config handles usernames (from Winboxes) as they come in  case insensitive but case preserving). Standard SME user accounts defaults to lowercase. "MBachmann" from a Windows/Samba login compared against "mbachmann" from SME accounts is failing if you capture "MBachmann" as a variable and try to operate shellscriptwise against "mbachmann".

Offline chris burnat

  • *****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Samba network drives and UPPER- lowercase user names
« Reply #11 on: December 09, 2006, 03:37:08 AM »
"This is no bug, it's logic."
Agreed, I used the wrong terminology when saying bug report.  Please consider, what you have found about his issue has probably taken a fair amount of your time.  This information may be of use to someone else at some stage.  Leaving this information in the Forum is no guaranty of permanency - we have seen post "vanishing" by accident.  The Bugtracker can also be used to pass information to the Devs or the Doc.team, and in this way, you can ensure that it stays on records for all to access.  Just assigned your "bug" to docteam, if you cannot do this, I will catch it and ensure it goes there.  Thanks. chris.
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

mbachmann

Samba network drives and UPPER- lowercase user names
« Reply #12 on: December 09, 2006, 11:26:37 PM »
burnat, i've reported this to Robert van der Aker already, the creator of the SME CUPS contrib. I would report this to bugtracker, if CUPS contrib was available (it is not). I cannot choose from "assign to", it's automatically filled as you choose a contrib.