Page MenuHomeFreeBSD

Fix using more than one files in UID_FILES and GID_FILES.
ClosedPublic

Authored by mat on Jul 17 2017, 10:24 PM.
Tags
None
Referenced Files
F103796130: D11632.id.diff
Fri, Nov 29, 1:52 PM
Unknown Object (File)
Oct 10 2024, 6:34 PM
Unknown Object (File)
Sep 30 2024, 1:52 PM
Unknown Object (File)
Sep 27 2024, 6:07 PM
Unknown Object (File)
Sep 24 2024, 3:49 AM
Unknown Object (File)
Sep 24 2024, 3:49 AM
Unknown Object (File)
Sep 24 2024, 3:49 AM
Unknown Object (File)
Sep 23 2024, 2:27 PM
Subscribers
None

Details

Summary

Repeat after me: If you change IFS, it will break something unexpected.

The problem is that we use IFS to change read's field separator. This
has the side effect of changing how sh(1) splits all string, including
in command parsing functions.

In this case, if you change IFS, the commands are splitted using IFS's
new value, and no longer whitespace. For example:

$ GID_FILES="foo bar"
$ set -x
$ echo $GID_FILES
+ echo foo bar
foo bar
$ IFS=:
+ IFS=:
$ echo $GID_FILES
+ echo 'foo bar'
foo bar

In the first case, it runs echo with two arguments, first is foo, second is bar.
In the second case, it runs echo with one argument, 'foo bar'.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mail/postfix, for example, still generates the same scripts.

This revision was automatically updated to reflect the committed changes.