diff -ruN pacman-3.1.0.orig/lib/libalpm/trans.c pacman-3.1.0/lib/libalpm/trans.c --- pacman-3.1.0.orig/lib/libalpm/trans.c 2008-01-02 23:20:12.000000000 +0100 +++ pacman-3.1.0/lib/libalpm/trans.c 2008-01-13 13:39:37.000000000 +0100 @@ -487,7 +487,7 @@ /* creates a directory in $root/tmp/ for copying/extracting the scriptlet */ snprintf(tmpdir, PATH_MAX, "%stmp/", root); if(stat(tmpdir, &buf)) { - _alpm_makepath(tmpdir); + _alpm_makepath_mode(tmpdir, 1777); } snprintf(tmpdir, PATH_MAX, "%stmp/alpm_XXXXXX", root); if(mkdtemp(tmpdir) == NULL) { diff -ruN pacman-3.1.0.orig/lib/libalpm/util.c pacman-3.1.0/lib/libalpm/util.c --- pacman-3.1.0.orig/lib/libalpm/util.c 2008-01-08 06:12:39.000000000 +0100 +++ pacman-3.1.0/lib/libalpm/util.c 2008-01-13 13:38:36.000000000 +0100 @@ -178,9 +178,19 @@ } #endif -/* does the same thing as 'mkdir -p' */ int _alpm_makepath(const char *path) { + _alpm_makepath_internal(path, 0755); +} + +int _alpm_makepath_mode(const char *path, mode_t mode) +{ + _alpm_makepath_internal(path, mode); +} + +/* does the same thing as 'mkdir -p' */ +int _alpm_makepath_internal(const char *path, mode_t mode) +{ char *orig, *str, *ptr; char full[PATH_MAX] = ""; mode_t oldmask; @@ -196,7 +206,7 @@ strcat(full, "/"); strcat(full, ptr); if(stat(full, &buf)) { - if(mkdir(full, 0755)) { + if(mkdir(full, mode)) { FREE(orig); umask(oldmask); _alpm_log(PM_LOG_ERROR, _("failed to make path '%s' : %s\n"), diff -ruN pacman-3.1.0.orig/lib/libalpm/util.h pacman-3.1.0/lib/libalpm/util.h --- pacman-3.1.0.orig/lib/libalpm/util.h 2008-01-08 06:12:39.000000000 +0100 +++ pacman-3.1.0/lib/libalpm/util.h 2008-01-13 13:39:14.000000000 +0100 @@ -50,6 +50,8 @@ #define ASSERT(cond, action) do { if(!(cond)) { action; } } while(0) int _alpm_makepath(const char *path); +int _alpm_makepath_mode(const char *path, mode_t mode); +int _alpm_makepath_internal(const char *path, mode_t mode); int _alpm_copyfile(const char *src, const char *dest); char *_alpm_strtrim(char *str); char *_alpm_strreplace(const char *str, const char *needle, const char *replace);