summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 88e4557d60..d7e765d1af 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1253,6 +1253,9 @@ char *automount_lookup(TALLOC_CTX *ctx, const char *user_name)
if ((nis_error = yp_match(nis_domain, nis_map, user_name,
strlen(user_name), &nis_result,
&nis_result_len)) == 0) {
+ if (nis_result_len > 0 && nis_result[nis_result_len] == '\n') {
+ nis_result[nis_result_len] = '\0';
+ }
value = talloc_strdup(ctx, nis_result);
if (!value) {
return NULL;