Getent removing slashes on Ub 1604
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LTSP5 |
Fix Released
|
Medium
|
Alkis Georgopoulos |
Bug Description
As discussed on the ltsp-discussions mailing list (mail included below) with a solution proposed from Alkis Georgopoulos.
Problem:
getent passwd user
Returns a windows path with backslashes removed on LTSP client but works fine on LTSP server.
Solution:
open ($CHROOT)
find 2 "read" commands in lines 36 and 46 and replace them with "read -r" so that it doesn't interpret the backslashes.
i.e.:
IFS=':' read -r LDM_USERNAME dummy pw_uid pw_gid pw_gecos LDM_HOME
pw_shell <<EOF
and:
while IFS=':' read -r gr_name dummy gr_gid dummy; do
Full email:
We've been running LTSP for a while now on Ubuntu 14.04, and I'm in the process of upgrading to 16.04.
Our server connects to Windows using kerberos, samba and nslcd to map attributes to their unix counterparts. This works well, and allows me to login to a client using Windows credentials and map the drive locally.
However, on Ub1404, to map the home directory I run a script which uses getent, and the returned string is, e.g. \\server\
But on Ub1604, getent does not return this properly, but instead removes the slashes, e.g. \serversharesha
If I run getent on the LTSP server, it works, but not on the client.
I've never seen this before. When I strace getent from the client, it doesn't even seem to query nsswitch, whereas it does from the server.
e.g. from client:
$ strace -e open getent passwd testac
open("/
open("/
open("/
testac:
+++ exited with 0 +++
But from the server it seems more comprehensive:
$ strace -e open getent passwd testac
open("/
open("/
open("/
open("/
open("/
open("/
open("/etc/passwd&
quot;, O_RDONLY|O_CLOEXEC) = 3
open("/
open("/
testac:
+++ exited with 0 +++
I know authentication can be one of those tricky subjects, but I don't personally feel that this is the issue here, whereas the weird behaviour of getent is. If anyone has any clues or pointers I'd be very grateful, everything else seems to be working fine.
Best Wishes
John
Solution email:
Hi John,
open ($CHROOT)
find 2 "read" commands in lines 36 and 46
and replace them with "read -r" so that it doesn't interpret the
backslashes.
I.e.:
IFS=':' read -r LDM_USERNAME dummy pw_uid pw_gid pw_gecos LDM_HOME
pw_shell <<EOF
and:
while IFS=':' read -r gr_name dummy gr_gid dummy; do
If that works, file a bug report in https:/
that I can commit the fix.
Cheers,
Alkis Georgopoulos
LTSP developer
Changed in ltsp: | |
status: | Fix Committed → Fix Released |
Fix committed in https:/ /git.launchpad. net/ltsp/ commit/ ?id=937e6f32b73 88c454aba0db2c1 da054d2bbed730