summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-16 08:16:17 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-16 08:17:28 +0000
commitaf6f329fc72bd93d2ac1a07ce6b23e510cf82ea8 (patch)
tree20595c222e4d687e6d477c0ace5383f784ef1caa /src/database.c
parentcf3dfb7611f9055034b55f4caf7d145ce3e04af4 (diff)
downloadapk-tools-af6f329fc72bd93d2ac1a07ce6b23e510cf82ea8.tar.gz
apk-tools-af6f329fc72bd93d2ac1a07ce6b23e510cf82ea8.tar.bz2
apk-tools-af6f329fc72bd93d2ac1a07ce6b23e510cf82ea8.tar.xz
apk-tools-af6f329fc72bd93d2ac1a07ce6b23e510cf82ea8.zip
db: set the perms to /var/lib/apk/* to 644
this allows non-root users to query the database.
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/database.c b/src/database.c
index 5c6a693..626c0fb 100644
--- a/src/database.c
+++ b/src/database.c
@@ -568,7 +568,7 @@ int apk_db_create(const char *root)
mkdir("var/lib", 0755);
mkdir("var/lib/apk", 0755);
- fd = creat("var/lib/apk/world", 0600);
+ fd = creat("var/lib/apk/world", 0644);
if (fd < 0)
return -errno;
write(fd, deps.ptr, deps.len);
@@ -683,7 +683,7 @@ static int apk_db_write_config(struct apk_database *db)
fchdir(db->root_fd);
- os = apk_ostream_to_file("var/lib/apk/world", 0600);
+ os = apk_ostream_to_file("var/lib/apk/world", 0644);
if (os == NULL)
return -1;
n = apk_deps_format(buf, sizeof(buf), db->world);
@@ -692,13 +692,13 @@ static int apk_db_write_config(struct apk_database *db)
os->write(os, buf, n);
os->close(os);
- os = apk_ostream_to_file("var/lib/apk/installed", 0600);
+ os = apk_ostream_to_file("var/lib/apk/installed", 0644);
if (os == NULL)
return -1;
apk_db_write_fdb(db, os);
os->close(os);
- os = apk_ostream_to_file("var/lib/apk/scripts", 0600);
+ os = apk_ostream_to_file("var/lib/apk/scripts", 0644);
if (os == NULL)
return -1;
apk_db_scriptdb_write(db, os);