trying to get HEAD building again. If you want the code
[kai/samba-autobuild/.git] / source3 / torture / rpctorture.c
index b61bfb639e235c05305be3e8d565930bef67ac6a..8dfaebd64fae68eee83667509352b6250edd5eb8 100644 (file)
@@ -1,6 +1,5 @@
 /* 
-   Unix SMB/Netbios implementation.
-   Version 1.9.
+   Unix SMB/CIFS implementation.
    SMB client
    Copyright (C) Andrew Tridgell 1994-1998
    
@@ -30,8 +29,6 @@ extern pstring global_myname;
 extern pstring user_socket_options;
 
 
-extern pstring debugf;
-
 extern file_info def_finfo;
 
 #define CNV_LANG(s) dos2unix_format(s,False)
@@ -225,14 +222,13 @@ enum client_action
        int opt;
        extern char *optarg;
        extern int optind;
-       static pstring servicesf = CONFIGFILE;
        pstring term_code;
        BOOL got_pass = False;
        char *cmd_str="";
-       mode_t myumask = 0755;
        enum client_action cli_action = CLIENT_NONE;
        int nprocs = 1;
        int numops = 100;
+       pstring logfile;
 
        struct client_info cli_info;
 
@@ -246,9 +242,9 @@ enum client_action
        *term_code = 0;
 #endif /* KANJI */
 
-       if (!lp_load(servicesf,True, False, False))
+       if (!lp_load(dyn_CONFIGFILE,True, False, False))
        {
-               fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
+               fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
        }
 
        DEBUGLEVEL = 0;
@@ -293,11 +289,6 @@ enum client_action
 
        setup_logging(pname, True);
 
-       TimeInit();
-
-       myumask = umask(0);
-       umask(myumask);
-
        if (!get_myname(global_myname))
        {
                fprintf(stderr, "Failed to get my hostname.\n");
@@ -372,7 +363,7 @@ enum client_action
                        case 'S':
                        {
                                pstrcpy(cli_info.dest_host,optarg);
-                               strupper(cli_info.dest_host);
+                               strupper_m(cli_info.dest_host);
                                cli_action = CLIENT_IPC;
                                break;
                        }
@@ -412,7 +403,7 @@ enum client_action
                        case 'I':
                        {
                                cli_info.dest_ip = *interpret_addr2(optarg);
-                               if (zero_ip(cli_info.dest_ip))
+                               if (is_zero_ip(cli_info.dest_ip))
                                {
                                        exit(1);
                                }
@@ -448,8 +439,9 @@ enum client_action
 
                        case 'l':
                        {
-                               slprintf(debugf, sizeof(debugf)-1,
+                               slprintf(logfile, sizeof(logfile)-1,
                                         "%s.client",optarg);
+                               lp_set_logfile(logfile);
                                break;
                        }
 
@@ -469,7 +461,7 @@ enum client_action
 
                        case 's':
                        {
-                               pstrcpy(servicesf, optarg);
+                               pstrcpy(dyn_CONFIGFILE, optarg);
                                break;
                        }
 
@@ -494,7 +486,7 @@ enum client_action
                exit(1);
        }
 
-       strupper(global_myname);
+       strupper_m(global_myname);
        fstrcpy(cli_info.myhostname, global_myname);
 
        DEBUG(3,("%s client started (version %s)\n",timestring(False),VERSION));
@@ -503,7 +495,7 @@ enum client_action
        {
                pstrcpy(smb_cli->domain,lp_workgroup());
        }
-       strupper(smb_cli->domain);
+       strupper_m(smb_cli->domain);
 
        load_interfaces();
 
@@ -514,7 +506,7 @@ enum client_action
        }
 
        fstrcpy(cli_info.mach_acct, cli_info.myhostname);
-       strupper(cli_info.mach_acct);
+       strupper_m(cli_info.mach_acct);
        fstrcat(cli_info.mach_acct, "$");
 
        /* set the password cache info */