From 5a669b12f84f85f7ace13712b20ce9592a08f157 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 25 Jan 2011 01:11:37 +0100 Subject: libmount: fix user= usage Signed-off-by: Karel Zak --- shlibs/mount/src/optstr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'shlibs/mount/src/optstr.c') diff --git a/shlibs/mount/src/optstr.c b/shlibs/mount/src/optstr.c index 9c8aa62e6..fd4a8610c 100644 --- a/shlibs/mount/src/optstr.c +++ b/shlibs/mount/src/optstr.c @@ -945,12 +945,13 @@ int mnt_optstr_fix_user(char **optstr) if (!username) return -ENOMEM; - if (!ol.valsz || strncmp(ol.value, username, ol.valsz)) { + if (!ol.valsz || (ol.value && strncmp(ol.value, username, ol.valsz))) { if (ol.valsz) /* remove old value */ mnt_optstr_remove_option_at(optstr, ol.value, ol.end); - rc = insert_value(optstr, ol.value, username, NULL); + rc = insert_value(optstr, ol.value ? ol.value : ol.end, + username, NULL); } free(username); -- cgit v1.2.3-55-g7522