index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2012-04-07 13:01:13 -0500 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-04-08 22:28:45 -0400 |
commit | a8a1b093eb23450244418232c9e30c4be035fc0b (patch) | |
tree | 632a47273f1c4678984d66ecce0c41b6cb7ece1d /lib/libalpm/trans.c | |
parent | ec91133e38cb7c486ec995d4183f30e84f3ca736 (diff) |
-rw-r--r-- | lib/libalpm/trans.c | 7 |
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 4309c07e..08f70dd7 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -276,8 +276,8 @@ static int grep(const char *fn, const char *needle) int _alpm_runscriptlet(alpm_handle_t *handle, const char *filepath, const char *script, const char *ver, const char *oldver, int is_archive) { - char cmdline[PATH_MAX]; - char *argv[] = { SCRIPTLET_SHELL, "-c", cmdline, NULL }; + char arg0[64], arg1[3], cmdline[PATH_MAX]; + char *argv[] = { arg0, arg1, cmdline, NULL }; char *tmpdir, *scriptfn = NULL, *scriptpath; int retval = 0; size_t len; @@ -293,6 +293,9 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *filepath, return 0; } + strcpy(arg0, SCRIPTLET_SHELL); + strcpy(arg1, "-c"); + /* create a directory in $root/tmp/ for copying/extracting the scriptlet */ len = strlen(handle->root) + strlen("tmp/alpm_XXXXXX") + 1; MALLOC(tmpdir, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1)); |