Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2007-11-29 23:30:57 -0600
committerDan McGee <dan@archlinux.org>2007-12-10 23:03:16 -0600
commit9558639d8009483fbf422b138d020745986f82f1 (patch)
treecf890ed10c73efeac239cfe3a9425e172640bdab /lib
parentf8b113ed97652da62c217cef139c58ca1d75d647 (diff)
popen does NOT require /bin/sh in a subchroot
I appears that when chrooted, the /bin/sh used by popen is that of the parent process. This is true until the process forks once chrooted, which we do not want to do. As such, this actually makes things nicer. We don't need a /bin/sh in a chroot to run install scriptlets, and don't need to check for it in the root directory Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/trans.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 70e34d43..582c76b7 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -475,10 +475,10 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
return(0);
}
- snprintf(tmpdir, PATH_MAX, "%sbin/sh", root);
- if(stat(tmpdir, &buf)) {
+ /* NOTE: popen will use the PARENT's /bin/sh, not the chroot's */
+ if(stat("/bin/sh", &buf)) {
/* not found */
- _alpm_log(PM_LOG_ERROR, _("No /bin/sh in root dir (%s), aborting scriptlet\n"), root);
+ _alpm_log(PM_LOG_ERROR, _("No /bin/sh in parent environment, aborting scriptlet\n"));
return(0);
}