diff options
author | Gregor Beck <gbeck@sernet.de> | 2011-02-08 12:03:08 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-02-09 14:00:34 +0100 |
commit | 1f1a165ea9104891eb51f84ab07dc4977938024b (patch) | |
tree | 4476c54c534e496909c686e56417d0e7da7549bc /source3/utils | |
parent | 47f499abf65d1a3d3f82e4a56878d33140d46a68 (diff) | |
download | samba-1f1a165ea9104891eb51f84ab07dc4977938024b.tar.gz samba-1f1a165ea9104891eb51f84ab07dc4977938024b.tar.bz2 samba-1f1a165ea9104891eb51f84ab07dc4977938024b.zip |
s3:net idmap restore: fix segfault on missing input file
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_idmap.c | 6 |
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; } |