Merge from HEAD:
authorAndrew Bartlett <abartlet@samba.org>
Tue, 14 Jan 2003 08:53:59 +0000 (08:53 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 14 Jan 2003 08:53:59 +0000 (08:53 +0000)
 - fstring/pstring mixups
 - the detection code that found them (disabled)
 - a bit of whitespace
 - a static

Andrew Bartlett
(This used to be commit 9b70fa868e7d9481f584c83fc4046174e1dedfd9)

18 files changed:
source3/client/client.c
source3/include/safe_string.h
source3/nmbd/nmbd_winsserver.c
source3/printing/nt_printing.c
source3/printing/printing.c
source3/rpc_server/srv_spoolss_nt.c
source3/rpc_server/srv_srvsvc_nt.c
source3/rpcclient/cmd_spoolss.c
source3/rpcclient/rpcclient.c
source3/smbd/lanman.c
source3/smbd/reply.c
source3/torture/locktest.c
source3/torture/locktest2.c
source3/torture/masktest.c
source3/torture/torture.c
source3/utils/nmblookup.c
source3/utils/smbcacls.c
source3/wrepld/process.c

index bdcf60bb85fbe7cdf55a72d14c79722062671631..f7c076b79e534685b0fe4bffb2581eec12e4abc2 100644 (file)
@@ -2847,9 +2847,9 @@ static void remember_query_host(const char *arg,
                        pstrcpy(desthost,optarg);
                        if( 0 == port )
                                port = 139;
-                       message = True;
-                       break;
-               case 'i':
+                       message = True;
+                       break;
+               case 'i':
                        set_global_scope(optarg);
                        break;
                case 'N':
@@ -2978,7 +2978,7 @@ static void remember_query_host(const char *arg,
                        }
                        break;
                case 'D':
-                       pstrcpy(base_directory,optarg);
+                       fstrcpy(base_directory,optarg);
                        break;
                case 'c':
                        cmdstr = optarg;
index 118c2302bd06141cdaa0169fc70da1ec1e622238..26bf6cdd6fb1c5e1a22031b9da1a68d3be719590 100644 (file)
 
 #endif /* !_SPLINT_ */
 
+char * __unsafe_string_function_usage_here__(void);
+
+#if 0 && defined __GNUC__ && __GNUC__ >= 2 && defined __OPTIMIZE__
+
+#define pstrcpy(d,s) ((sizeof(d) != sizeof(pstring) && sizeof(d) != sizeof(char *)) ? __unsafe_string_function_usage_here__() : safe_strcpy((d), (s),sizeof(pstring)-1))
+#define pstrcat(d,s) ((sizeof(d) != sizeof(pstring) && sizeof(d) != sizeof(char *)) ? __unsafe_string_function_usage_here__() : safe_strcat((d), (s),sizeof(pstring)-1))
+#define fstrcpy(d,s) ((sizeof(d) != sizeof(fstring) && sizeof(d) != sizeof(char *)) ? __unsafe_string_function_usage_here__() : safe_strcpy((d),(s),sizeof(fstring)-1))
+#define fstrcat(d,s) ((sizeof(d) != sizeof(fstring) && sizeof(d) != sizeof(char *)) ? __unsafe_string_function_usage_here__() : safe_strcat((d),(s),sizeof(fstring)-1))
+
+#define fstrterminate(d) ((sizeof(d) != sizeof(fstring) && sizeof(d) != sizeof(char *)) ? __unsafe_string_function_usage_here__() : (((d)[sizeof(fstring)-1]) = '\0'))
+#define pstrterminate(d) ((sizeof(d) != sizeof(pstring) && sizeof(d) != sizeof(char *)) ? __unsafe_string_function_usage_here__() : (((d)[sizeof(pstring)-1]) = '\0'))
+
+#define wpstrcpy(d,s) ((sizeof(d) != sizeof(wpstring) && sizeof(d) != sizeof(smb_ucs2_t *)) ? __unsafe_string_function_usage_here__() : safe_strcpy_w((d),(s),sizeof(wpstring)))
+#define wpstrcat(d,s) ((sizeof(d) != sizeof(wpstring) && sizeof(d) != sizeof(smb_ucs2_t *)) ? __unsafe_string_function_usage_here__() : safe_strcat_w((d),(s),sizeof(wpstring)))
+#define wfstrcpy(d,s) ((sizeof(d) != sizeof(wfstring) && sizeof(d) != sizeof(smb_ucs2_t *)) ? __unsafe_string_function_usage_here__() : safe_strcpy_w((d),(s),sizeof(wfstring)))
+#define wfstrcat(d,s) ((sizeof(d) != sizeof(wfstring) && sizeof(d) != sizeof(smb_ucs2_t *)) ? __unsafe_string_function_usage_here__() : safe_strcat_w((d),(s),sizeof(wfstring)))
+
+#else
+
 #define pstrcpy(d,s) safe_strcpy((d), (s),sizeof(pstring)-1)
 #define pstrcat(d,s) safe_strcat((d), (s),sizeof(pstring)-1)
 #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
@@ -61,6 +80,8 @@
 #define wfstrcpy(d,s) safe_strcpy_w((d),(s),sizeof(wfstring))
 #define wfstrcat(d,s) safe_strcat_w((d),(s),sizeof(wfstring))
 
+#endif
+
 /* replace some string functions with multi-byte
    versions */
 #define strlower(s) strlower_m(s)
index e43dd3f467ce63f7ae0d14199918de0f44743b7d..4ef476f81416a15afc2b47a5e092db1878c0ae04 100644 (file)
@@ -250,7 +250,8 @@ BOOL initialise_wins(void)
             kbuf.dptr; 
             newkey = tdb_nextkey(tdb, kbuf), safe_free(kbuf.dptr), kbuf=newkey) {
 
-               pstring name_type, name, ip_str;
+               fstring name_type;
+               pstring name, ip_str;
                char *p;
                int type = 0;
                int nb_flags;
index f04992ac82a2375de4881a4faad1e915440271e5..72e3d38bb3adc1327093a9fd6393ba1f3333e6ff 100644 (file)
@@ -1585,7 +1585,7 @@ static uint32 add_a_printer_driver_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 *driver)
        int len, buflen;
        fstring architecture;
        pstring directory;
-       pstring temp_name;
+       fstring temp_name;
        pstring key;
        char *buf;
        int i, ret;
index a770e7a09a1ac4d99be96068cd8643e749d7b548..5f2594f07af5fb1e8889ddc447418fb3b68f5a14 100644 (file)
@@ -1934,7 +1934,7 @@ int print_queue_status(int snum,
        *queue = NULL;
        printername = lp_const_servicename(snum);
        pdb = get_print_db_byname(printername);
-       
+
        if (!pdb)
                return 0;
 
index a289de78de82685c01487cf5cf8cd892e4cbac96..b44910883c6fb6bbcbb8793a2e5c9b4d940e6cd6 100644 (file)
@@ -262,7 +262,7 @@ static void free_printer_entry(void *ptr)
  Functions to duplicate a SPOOL_NOTIFY_OPTION struct stored in Printer_entry.
 ****************************************************************************/
 
-SPOOL_NOTIFY_OPTION *dup_spool_notify_option(SPOOL_NOTIFY_OPTION *sp)
+static SPOOL_NOTIFY_OPTION *dup_spool_notify_option(SPOOL_NOTIFY_OPTION *sp)
 {
        SPOOL_NOTIFY_OPTION *new_sp = NULL;
 
@@ -1011,12 +1011,12 @@ static void send_notify2_changes( SPOOLSS_NOTIFY_MSG_CTR *ctr, uint32 idx )
                        switch(msg->type) {
                        case PRINTER_NOTIFY_TYPE:
                                if ( printer_notify_table[msg->field].fn )
-                               printer_notify_table[msg->field].fn(msg, &data[data_len], mem_ctx);
+                                       printer_notify_table[msg->field].fn(msg, &data[data_len], mem_ctx);
                                break;
                        
                        case JOB_NOTIFY_TYPE:
                                if ( job_notify_table[msg->field].fn )
-                               job_notify_table[msg->field].fn(msg, &data[data_len], mem_ctx);
+                                       job_notify_table[msg->field].fn(msg, &data[data_len], mem_ctx);
                                break;
 
                        default:
@@ -5409,7 +5409,7 @@ WERROR _spoolss_getprinterdriver2(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVER2 *q_
        *servermajorversion = 0;
        *serverminorversion = 0;
 
-       pstrcpy(servername, get_called_name());
+       fstrcpy(servername, get_called_name());
        unistr2_to_ascii(architecture, uni_arch, sizeof(architecture)-1);
 
        if (!get_printer_snum(p, handle, &snum))
index e0a575f143d9ca37d9c2f3d7e48aacfcc99cd52d..6d2320d67d30ff7ad63b5c164443d8746a9a670d 100644 (file)
@@ -1481,7 +1481,7 @@ WERROR _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
 
        switch (q_u->info_level) {
        case 1:
-               fstrcpy(pathname, lp_pathname(snum));
+               pstrcpy(pathname, lp_pathname(snum));
                unistr2_to_ascii(comment, &q_u->info.share.info2.info_2_str.uni_remark, sizeof(comment));
                type = q_u->info.share.info2.info_2.type;
                psd = NULL;
@@ -1508,7 +1508,7 @@ WERROR _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
                map_generic_share_sd_bits(psd);
                break;
        case 1004:
-               fstrcpy(pathname, lp_pathname(snum));
+               pstrcpy(pathname, lp_pathname(snum));
                unistr2_to_ascii(comment, &q_u->info.share.info1004.info_1004_str.uni_remark, sizeof(comment));
                type = STYPE_DISKTREE;
                break;
@@ -1518,7 +1518,7 @@ WERROR _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
                return WERR_ACCESS_DENIED;
                break;
        case 1501:
-               fstrcpy(pathname, lp_pathname(snum));
+               pstrcpy(pathname, lp_pathname(snum));
                fstrcpy(comment, lp_comment(snum));
                psd = q_u->info.share.info1501.sdb->sec;
                map_generic_share_sd_bits(psd);
index 06da00748b4c4c82882d830a438f058c31af142e..f7a34c2964da3b21ab5ec3482f5953ff7484dfa7 100644 (file)
@@ -60,6 +60,8 @@ BOOL get_short_archi(char *short_archi, const char *long_archi)
                 return False;
         }
 
+       /* this might be client code - but shouldn't this be an fstrcpy etc? */
+
         StrnCpy (short_archi, archi_table[i].short_archi, strlen(archi_table[i].short_archi));
 
         DEBUGADD(108,("index: [%d]\n", i));
@@ -90,7 +92,7 @@ static NTSTATUS cmd_spoolss_open_printer_ex(struct cli_state *cli,
                                             int argc, char **argv)
 {
        WERROR          werror;
-       pstring         printername;
+       fstring         printername;
        fstring         servername, user;
        POLICY_HND      hnd;
        
@@ -102,7 +104,7 @@ static NTSTATUS cmd_spoolss_open_printer_ex(struct cli_state *cli,
        if (!cli)
                return NT_STATUS_UNSUCCESSFUL;
 
-       slprintf (servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper (servername);
        fstrcpy  (user, cli->user_name);
        fstrcpy  (printername, argv[1]);
@@ -489,7 +491,7 @@ static NTSTATUS cmd_spoolss_setprinter(struct cli_state *cli,
                fstrcpy(comment, argv[2]);
        }
 
-       slprintf (servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper (servername);
        fstrcpy (printername, argv[1]);
        fstrcpy  (user, cli->user_name);
@@ -557,9 +559,9 @@ static NTSTATUS cmd_spoolss_getprinter(struct cli_state *cli,
                info_level = atoi(argv[2]);
        }
 
-       slprintf (servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper (servername);
-       slprintf (printername, sizeof(fstring)-1, "%s\\%s", servername, argv[1]);
+       slprintf (printername, sizeof(printername)-1, "%s\\%s", servername, argv[1]);
        fstrcpy  (user, cli->user_name);
        
        /* get a printer handle */
@@ -675,12 +677,12 @@ static NTSTATUS cmd_spoolss_getprinterdata(struct cli_state *cli,
 
        /* Open a printer handle */
 
-       slprintf (servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper (servername);
        if (strncmp(argv[1], ".", sizeof(".")) == 0)
                fstrcpy(printername, servername);
        else
-               slprintf (printername, sizeof(fstring)-1, "%s\\%s", 
+               slprintf (printername, sizeof(servername)-1, "%s\\%s", 
                          servername, argv[1]);
        fstrcpy  (user, cli->user_name);
        
@@ -748,12 +750,12 @@ static NTSTATUS cmd_spoolss_getprinterdataex(struct cli_state *cli,
 
        /* Open a printer handle */
 
-       slprintf (servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper (servername);
        if (strncmp(argv[1], ".", sizeof(".")) == 0)
                fstrcpy(printername, servername);
        else
-               slprintf (printername, sizeof(fstring)-1, "%s\\%s", 
+               slprintf (printername, sizeof(printername)-1, "%s\\%s", 
                          servername, argv[1]);
        fstrcpy  (user, cli->user_name);
        
@@ -930,7 +932,7 @@ static NTSTATUS cmd_spoolss_getdriver(struct cli_state *cli,
        }
 
        /* get the arguments need to open the printer handle */
-       slprintf (servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper (servername);
        fstrcpy  (user, cli->user_name);
        fstrcpy  (printername, argv[1]);
@@ -1300,7 +1302,7 @@ static NTSTATUS cmd_spoolss_addprinterex(struct cli_state *cli,
                return NT_STATUS_OK;
         }
        
-        slprintf (servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+        slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
         strupper (servername);
 
        /* Fill in the DRIVER_INFO_3 struct */
@@ -1362,9 +1364,9 @@ static NTSTATUS cmd_spoolss_setdriver(struct cli_state *cli,
                return NT_STATUS_OK;
         }
 
-       slprintf (servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper (servername);
-       slprintf (printername, sizeof(fstring)-1, "%s\\%s", servername, argv[1]);
+       slprintf (printername, sizeof(printername)-1, "%s\\%s", servername, argv[1]);
        fstrcpy  (user, cli->user_name);
 
        /* Get a printer handle */
@@ -1433,7 +1435,7 @@ static NTSTATUS cmd_spoolss_deletedriver(struct cli_state *cli,
                return NT_STATUS_OK;
         }
 
-       slprintf (servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper (servername);
 
        /* delete the driver for all architectures */
@@ -1818,9 +1820,9 @@ static NTSTATUS cmd_spoolss_setprinterdata(struct cli_state *cli,
                return NT_STATUS_OK;
         }
 
-       slprintf (servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf (servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper (servername);
-       slprintf (printername, sizeof(fstring)-1, "%s\\%s", servername, argv[1]);
+       slprintf (printername, sizeof(servername)-1, "%s\\%s", servername, argv[1]);
        fstrcpy  (user, cli->user_name);
 
        /* get a printer handle */
@@ -1946,11 +1948,10 @@ static NTSTATUS cmd_spoolss_enum_jobs(struct cli_state *cli,
 
        /* Open printer handle */
 
-       slprintf(servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper(servername);
        fstrcpy(user, cli->user_name);
-       fstrcpy(printername, argv[1]);
-       slprintf(printername, sizeof(pstring)-1, "\\\\%s\\", cli->desthost);
+       slprintf(printername, sizeof(servername)-1, "\\\\%s\\", cli->desthost);
        strupper(printername);
        pstrcat(printername, argv[1]);
 
@@ -2018,11 +2019,10 @@ static NTSTATUS cmd_spoolss_enum_data( struct cli_state *cli,
        
        /* Open printer handle */
 
-       slprintf(servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper(servername);
        fstrcpy(user, cli->user_name);
-       fstrcpy(printername, argv[1]);
-       slprintf(printername, sizeof(pstring)-1, "\\\\%s\\", cli->desthost);
+       slprintf(printername, sizeof(printername)-1, "\\\\%s\\", cli->desthost);
        strupper(printername);
        pstrcat(printername, argv[1]);
 
@@ -2082,11 +2082,10 @@ static NTSTATUS cmd_spoolss_enum_data_ex( struct cli_state *cli,
 
        /* Open printer handle */
 
-       slprintf(servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper(servername);
        fstrcpy(user, cli->user_name);
-       fstrcpy(printername, argv[1]);
-       slprintf(printername, sizeof(pstring)-1, "\\\\%s\\", cli->desthost);
+       slprintf(printername, sizeof(printername)-1, "\\\\%s\\", cli->desthost);
        strupper(printername);
        pstrcat(printername, argv[1]);
 
@@ -2151,11 +2150,10 @@ static NTSTATUS cmd_spoolss_enum_printerkey( struct cli_state *cli,
 
        /* Open printer handle */
 
-       slprintf(servername, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+       slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
        strupper(servername);
        fstrcpy(user, cli->user_name);
-       fstrcpy(printername, argv[1]);
-       slprintf(printername, sizeof(pstring)-1, "\\\\%s\\", cli->desthost);
+       slprintf(printername, sizeof(printername)-1, "\\\\%s\\", cli->desthost);
        strupper(printername);
        pstrcat(printername, argv[1]);
 
@@ -2217,10 +2215,10 @@ static NTSTATUS cmd_spoolss_rffpcnex(struct cli_state *cli,
 
        /* Open printer */
 
-       slprintf(servername, sizeof(fstring) - 1, "\\\\%s", cli->desthost);
+       slprintf(servername, sizeof(servername) - 1, "\\\\%s", cli->desthost);
        strupper(servername);
 
-       slprintf(printername, sizeof(fstring) - 1, "\\\\%s\\%s", cli->desthost,
+       slprintf(printername, sizeof(printername) - 1, "\\\\%s\\%s", cli->desthost,
                 argv[1]);
        strupper(printername);
 
@@ -2260,7 +2258,7 @@ static NTSTATUS cmd_spoolss_rffpcnex(struct cli_state *cli,
 
        /* Send rffpcnex */
 
-       slprintf(servername, sizeof(fstring) - 1, "\\\\%s", myhostname());
+       slprintf(servername, sizeof(servername) - 1, "\\\\%s", myhostname());
        strupper(servername);
 
        result = cli_spoolss_rffpcnex(
index 02fa91cf267d1939e19ac17191b24608d468c2d9..dc33a8ec2a98cb450f2b74047ec9846a6abbdd5a 100644 (file)
@@ -646,11 +646,11 @@ static NTSTATUS process_cmd(struct cli_state *cli, char *cmd)
                case 'U': {
                        char *lp;
 
-                       pstrcpy(username,opt_username);
+                       fstrcpy(username,opt_username);
 
                        if ((lp=strchr_m(username,'%'))) {
                                *lp = 0;
-                               pstrcpy(password,lp+1);
+                               fstrcpy(password,lp+1);
                                got_pass = 1;
                                memset(strchr_m(opt_username,'%') + 1, 'X',
                                       strlen(password));
@@ -664,7 +664,7 @@ static NTSTATUS process_cmd(struct cli_state *cli, char *cmd)
                                return 1;
                        }
                case 'W':
-                       pstrcpy(domain, opt_domain);
+                       fstrcpy(domain, opt_domain);
                        break;
                }
        }
index b1dfa68fec5018ebe6455542533539b7322a8599..25f390be55e7f0ac15ad93f9d8eecf408d6516db 100644 (file)
@@ -1008,7 +1008,7 @@ static int get_server_info(uint32 servertype,
     if (!next_token(&ptr,s->comment, NULL, sizeof(s->comment))) continue;
     if (!next_token(&ptr,s->domain , NULL, sizeof(s->domain))) {
       /* this allows us to cope with an old nmbd */
-      pstrcpy(s->domain,lp_workgroup()); 
+      fstrcpy(s->domain,lp_workgroup()); 
     }
     
     if (sscanf(stype,"%X",&s->type) != 1) { 
index ef5a0902439c4ed8e806c7edaf31e958eaa1e40a..580878fe3205597b8d96a36ab0c952044d496fa1 100644 (file)
@@ -669,7 +669,7 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
                if (!conn->dirptr)
                        goto SearchEmpty;
                string_set(&conn->dirpath,dptr_path(dptr_num));
-               fstrcpy(mask, dptr_wcard(dptr_num));
+               pstrcpy(mask, dptr_wcard(dptr_num));
        }
 
        if (can_open) {
index a62f7af1ad693b18bb71b3ccfe8ceed2dac42ce3..5f9a63802b31d351ed0b343c5ee87e6af0e4f9a0 100644 (file)
@@ -193,14 +193,14 @@ static struct cli_state *connect_one(char *share, int snum)
        if (!got_pass) {
                char *pass = getpass("Password: ");
                if (pass) {
-                       pstrcpy(password[0], pass);
-                       pstrcpy(password[1], pass);
+                       fstrcpy(password[0], pass);
+                       fstrcpy(password[1], pass);
                }
        }
 
        if (got_pass == 1) {
-               pstrcpy(password[1], password[0]);
-               pstrcpy(username[1], username[0]);
+               fstrcpy(password[1], password[0]);
+               fstrcpy(username[1], username[0]);
        }
 
        if (!cli_session_setup(c, username[snum], 
@@ -591,8 +591,8 @@ static void usage(void)
        load_interfaces();
 
        if (getenv("USER")) {
-               pstrcpy(username[0],getenv("USER"));
-               pstrcpy(username[1],getenv("USER"));
+               fstrcpy(username[0],getenv("USER"));
+               fstrcpy(username[1],getenv("USER"));
        }
 
        seed = time(NULL);
@@ -613,11 +613,11 @@ static void usage(void)
                                d_printf("Max of 2 usernames\n");
                                exit(1);
                        }
-                       pstrcpy(username[got_pass],optarg);
+                       fstrcpy(username[got_pass],optarg);
                        p = strchr_m(username[got_pass],'%');
                        if (p) {
                                *p = 0;
-                               pstrcpy(password[got_pass], p+1);
+                               fstrcpy(password[got_pass], p+1);
                                got_pass++;
                        }
                        break;
index 3166d6e326423846967e1f533285911f8ac016f5..97844b5609ecfbea1ad374ab0862d453079592f4 100644 (file)
@@ -169,7 +169,7 @@ static struct cli_state *connect_one(char *share)
        if (!got_pass) {
                char *pass = getpass("Password: ");
                if (pass) {
-                       pstrcpy(password, pass);
+                       fstrcpy(password, pass);
                }
        }
 
@@ -504,7 +504,7 @@ static void usage(void)
        load_interfaces();
 
        if (getenv("USER")) {
-               pstrcpy(username,getenv("USER"));
+               fstrcpy(username,getenv("USER"));
        }
 
        seed = time(NULL);
@@ -512,11 +512,11 @@ static void usage(void)
        while ((opt = getopt(argc, argv, "U:s:ho:aAW:O")) != EOF) {
                switch (opt) {
                case 'U':
-                       pstrcpy(username,optarg);
+                       fstrcpy(username,optarg);
                        p = strchr_m(username,'%');
                        if (p) {
                                *p = 0;
-                               pstrcpy(password, p+1);
+                               fstrcpy(password, p+1);
                                got_pass = 1;
                        }
                        break;
index 9b83619e8582ed2316afff39990fd7fb95ba18a5..df0a047aff32eb5461a1c734f045cab37679711a 100644 (file)
@@ -213,7 +213,7 @@ struct cli_state *connect_one(char *share)
        if (!got_pass) {
                char *pass = getpass("Password: ");
                if (pass) {
-                       pstrcpy(password, pass);
+                       fstrcpy(password, pass);
                }
        }
 
@@ -456,7 +456,7 @@ static void usage(void)
        load_interfaces();
 
        if (getenv("USER")) {
-               pstrcpy(username,getenv("USER"));
+               fstrcpy(username,getenv("USER"));
        }
 
        seed = time(NULL);
@@ -479,11 +479,11 @@ static void usage(void)
                        max_protocol = interpret_protocol(optarg, max_protocol);
                        break;
                case 'U':
-                       pstrcpy(username,optarg);
+                       fstrcpy(username,optarg);
                        p = strchr_m(username,'%');
                        if (p) {
                                *p = 0;
-                               pstrcpy(password, p+1);
+                               fstrcpy(password, p+1);
                                got_pass = 1;
                        }
                        break;
index 5b25002213912148edd16f829c8a263c751dda90..5466d8ef9ee36f56c32c01f375709fecbf65c288 100644 (file)
@@ -4055,7 +4055,7 @@ static void usage(void)
        get_myname(myname);
 
        if (*username == 0 && getenv("LOGNAME")) {
-         pstrcpy(username,getenv("LOGNAME"));
+         fstrcpy(username,getenv("LOGNAME"));
        }
 
        argc--;
@@ -4110,11 +4110,11 @@ static void usage(void)
 #endif
                        break;
                case 'U':
-                       pstrcpy(username,optarg);
+                       fstrcpy(username,optarg);
                        p = strchr_m(username,'%');
                        if (p) {
                                *p = 0;
-                               pstrcpy(password, p+1);
+                               fstrcpy(password, p+1);
                                gotpass = 1;
                        }
                        break;
@@ -4128,7 +4128,7 @@ static void usage(void)
        while (!gotpass) {
                p = getpass("Password:");
                if (p) {
-                       pstrcpy(password, p);
+                       fstrcpy(password, p);
                        gotpass = 1;
                }
        }
index 017efc60ae5768c9396404e39e1f13fb2e57e9e7..7e0ed4a2030287d5176de9d57e3c69c35e5d6962 100644 (file)
@@ -210,7 +210,7 @@ int main(int argc,char *argv[])
 {
   int opt;
   unsigned int lookup_type = 0x0;
-  pstring lookup;
+  fstring lookup;
   extern int optind;
   extern char *optarg;
   BOOL find_master=False;
index e41edcf6f8a42c9138b2fac7448a1b6883eaf86b..a5cee0dae1202593a9069cf138ffd0e3747bb578 100644 (file)
@@ -718,7 +718,7 @@ static struct cli_state *connect_one(const char *share)
        if (!got_pass) {
                char *pass = getpass("Password: ");
                if (pass) {
-                       pstrcpy(password, pass);
+                       fstrcpy(password, pass);
                        got_pass = True;
                }
        }
@@ -806,7 +806,7 @@ You can string acls together with spaces, commas or newlines\n\
 
                if ((p=strchr_m(username,'%'))) {
                        *p = 0;
-                       pstrcpy(password,p+1);
+                       fstrcpy(password,p+1);
                        got_pass = True;
                        memset(strchr_m(getenv("USER"), '%') + 1, 'X',
                               strlen(password));
@@ -820,7 +820,7 @@ You can string acls together with spaces, commas or newlines\n\
                        p = strchr_m(username,'%');
                        if (p) {
                                *p = 0;
-                               pstrcpy(password, p+1);
+                               fstrcpy(password, p+1);
                                got_pass = 1;
                        }
                        break;
index aca0500614c9c5704b2e0785b86d70abb2da89d0..1f96dc996cd79aecd917df7f264f805dd4fdd1fe 100644 (file)
@@ -498,7 +498,8 @@ static void send_entry_request(GENERIC_PACKET *q, GENERIC_PACKET *r)
        for (kbuf = tdb_firstkey(tdb); 
             kbuf.dptr; 
             newkey = tdb_nextkey(tdb, kbuf), safe_free(kbuf.dptr), kbuf=newkey) {
-               pstring name_type, name, ip_str;
+               fstring name_type;
+               pstring name, ip_str;
                char *p;
                int type = 0;
                int nb_flags;