index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2008-01-14 22:58:44 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-01-14 22:58:44 -0600 |
commit | 38e981fab3f901e6c932e2f2913790ef0b96c6c2 (patch) | |
tree | 1dcf8610529b51626780b3666455f72858361828 /lib/libalpm/util.c | |
parent | 521de7ceedc6e4f5df52c0380f536a6f13a7f578 (diff) | |
parent | a0ac72b42219fbcf17dd7cf2ee992b71a6a1375a (diff) |
-rw-r--r-- | lib/libalpm/util.c | 11 |
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index d09b9b14..e1413a25 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -178,9 +178,14 @@ char* strsep(char** str, const char* delims) } #endif -/* does the same thing as 'mkdir -p' */ int _alpm_makepath(const char *path) { + return(_alpm_makepath_mode(path, 0755)); +} + +/* does the same thing as 'mkdir -p' */ +int _alpm_makepath_mode(const char *path, mode_t mode) +{ char *orig, *str, *ptr; char full[PATH_MAX] = ""; mode_t oldmask; @@ -196,7 +201,7 @@ int _alpm_makepath(const char *path) 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"), @@ -399,6 +404,8 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn) if(S_ISREG(st->st_mode)) { archive_entry_set_mode(entry, 0644); + } else if(S_ISDIR(st->st_mode)) { + archive_entry_set_mode(entry, 0755); } if (fn && strcmp(fn, entryname)) { |