s3:net idmap restore: correctly abort operation if dbfile could not be determined
authorMichael Adam <obnox@samba.org>
Tue, 8 Feb 2011 22:24:57 +0000 (23:24 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 9 Feb 2011 13:00:34 +0000 (14:00 +0100)
source3/utils/net_idmap.c

index 42f1172ad2975445d6c4a0dfa3f511311582aab4..439b6bbf919f6c69d34314f428430fce7ad9a862 100644 (file)
@@ -197,6 +197,11 @@ static int net_idmap_restore(struct net_context *c, int argc, const char **argv)
 
        dbfile = net_idmap_dbfile(c);
 
+       if (dbfile == NULL) {
+               ret = -1;
+               goto done;
+       }
+
        d_fprintf(stderr, _("restoring id mapping to %s\n"), dbfile);
 
        if (argc == 1) {