use lp_workgroup()
authorAndrew Tridgell <tridge@samba.org>
Wed, 24 May 2000 05:56:34 +0000 (05:56 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 24 May 2000 05:56:34 +0000 (05:56 +0000)
use \\ in front of filenames
get short name via a separate trans2 level 260 call
(This used to be commit 5fd4dbf72e317bc47ab11b0b3f2e15d0c58879c8)

source3/utils/masktest.c

index a3eb95bcaedfc4c047e76da8100e6561e9ee1888..dc394dddb54faf91b763eba0fa24d68c3217863e 100644 (file)
@@ -26,7 +26,6 @@
 extern int DEBUGLEVEL;
 static fstring password;
 static fstring username;
-static fstring workgroup;
 static int got_pass;
 
 static BOOL showall = False;
@@ -124,7 +123,7 @@ struct cli_state *connect_one(char *share)
        if (!cli_session_setup(c, username, 
                               password, strlen(password),
                               password, strlen(password),
-                              workgroup)) {
+                              lp_workgroup())) {
                DEBUG(0,("session setup failed: %s\n", cli_errstr(c)));
                return NULL;
        }
@@ -170,6 +169,15 @@ void listfn(file_info *f, const char *s)
        finfo = f;
 }
 
+static void get_short_name(struct cli_state *cli, 
+                          char *name, fstring short_name)
+{
+       cli_list(cli, name, aHIDDEN | aDIR, listfn);
+       if (finfo) {
+               fstrcpy(short_name, finfo->short_name);
+               strlower(short_name);
+       }
+}
 
 static void testpair(struct cli_state *cli, char *mask, char *file)
 {
@@ -197,10 +205,8 @@ static void testpair(struct cli_state *cli, char *mask, char *file)
                cli_list_old(cli, mask, aHIDDEN | aDIR, listfn);
        } else {
                cli_list(cli, mask, aHIDDEN | aDIR, listfn);
-       }
-       if (finfo) {
-               fstrcpy(short_name, finfo->short_name);
-               strlower(short_name);
+               finfo = NULL;
+               get_short_name(cli, file, short_name);
        }
 
        res2 = reg_test(mask, file, short_name);
@@ -223,7 +229,7 @@ static void test_mask(int argc, char *argv[],
        int mc_len = strlen(maskchars);
        int fc_len = strlen(filechars);
 
-       cli_mkdir(cli, "masktest");
+       cli_mkdir(cli, "\\masktest");
 
        cli_unlink(cli, "\\masktest\\*");
 
@@ -363,9 +369,6 @@ static void usage(void)
                case 'o':
                        old_list = True;
                        break;
-               case 'W':
-                       pstrcpy(workgroup, optarg);
-                       break;
                default:
                        printf("Unknown option %c (%d)\n", (char)opt, opt);
                        exit(1);