diff options
author | Karel Zak | 2011-01-25 01:11:37 +0100 |
---|---|---|
committer | Karel Zak | 2011-01-25 01:11:37 +0100 |
commit | 5a669b12f84f85f7ace13712b20ce9592a08f157 (patch) | |
tree | e0d1db464c5b7c72f9b0c637b883c2fcadecf442 /shlibs/mount/src/optstr.c | |
parent | libmount: improve status check, minor cleanups (diff) | |
download | kernel-qcow2-util-linux-5a669b12f84f85f7ace13712b20ce9592a08f157.tar.gz kernel-qcow2-util-linux-5a669b12f84f85f7ace13712b20ce9592a08f157.tar.xz kernel-qcow2-util-linux-5a669b12f84f85f7ace13712b20ce9592a08f157.zip |
libmount: fix user= usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/optstr.c')
-rw-r--r-- | shlibs/mount/src/optstr.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); |