FreeBSD Bugzilla – Attachment 215993 Details for
Bug 247596
net/rdist6: fix hardlinking files with spaces in names
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
fix hardlinking with spaces in names
patch-z-fix_ws_in_hardlinks (text/plain), 1.83 KB, created by
Andre Albsmeier
on 2020-06-27 17:25:41 UTC
(
hide
)
Description:
fix hardlinking with spaces in names
Filename:
MIME Type:
Creator:
Andre Albsmeier
Created:
2020-06-27 17:25:41 UTC
Size:
1.83 KB
patch
obsolete
>--- ./src/server.c.ORI 2020-06-27 09:02:15.364442000 +0200 >+++ ./src/server.c 2020-06-27 09:12:23.010090000 +0200 >@@ -1270,17 +1270,34 @@ > return; > } > >- oldname = strtok(cp, " "); >- if (oldname == NULL) { >- error("hardlink: oldname name not delimited"); >- return; >- } >+{ unsigned int len; > >- newname = strtok((char *)NULL, " "); >- if (newname == NULL) { >- error("hardlink: new name not specified"); >- return; >- } >+ if( *( cp += strspn( cp, " " ) ) == '\0' ) { >+ error("hardlink: oldnamelen name not found"); >+ return; >+ } >+ >+ len = strtoul( cp, &cp, 10 ); >+ >+ if( *( cp += strspn( cp, " " ) ) == '\0' ) { >+ error("hardlink: oldname not found"); >+ return; >+ } >+ oldname = cp; >+ if( strlen( cp ) < len + 2 ) { >+ error("hardlink: oldname too short or nothing following found"); >+ return; >+ } >+ cp += len; >+ *cp++ = '\0'; >+ >+ if( *( cp += strspn( cp, " " ) ) == '\0' ) { >+ error("hardlink: newname not found"); >+ return; >+ } >+ >+ newname = cp; >+} > > if (exptilde(expbuf, oldname) == NULL) { > error("hardlink: tilde expansion failed"); >--- ./src/client.c.ORI 2020-06-27 09:02:15.372720000 +0200 >+++ ./src/client.c 2020-06-27 08:32:20.000000000 +0200 >@@ -359,16 +359,16 @@ > rname, lp->pathname, lp->src, lp->target); > > if (*lp->target == CNULL) >- (void) sendcmd(C_RECVHARDLINK, "%o %s %s", >- opts, lp->pathname, rname); >+ (void) sendcmd(C_RECVHARDLINK, "%o %d %s %s", >+ opts, strlen(lp->pathname), lp->pathname, rname); > else { > lname = buff; > strcpy(lname, remfilename(lp->src, lp->target, > lp->pathname, rname, > destdir)); > debugmsg(DM_MISC, "sendhardlink: lname=%s\n", lname); >- (void) sendcmd(C_RECVHARDLINK, "%o %s %s", >- opts, lname, rname); >+ (void) sendcmd(C_RECVHARDLINK, "%o %d %s %s", >+ opts, strlen(lname), lname, rname); > } > > return(response());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247596
: 215993 |
216024
|
217678