base-files: make postinst script run inside a subshell
authorJohn Crispin <john@openwrt.org>
Mon, 6 Oct 2014 05:55:35 +0000 (05:55 +0000)
committerJohn Crispin <john@openwrt.org>
Mon, 6 Oct 2014 05:55:35 +0000 (05:55 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 42800

package/base-files/files/lib/functions.sh

index fafb7a3..7f14822 100755 (executable)
@@ -173,7 +173,7 @@ default_prerm() {
 default_postinst() {
        local name rusers
        name=$(echo $(basename $1) | cut -d. -f1)
-       [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg ] && . ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg
+       [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg ] && ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg )
        rusers=$(grep "Require-User:" ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.control)
        [ -n "$rusers" ] && {
                local user group