Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#26052 - [netcfg] calls /etc/rc.d/functions in a way that arguments are lost

Attached to Project: Arch Linux
Opened by Martin Kühne (mar77i) - Sunday, 18 September 2011, 01:19 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Saturday, 24 September 2011, 07:30 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Rémy Oudompheng (remyoudompheng)
Tom Gundersen (tomegun)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The script I have placed in /etc/functions.d/auto_sudo does nothing else than

[[ $UID != 0 && "${0%/*}" == "/etc/rc.d" ]] && {
echo prefixing sudo automatically...
echo sudo "$0" "$@"
sudo "$0" "$@"
exit $?
}

Okay I admit I'm being very lazy here and and I'm aware the use of sudo has been repeatedly discouraged.
What happens, /etc/rc.d/net-tools sources /usr/lib/network/globals. There, the call to load_hooks does not preserve the argument list and leaves my portion of code useless, which is called by /etc/rc.d/functions and in turn by /usr/lib/network/globals/hooks/arch, the currently only hook.
Also it's strange, I don't know if those hooks are supposed to know about the action that's being taken, but I guess it could be important. Also I can't currently refer to examples pointed to by netcfg(8) manpage, since /usr/share/doc/netcfg{,contrib} doesn't seem to be packaged in [core].
Most other DAEMONS scripts source both /etc/rc.conf and /etc/rc.d/functions directly, and I thought of our daemon scripts being arch-specific, please correct me if I'm wrong.

Therefore I suggest to move the sourcing of /etc/rc.conf and /etc/rc.d/functions to lines 2 and 3 of the DAEMONS script /etc/rc.d/net-tool

Cheers!
This task depends upon

Closed by  Rémy Oudompheng (remyoudompheng)
Saturday, 24 September 2011, 07:30 GMT
Reason for closing:  Won't implement
Additional comments about closing:  As its name shows, /etc/functions.d is supposed to contain functions, not code
Comment by Dan McGee (toofishes) - Tuesday, 20 September 2011, 21:25 GMT
This is not at all what functions.d is intended for, so I doubt such a thing will ever be supported...
Comment by Rémy Oudompheng (remyoudompheng) - Wednesday, 21 September 2011, 17:16 GMT
Sorry, but I don't know what is /etc/rc.d/net-tools, and I don't understand what you are trying to do and what is the relation with netcfg.
Comment by Martin Kühne (mar77i) - Wednesday, 21 September 2011, 17:19 GMT
s/net-tools/net-profiles/
s/netcfg{,contrib}/netcfg{,/contrib}/

sorry
Comment by Tom Gundersen (tomegun) - Friday, 23 September 2011, 09:12 GMT
This does not look like a good idea. You should not assume anything about the order in which files are sourced (if they are sourced at all). Unless Rémy wants to change this for some other reason, then I suggest closing as "won't implement".

Loading...