Browse Source

Check for extra command line arguments

Otherwise, excluded domains might be silently ignored.
tags/1.1
Timo Röhling 11 years ago
parent
commit
ea35d05dcf
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      postsrsd.c

+ 4
- 0
postsrsd.c View File

307
         return EXIT_SUCCESS;
307
         return EXIT_SUCCESS;
308
     }
308
     }
309
   }
309
   }
310
+  if (optind < argc) {
311
+    fprintf (stderr, "%s: extra argument on command line: %s\n", self, argv[optind]);
312
+    return EXIT_FAILURE;
313
+  }
310
   if (domain == NULL) {
314
   if (domain == NULL) {
311
     fprintf (stderr, "%s: You must set a home domain (-d)\n", self);
315
     fprintf (stderr, "%s: You must set a home domain (-d)\n", self);
312
     return EXIT_FAILURE;
316
     return EXIT_FAILURE;

Loading…
Cancel
Save