diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-04 14:45:39 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-04 14:45:39 +0200 |
commit | 94f0079599ab6aa5191e47953abd43d1447c08e3 (patch) | |
tree | 7f8306f17d44429cc9e07e5a156aee1b119330c9 | |
parent | 4a47547e5fd10468371a2c23a867f6c4cbd66146 (diff) | |
download | alpine-conf-94f0079599ab6aa5191e47953abd43d1447c08e3.zip |
setup-alpine: lbu add home directory for created user
make sure that we include the home directory to created user
fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10517
-rw-r--r-- | setup-alpine.in | 5 | ||||
-rwxr-xr-x | tests/setup_alpine_test | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/setup-alpine.in b/setup-alpine.in index ad3c430..a49dd51 100644 --- a/setup-alpine.in +++ b/setup-alpine.in @@ -233,6 +233,11 @@ if [ "$quick" = 1 ]; then fi setup-user ${USERSSHKEY+-k "$USERSSHKEY"} ${USEROPTS:--a -g 'audio video netdev'} +for i in "$ROOT"home/*; do + if [ -d "$i" ]; then + lbu add $i + fi +done setup-sshd ${SSHDOPTS} if is_xen_dom0; then diff --git a/tests/setup_alpine_test b/tests/setup_alpine_test index 39c14af..826ea6e 100755 --- a/tests/setup_alpine_test +++ b/tests/setup_alpine_test @@ -45,5 +45,8 @@ setup_alpine_create_answerfile_body() { setup-alpine -f answers grep "ssh-rsa blahbla user@example.com" home/juser/.ssh/authorized_keys \ || atf_fail "ssh key not set for juser" + grep home/juser etc/apk/protected_paths.d/lbu.list \ + || atf_fail "home/juser was not added to lbu.list" } + |