diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-03-21 06:44:49 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-03-21 06:44:49 +0000 |
commit | 90890ef9fc2e0e1de389f6bc8137f7db7c8f9621 (patch) | |
tree | 946694201853aaffb536343a36eed3ceaff8278c /source3 | |
parent | 85a18b2c0cbccf8fa774ac5fb56e3c569ba4834c (diff) | |
download | samba-90890ef9fc2e0e1de389f6bc8137f7db7c8f9621.tar.gz samba-90890ef9fc2e0e1de389f6bc8137f7db7c8f9621.tar.bz2 samba-90890ef9fc2e0e1de389f6bc8137f7db7c8f9621.zip |
added -E option (for exit on errors)
forced exclusion of filenames containing only '.' as NT rejects those
(This used to be commit a83ff172f271aa74148016f0e2ac62c868c140fb)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/masktest.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/utils/masktest.c b/source3/utils/masktest.c index 8ee590d077..a654b5bfd1 100644 --- a/source3/utils/masktest.c +++ b/source3/utils/masktest.c @@ -33,6 +33,7 @@ static BOOL old_list = False; static char *maskchars = "<>\"?*abc."; static char *filechars = "abcdefghijklm."; static int verbose; +static int die_on_error; /* a test fn for LANMAN mask support */ int ms_fnmatch_lanman_core(char *pattern, char *string) @@ -327,7 +328,7 @@ static void testpair(struct cli_state *cli, char *mask, char *file) if (showall || strcmp(res1, res2)) { DEBUG(0,("%s %s %d mask=[%s] file=[%s] rfile=[%s/%s]\n", res1, res2, count, mask, file, long_name, short_name)); - /* exit(1); */ + if (die_on_error) exit(1); } cli_unlink(cli, file); @@ -380,6 +381,8 @@ static void test_mask(int argc, char *argv[], strcmp(file+l,"..") == 0 || strcmp(mask+l,"..") == 0) continue; + if (strspn(file+l, ".") == strlen(file+l)) continue; + testpair(cli, mask, file); } @@ -454,8 +457,11 @@ static void usage(void) seed = time(NULL); - while ((opt = getopt(argc, argv, "U:s:hm:f:aoW:M:v")) != EOF) { + while ((opt = getopt(argc, argv, "U:s:hm:f:aoW:M:vE")) != EOF) { switch (opt) { + case 'E': + die_on_error = 1; + break; case 'v': verbose++; break; |