Repository navigation
Remove /sbin from paths if split-bin is false - #8324
Conversation
Follow-up for 157baa8.
| #define DEFAULT_PATH_NORMAL "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" | ||
| #define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":/sbin:/bin" | ||
| #if HAVE_SPLIT_BIN | ||
| # define PATH_SBIN_BIN(x) x "sbin:" x "bin" |
There was a problem hiding this comment.
nitpick: I dislike requiring trailing slash on paths at the caller...
So maybe instead use:
#define PATH_SBIN_BIN(basedir) basedir "/sbin:" basedir "/bin"(Also: something like basedir is more clear than just simply x here... If you want something short, perhaps d?)
There was a problem hiding this comment.
nitpick: I dislike requiring trailing slash on paths at the caller...
I started that way, but then there's the root directory, which would look like PATH_SBIN_BIN(""), so I think it's nicer to require the trailing slash and have PATH_SBIN_BIN("/"). It was a conscious decision ;)
Also: something like
basedir
The name of the argument to a macro is only used in that one line, where the definition is visible anyway, so I don't think it matters.
There was a problem hiding this comment.
ha, great minds think alike... when i reviewed this earlier i had the exact same though as @filbranden but then saw the effect on the root dir and cancel my comment again... ;-)
… default We don't know what the container payload needs, hence default to a PATH with both bin and sbin included, as well as / and /usr. Follow-up for systemd#8324 Fixes: systemd#8698
Follow-up for 157baa8.