Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 31aec46

Browse files
committed
Create staged and delta directories with 700 permissions
These directories were previously created with 750 permissions, which caused a new check in swupd-client to remove them in order to correct the permissions to 700. Create them the right way in the first place. Signed-off-by: Matthew Johnson <[email protected]>
1 parent 1fa24df commit 31aec46

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/pack.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ static void empty_pack_stage(int full, int from_version, int to_version, char *m
5858
// (re)create module/version/{delta,staged}
5959
string_or_die(&path, "%s/%s/%i_to_%i/delta", packstage_dir, module,
6060
from_version, to_version);
61-
g_mkdir_with_parents(path, S_IRWXU | S_IRWXG);
61+
g_mkdir_with_parents(path, S_IRWXU);
6262
free(path);
6363
string_or_die(&path, "%s/%s/%i_to_%i/staged", packstage_dir, module,
6464
from_version, to_version);
65-
g_mkdir_with_parents(path, S_IRWXU | S_IRWXG);
65+
g_mkdir_with_parents(path, S_IRWXU);
6666
free(path);
6767
}
6868
}
@@ -79,7 +79,7 @@ static void explode_pack_stage(int from_version, int to_version, char *module)
7979

8080
string_or_die(&path, "%s/%s/%i_to_%i/staged", packstage_dir, module,
8181
from_version, to_version);
82-
g_mkdir_with_parents(path, S_IRWXU | S_IRWXG);
82+
g_mkdir_with_parents(path, S_IRWXU);
8383
dir = opendir(path);
8484
if (!dir) {
8585
fprintf(stderr, "There are problems accessing %s, exiting\n", path);

test/functional/full-run/test.bats

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ setup() {
4040
[[ 1 -eq $(grep '/usr/share/clear/bundles$' $DIR/www/10/Manifest.os-core | wc -l) ]]
4141
[[ 4 -eq $(tar -tf $DIR/www/10/pack-test-bundle-from-0.tar | wc -l) ]]
4242
[[ 5 -eq $(tar -tf $DIR/www/10/pack-os-core-from-0.tar | wc -l) ]]
43+
44+
# extract test-bundle pack to make sure staged and delta are created with the
45+
# correct permissions
46+
sudo tar -xf $DIR/www/10/pack-test-bundle-from-0.tar --directory $DIR/www/10/
47+
[[ $(stat -c %a $DIR/www/10/staged) -eq 700 ]]
48+
[[ $(stat -c %a $DIR/www/10/delta) -eq 700 ]]
4349
}
4450

4551
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80

0 commit comments

Comments
 (0)