The Samba-Bugzilla – Bug 3730
Result value in automount_lookup is not correctly trimed
Last modified: 2006-06-22 15:00:30 UTC
+++ This bug was initially created as a clone of Bug #3648 +++
I hope this problem is not only Irix specific.
The nis-lookup for an entry in auto.home-map has a trailing newline. This was stripped in samba releases before 3.0.2x.
Starting with samba 3.0.20 this behavior changed to NOT stripping the trailing newline after the nis-lookup. So I tracked the problem to the automoun_lookup function in source/lib/util.c.
In samba-3.0.14a the function automount_lookup (source/lib/util.c - NOT nisplus) the end of the string is marked with '\0'. This leads to the correct result.
strncpy(last_value, nis_result, nis_result_len);
last_value[nis_result_len] = '\0';
Starting with the 3.0.2x series the code changed to:
Unfortunatly the trailing newline from the nis-lookup was no longer stripped.
The log results in:
[2006/03/31 08:54:51, 0] smbd/service.c:(660)
'/usr2/people/hertha_' does not exist or permission denied when connecting to [hertha] Error was No such file or directory
The real result should be /usr2/people/hertha, so the newline changes to underscore.
Changing the code to:
--> last_value[nis_result_len] = '\0';
The result will be correct an the connection is successful.
I don't know if this is a patch or more a hack ;-). I found no trim function, that would the correct solution.
*** This bug has been marked as a duplicate of 3648 ***