Bug 247596 - net/rdist6: fix hardlinking files with spaces in names
Summary: net/rdist6: fix hardlinking files with spaces in names
Status: Closed FIXED
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
Keywords: buildisok
Depends on:
Reported: 2020-06-27 17:25 UTC by Andre Albsmeier
Modified: 2020-09-27 01:36 UTC (History)
0 users

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

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
Regenerated patches to conform to standard (48.29 KB, patch)
2020-08-31 20:04 UTC, Cy Schubert
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?
Comment 6 Automation User 2020-08-31 00:35:14 UTC
Build info is available at https://gitlab.com/swills/freebsd-ports/pipelines/183663675
Comment 7 Cy Schubert freebsd_committer 2020-08-31 18:43:23 UTC
(In reply to Andre Albsmeier from comment #5)

The port is a mess anyway. I'll commit the patch then do makepatch.
Comment 8 Cy Schubert freebsd_committer 2020-08-31 20:04:11 UTC
Created attachment 217678 [details]
Regenerated patches to conform to standard

Please give this patch a spin. It updates the port to conform to standard.
Comment 9 commit-hook freebsd_committer 2020-09-01 19:24:43 UTC
A commit references this bug:

Author: cy
Date: Tue Sep  1 19:24:22 UTC 2020
New revision: 547289
URL: https://svnweb.freebsd.org/changeset/ports/547289

  rdist6 fails to hardlink files with whitespace in them. This
  patch fixes that.

  PR:		247596
  Submitted by:	Andre Albsmeier <mail@fbsd.e4m.org>
  Reported by:	Andre Albsmeier <mail@fbsd.e4m.org>

Comment 10 Cy Schubert freebsd_committer 2020-09-27 01:36:57 UTC