summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-02-08 12:03:08 +0100
committerMichael Adam <obnox@samba.org>2011-02-09 14:00:34 +0100
commit1f1a165ea9104891eb51f84ab07dc4977938024b (patch)
tree4476c54c534e496909c686e56417d0e7da7549bc
parent47f499abf65d1a3d3f82e4a56878d33140d46a68 (diff)
downloadsamba-1f1a165ea9104891eb51f84ab07dc4977938024b.tar.gz
samba-1f1a165ea9104891eb51f84ab07dc4977938024b.tar.bz2
samba-1f1a165ea9104891eb51f84ab07dc4977938024b.zip
s3:net idmap restore: fix segfault on missing input file
-rw-r--r--source3/utils/net_idmap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c
index 7551354cef..3f9fa80059 100644
--- a/source3/utils/net_idmap.c
+++ b/source3/utils/net_idmap.c
@@ -190,6 +190,12 @@ static int net_idmap_restore(struct net_context *c, int argc, const char **argv)
if (argc == 1) {
input = fopen(argv[0], "r");
+ if (input == NULL) {
+ d_fprintf(stderr, _("Could not open input file (%s): %s\n"),
+ argv[0], strerror(errno));
+ ret = -1;
+ goto done;
+ }
} else {
input = stdin;
}