diff options
-rw-r--r-- | source3/client/client.c | 8 | ||||
-rw-r--r-- | source3/include/safe_string.h | 21 | ||||
-rw-r--r-- | source3/nmbd/nmbd_winsserver.c | 3 | ||||
-rw-r--r-- | source3/printing/nt_printing.c | 2 | ||||
-rw-r--r-- | source3/printing/printing.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 8 | ||||
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 6 | ||||
-rw-r--r-- | source3/rpcclient/cmd_spoolss.c | 60 | ||||
-rw-r--r-- | source3/rpcclient/rpcclient.c | 6 | ||||
-rw-r--r-- | source3/smbd/lanman.c | 2 | ||||
-rw-r--r-- | source3/smbd/reply.c | 2 | ||||
-rw-r--r-- | source3/torture/locktest.c | 16 | ||||
-rw-r--r-- | source3/torture/locktest2.c | 8 | ||||
-rw-r--r-- | source3/torture/masktest.c | 8 | ||||
-rw-r--r-- | source3/torture/torture.c | 8 | ||||
-rw-r--r-- | source3/utils/nmblookup.c | 2 | ||||
-rw-r--r-- | source3/utils/smbcacls.c | 6 | ||||
-rw-r--r-- | source3/wrepld/process.c | 3 |
18 files changed, 96 insertions, 75 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index bdcf60bb85..f7c076b79e 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -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; diff --git a/source3/include/safe_string.h b/source3/include/safe_string.h index 118c2302bd..26bf6cdd6f 100644 --- a/source3/include/safe_string.h +++ b/source3/include/safe_string.h @@ -48,6 +48,25 @@ #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) diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index e43dd3f467..4ef476f814 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -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; diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index f04992ac82..72e3d38bb3 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -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; diff --git a/source3/printing/printing.c b/source3/printing/printing.c index a770e7a09a..5f2594f07a 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -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; diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index a289de78de..b44910883c 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -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)) diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index e0a575f143..6d2320d67d 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -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); diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index 06da00748b..f7a34c2964 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -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( diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 02fa91cf26..dc33a8ec2a 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -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; } } diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index b1dfa68fec..25f390be55 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -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) { diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index ef5a090243..580878fe32 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -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) { diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c index a62f7af1ad..5f9a63802b 100644 --- a/source3/torture/locktest.c +++ b/source3/torture/locktest.c @@ -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; diff --git a/source3/torture/locktest2.c b/source3/torture/locktest2.c index 3166d6e326..97844b5609 100644 --- a/source3/torture/locktest2.c +++ b/source3/torture/locktest2.c @@ -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; diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c index 9b83619e85..df0a047aff 100644 --- a/source3/torture/masktest.c +++ b/source3/torture/masktest.c @@ -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; diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 5b25002213..5466d8ef9e 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -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; } } diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c index 017efc60ae..7e0ed4a203 100644 --- a/source3/utils/nmblookup.c +++ b/source3/utils/nmblookup.c @@ -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; diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index e41edcf6f8..a5cee0dae1 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -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; diff --git a/source3/wrepld/process.c b/source3/wrepld/process.c index aca0500614..1f96dc996c 100644 --- a/source3/wrepld/process.c +++ b/source3/wrepld/process.c @@ -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; |