diff options
Diffstat (limited to 'source3/client/clitar.c')
-rw-r--r-- | source3/client/clitar.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c index dfda997ca2..612a383ce0 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -202,7 +202,7 @@ static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t m /* write out a "standard" tar format header */ hb.dbuf.name[NAMSIZ-1]='\0'; - safe_strcpy(hb.dbuf.mode, amode, sizeof(hb.dbuf.mode)-1); + safe_strcpy(hb.dbuf.mode, amode, strlen(amode)); oct_it((SMB_BIG_UINT)0, 8, hb.dbuf.uid); oct_it((SMB_BIG_UINT)0, 8, hb.dbuf.gid); oct_it((SMB_BIG_UINT) size, 13, hb.dbuf.size); @@ -796,11 +796,11 @@ static void do_tar(file_info *finfo) DEBUG(5, ("Excl: strlen(cur_dir) = %d\n", (int)strlen(cur_dir))); - pstrcpy(exclaim, cur_dir); + safe_strcpy(exclaim, cur_dir, sizeof(pstring)); *(exclaim+strlen(exclaim)-1)='\0'; - pstrcat(exclaim, "\\"); - pstrcat(exclaim, finfo->name); + safe_strcat(exclaim, "\\", sizeof(pstring)); + safe_strcat(exclaim, finfo->name, sizeof(exclaim)); DEBUG(5, ("...tar_re_search: %d\n", tar_re_search)); @@ -820,12 +820,12 @@ static void do_tar(file_info *finfo) pstring saved_curdir; pstring mtar_mask; - pstrcpy(saved_curdir, cur_dir); + safe_strcpy(saved_curdir, cur_dir, sizeof(saved_curdir)); DEBUG(5, ("Sizeof(cur_dir)=%d, strlen(cur_dir)=%d, strlen(finfo->name)=%d\nname=%s,cur_dir=%s\n", (int)sizeof(cur_dir), (int)strlen(cur_dir), (int)strlen(finfo->name), finfo->name, cur_dir)); - pstrcat(cur_dir,finfo->name); - pstrcat(cur_dir,"\\"); + safe_strcat(cur_dir,finfo->name, sizeof(cur_dir)); + safe_strcat(cur_dir,"\\", sizeof(cur_dir)); DEBUG(5, ("Writing a dir, Name = %s\n", cur_dir)); @@ -836,16 +836,16 @@ static void do_tar(file_info *finfo) DEBUG(0,(" directory %s\n", cur_dir)); } ntarf++; /* Make sure we have a file on there */ - pstrcpy(mtar_mask,cur_dir); - pstrcat(mtar_mask,"*"); + safe_strcpy(mtar_mask,cur_dir, sizeof(pstring)); + safe_strcat(mtar_mask,"*", sizeof(pstring)); DEBUG(5, ("Doing list with mtar_mask: %s\n", mtar_mask)); do_list(mtar_mask, attribute, do_tar, False, True); - pstrcpy(cur_dir,saved_curdir); + safe_strcpy(cur_dir,saved_curdir, sizeof(pstring)); } else { - pstrcpy(rname,cur_dir); - pstrcat(rname,finfo->name); + safe_strcpy(rname,cur_dir, sizeof(pstring)); + safe_strcat(rname,finfo->name, sizeof(pstring)); do_atar(rname,finfo->name,finfo); } } @@ -1089,7 +1089,7 @@ static char * get_longfilename(file_info2 finfo) BOOL first = True; DEBUG(5, ("Restoring a long file name: %s\n", finfo.name)); - DEBUG(5, ("Len = %.0f\n", (double)finfo.size)); + DEBUG(5, ("Len = %d\n", (int)finfo.size)); if (longname == NULL) { @@ -1362,8 +1362,8 @@ int cmd_setmode(void) return 1; } - pstrcpy(fname, cur_dir); - pstrcat(fname, buf); + safe_strcpy(fname, cur_dir, sizeof(pstring)); + safe_strcat(fname, buf, sizeof(pstring)); while (next_token_nr(NULL,buf,NULL,sizeof(buf))) { q=buf; @@ -1459,32 +1459,32 @@ int process_tar(void) if (strrchr_m(cliplist[i], '\\')) { pstring saved_dir; - pstrcpy(saved_dir, cur_dir); + safe_strcpy(saved_dir, cur_dir, sizeof(pstring)); if (*cliplist[i]=='\\') { - pstrcpy(tarmac, cliplist[i]); + safe_strcpy(tarmac, cliplist[i], sizeof(pstring)); } else { - pstrcpy(tarmac, cur_dir); - pstrcat(tarmac, cliplist[i]); + safe_strcpy(tarmac, cur_dir, sizeof(pstring)); + safe_strcat(tarmac, cliplist[i], sizeof(pstring)); } - pstrcpy(cur_dir, tarmac); + safe_strcpy(cur_dir, tarmac, sizeof(pstring)); *(strrchr_m(cur_dir, '\\')+1)='\0'; DEBUG(5, ("process_tar, do_list with tarmac: %s\n", tarmac)); do_list(tarmac,attribute,do_tar, False, True); - pstrcpy(cur_dir,saved_dir); + safe_strcpy(cur_dir,saved_dir, sizeof(pstring)); } else { - pstrcpy(tarmac, cur_dir); - pstrcat(tarmac, cliplist[i]); + safe_strcpy(tarmac, cur_dir, sizeof(pstring)); + safe_strcat(tarmac, cliplist[i], sizeof(pstring)); DEBUG(5, ("process_tar, do_list with tarmac: %s\n", tarmac)); do_list(tarmac,attribute,do_tar, False, True); } } } else { pstring mask; - pstrcpy(mask,cur_dir); + safe_strcpy(mask,cur_dir, sizeof(pstring)); DEBUG(5, ("process_tar, do_list with mask: %s\n", mask)); - pstrcat(mask,"\\*"); + safe_strcat(mask,"\\*", sizeof(pstring)); do_list(mask,attribute,do_tar,False, True); } |