Bug 247596 - net/rdist6: fix hardlinking files with spaces in names
Summary: net/rdist6: fix hardlinking files with spaces in names
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-27 17:25 UTC by Andre Albsmeier
Modified: 2020-06-29 18:10 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments
fix hardlinking with spaces in names (1.83 KB, patch)
2020-06-27 17:25 UTC, Andre Albsmeier
no flags Details | Diff
patch against port (2.18 KB, patch)
2020-06-29 08:34 UTC, Andre Albsmeier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Albsmeier 2020-06-27 17:25:41 UTC
Created attachment 215993 [details]
fix hardlinking with spaces in names

rdist6 fails to distribute hardlinks when there are spaces in their names. This is because the corresponding command looks like

k3000000 /path/to/srcfile targetfile

and is parsed by strtok() using space as separator :-(.

The patch changes this command to the form

k3000000 srcpathlen /path/to/srcfile targetfile

where srcpathlen contains the length of /path/to/srcfile and replaces strtok() parsing by something which honours srcpathlen.
Comment 1 Cy Schubert freebsd_committer 2020-06-28 04:24:03 UTC
Can you produce this as a patch against the ports instead of a patch against the original source in the tarball?
Comment 2 Andre Albsmeier 2020-06-28 06:12:33 UTC
Will try. Apart from adding the patch file to files is there anything else to do? Bump PORTREVISION? Sorry for asking stupid questions but I do this one or two times in a decade...
Comment 3 Andre Albsmeier 2020-06-29 08:34:05 UTC
Created attachment 216024 [details]
patch against port
Comment 4 Cy Schubert freebsd_committer 2020-06-29 14:31:56 UTC
That's not quite what I had in mind. The existing patch files will need to be updated. I'll fix it up. It'll take more time.
Comment 5 Andre Albsmeier 2020-06-29 18:10:18 UTC
OK, you mean changing those files, that already modify server.c and client.c, right (as written in 4.4.1. of the porters handbook)? I thought of doing this but this way it is difficult to identify what parts of the patch belong together. Additionally, there are already patches (e.g. patch-rdist.c) which modify multiple files (which is also allowed according to 4.4.1.).

And to which of the patches already modifying client.c (patch-client.c, patch-rdist.c) and server.c (patch-mkstemp, patch-rdist.c) should I add them?