summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2015-04-30 14:05:21 -0400
committerSteve Dickson <steved@redhat.com>2015-05-04 07:36:52 -0400
commit4927109a739edd57a5c7eb4311127e5349dcaba2 (patch)
tree90af0d3e4e760729cc1abe9f51c4b68d09de549b
parentc08f1382e5609bc686c3df95ff1e267804b37a61 (diff)
downloadnfs-utils-4927109a739edd57a5c7eb4311127e5349dcaba2.tar.gz
nfs-utils-4927109a739edd57a5c7eb4311127e5349dcaba2.tar.xz
nfs-utils-4927109a739edd57a5c7eb4311127e5349dcaba2.zip
nfsidmap: make sure give arguments are valid
Detect when a given argument is invalid. Log the error and exit gracefully Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/nfsidmap/nfsidmap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/nfsidmap/nfsidmap.c b/utils/nfsidmap/nfsidmap.c
index 5d62078..1f5ba67 100644
--- a/utils/nfsidmap/nfsidmap.c
+++ b/utils/nfsidmap/nfsidmap.c
@@ -323,7 +323,10 @@ int main(int argc, char **argv)
}
type = strtok(arg, ":");
value = strtok(NULL, ":");
-
+ if (value == NULL) {
+ xlog_err("Error: Null uid/gid value.");
+ return 1;
+ }
if (verbose) {
xlog_warn("key: 0x%lx type: %s value: %s timeout %ld",
key, type, value, timeout);