diff options
author | Gerald Carter <jerry@samba.org> | 2003-04-11 23:50:21 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-04-11 23:50:21 +0000 |
commit | a056cd8845989475a72ae88681cfb3c9d7b23377 (patch) | |
tree | a5a1ba000b8337935807fa99fa4fec9486eb7009 /source3/smbd | |
parent | 5b51fc4f065e9e68eefb530eb99ad8da9f4e5d28 (diff) | |
download | samba-a056cd8845989475a72ae88681cfb3c9d7b23377.tar.gz samba-a056cd8845989475a72ae88681cfb3c9d7b23377.tar.bz2 samba-a056cd8845989475a72ae88681cfb3c9d7b23377.zip |
* We must return 0x2 as the majorversion for nt4 to upload drivers
* fix bug found by clobber_region()
(This used to be commit ad2765bb5e0c1c4d8f12583e49df5b1bc7ffc389)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/reply.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 0b710d6401..1c7e23a20f 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3042,20 +3042,22 @@ int reply_rmdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, Resolve wildcards in a filename rename. ********************************************************************/ -static BOOL resolve_wildcards(char *name1,char *name2) +static BOOL resolve_wildcards(const char *name1, char *name2) { fstring root1,root2; fstring ext1,ext2; - char *p,*p2; + char *p,*p2, *pname1, *pname2; + int available_space; + - name1 = strrchr_m(name1,'/'); - name2 = strrchr_m(name2,'/'); + pname1 = strrchr_m(name1,'/'); + pname2 = strrchr_m(name2,'/'); - if (!name1 || !name2) + if (!pname1 || !pname2) return(False); - fstrcpy(root1,name1); - fstrcpy(root2,name2); + fstrcpy(root1,pname1); + fstrcpy(root2,pname2); p = strrchr_m(root1,'.'); if (p) { *p = 0; @@ -3097,10 +3099,13 @@ static BOOL resolve_wildcards(char *name1,char *name2) p++; } - pstrcpy(name2,root2); + available_space = sizeof(pstring) - PTR_DIFF(pname2, name2); + + StrnCpy(pname2, root2, available_space-1); + available_space -= strlen(root2); if (ext2[0]) { - pstrcat(name2,"."); - pstrcat(name2,ext2); + strncat(pname2, ".", available_space-1); + strncat(pname2, ext2, available_space-2); } return(True); |