Skip to content
Snippets Groups Projects
Commit 75b339ca authored by Natanael Copa's avatar Natanael Copa
Browse files

db: always create directories during install

We dont care if a directory have references or not, we care if directory
is relly there.

Only the creator of the direcotry will set the permissions.

This fixes the situation where you install a package owning a dir then
you remove this dir manually and try install a second package also owning
the dir.

For example:

  apk add e2fsprogs-dev
  rm -rf /usr/lib/pkgconfig
  apk add zlib-dev
parent dfc8d4ce
No related branches found
No related tags found
No related merge requests found
...@@ -253,10 +253,8 @@ static void apk_db_diri_set(struct apk_db_dir_instance *diri, mode_t mode, ...@@ -253,10 +253,8 @@ static void apk_db_diri_set(struct apk_db_dir_instance *diri, mode_t mode,
static void apk_db_diri_mkdir(struct apk_db_dir_instance *diri) static void apk_db_diri_mkdir(struct apk_db_dir_instance *diri)
{ {
if (diri->dir->refs == 1) { if (mkdir(diri->dir->dirname, diri->mode) == 0)
mkdir(diri->dir->dirname, diri->mode);
chown(diri->dir->dirname, diri->uid, diri->gid); chown(diri->dir->dirname, diri->uid, diri->gid);
}
} }
static void apk_db_diri_rmdir(struct apk_db_dir_instance *diri) static void apk_db_diri_rmdir(struct apk_db_dir_instance *diri)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment