On 06/10/2015 02:01 PM, Bastian Bittorf wrote: > * thomas.lan...@lantiq.com <thomas.lan...@lantiq.com> [10.06.2015 13:59]: >> I think this will not work, as /etc/profile (and these additional files) is >> expected to be executed in the current shell context. >> Otherwise adding shell variables or extending $PATH will not work. So you >> cannot execute them in a subshell. > > ok, then please: > [ -e "$FILE" ] && sh -n "$FILE" && . "$FILE" > >> Maybe it is possible to skip this for FAILSAFE mode? If there are errors, >> they can be corrected in this way. > > this is a good point: > > [ -z "$FAILSAFE" ] && { > ...yourlogic... > } > > bye, bastian
Why should errors in these files cause login issues? This is shell and there's no -e, problematic lines will print an error and be skipped. Hendrik's patch adds exactly the lines used by Debian. On Arch Linux, it looks very similar. The only way to break login using profile snippets is causing the shell to exit explicitly (using `exit` or something like that), but there's no sane way to protect against that... Matthias
signature.asc
Description: OpenPGP digital signature
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel