From 8186dc11a90dbc310acaad7ee867ee995adbd6ed Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sun, 13 Jan 2008 11:08:59 +0100 Subject: Ensure correct dir permissions in the database. Fix for FS#9176. A previous commit (6e8daa553bbd5) already forced all database files to 644. Now the directories are also forced to 755. Additionally, repo-add now sets the umask to 022, just like makepkg does, to fix the problem at its root. Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- lib/libalpm/util.c | 2 ++ scripts/repo-add.sh.in | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index d09b9b14..5959482d 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -399,6 +399,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)) { diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 98191b62..c7aa11a2 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -28,6 +28,9 @@ confdir='@sysconfdir@' FORCE=0 REPO_DB_FILE="" +# ensure we have a sane umask set +umask 0022 + msg() { local mesg=$1; shift printf "==> ${mesg}\n" "$@" >&1 -- cgit v1.2.3-70-g09d2