fixed directory roots when running scriplets
This commit is contained in:
parent
181efcdeaa
commit
eefe29d99a
1 changed files with 7 additions and 1 deletions
|
@ -405,7 +405,9 @@ int _alpm_runscriptlet(char *root, char *installfn, char *script, char *ver, cha
|
||||||
}
|
}
|
||||||
|
|
||||||
/* just in case our cwd was removed in the upgrade operation */
|
/* just in case our cwd was removed in the upgrade operation */
|
||||||
chdir("/");
|
if(chdir(root) != 0) {
|
||||||
|
_alpm_log(PM_LOG_ERROR, "could not change directory to %s (%s)", root, strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
_alpm_log(PM_LOG_FLOW2, "executing %s script...", script);
|
_alpm_log(PM_LOG_FLOW2, "executing %s script...", script);
|
||||||
|
|
||||||
|
@ -431,6 +433,10 @@ int _alpm_runscriptlet(char *root, char *installfn, char *script, char *ver, cha
|
||||||
_alpm_log(PM_LOG_ERROR, "could not change the root directory (%s)", strerror(errno));
|
_alpm_log(PM_LOG_ERROR, "could not change the root directory (%s)", strerror(errno));
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
if(chdir("/") != 0) {
|
||||||
|
_alpm_log(PM_LOG_ERROR, "could not change directory to / (%s)", strerror(errno));
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
umask(0022);
|
umask(0022);
|
||||||
_alpm_log(PM_LOG_DEBUG, "executing \"%s\"", cmdline);
|
_alpm_log(PM_LOG_DEBUG, "executing \"%s\"", cmdline);
|
||||||
execl("/bin/sh", "sh", "-c", cmdline, (char *)0);
|
execl("/bin/sh", "sh", "-c", cmdline, (char *)0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue