mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-08 12:28:00 -05:00
Fail loudly is scriptlets cannot be run via /bin/sh
If /bin/sh is missing in the root directory, scriptlets cannot be executed, as we're explicitly calling it. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
parent
98bcd1f5b1
commit
4853a4aad9
@ -552,6 +552,13 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
|
||||
return(0);
|
||||
}
|
||||
|
||||
snprintf(tmpdir, PATH_MAX, "%sbin/sh", root);
|
||||
if(stat(tmpdir, &buf)) {
|
||||
/* not found */
|
||||
_alpm_log(PM_LOG_ERROR, _("No /bin/sh in root dir (%s), aborting scriptlet\n"), root);
|
||||
return(0);
|
||||
}
|
||||
|
||||
if(!strcmp(script, "pre_upgrade") || !strcmp(script, "pre_install")) {
|
||||
snprintf(tmpdir, PATH_MAX, "%stmp/", root);
|
||||
if(stat(tmpdir, &buf)) {
|
||||
|
Loading…
Reference in New Issue
Block a user