fix(test): minor fixes.

This commit is contained in:
Alexandre Pujol 2024-10-22 13:38:42 +01:00
parent 449c8d3e3a
commit 5240dcbdd1
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
4 changed files with 9 additions and 14 deletions

View File

@ -10,26 +10,19 @@ include <tunables/global>
@{exec_path} = @{bin}/chsh @{exec_path} = @{bin}/chsh
profile chsh @{exec_path} { profile chsh @{exec_path} {
include <abstractions/base> include <abstractions/base>
include <abstractions/wutmp>
include <abstractions/authentication> include <abstractions/authentication>
include <abstractions/nameservice-strict> include <abstractions/nameservice-strict>
include <abstractions/wutmp>
# To write records to the kernel auditing log.
capability audit_write, capability audit_write,
# To set the right permission to the files in the /etc/ dir.
capability chown, capability chown,
capability fsetid, capability fsetid,
# gpasswd is a SETUID binary
capability setuid, capability setuid,
network netlink raw, network netlink raw,
@{exec_path} mr, @{exec_path} mr,
owner @{PROC}/@{pid}/loginuid r,
/etc/shells r, /etc/shells r,
/etc/passwd rw, /etc/passwd rw,
@ -44,6 +37,8 @@ profile chsh @{exec_path} {
# modify the /etc/passwd or /etc/shadow password database. # modify the /etc/passwd or /etc/shadow password database.
/etc/.pwd.lock rwk, /etc/.pwd.lock rwk,
owner @{PROC}/@{pid}/loginuid r,
include if exists <local/chsh> include if exists <local/chsh>
} }

View File

@ -53,9 +53,9 @@ profile useradd @{exec_path} {
# To create user dirs and copy files from /etc/skel/ to them # To create user dirs and copy files from /etc/skel/ to them
@{HOME}/ rw, @{HOME}/ rw,
@{HOME}/.* w, @{HOME}/.** w,
/var/lib/*/{,*} rw, /var/lib/*/{,*} rw,
/etc/skel/{,.*} r, /etc/skel/{,.**} r,
profile pam_tally2 { profile pam_tally2 {
include <abstractions/base> include <abstractions/base>

View File

@ -11,7 +11,7 @@ setup_file() {
# bats test_tags=chsh # bats test_tags=chsh
@test "chsh: [l]ist available shells" { @test "chsh: [l]ist available shells" {
chsh --list-shells chsh --list-shells || true
aa_check aa_check
} }

View File

@ -11,18 +11,18 @@ setup_file() {
# bats test_tags=lsusb # bats test_tags=lsusb
@test "lsusb: List all the USB devices available" { @test "lsusb: List all the USB devices available" {
lsusb lsusb || true
aa_check aa_check
} }
# bats test_tags=lsusb # bats test_tags=lsusb
@test "lsusb: List the USB hierarchy as a tree" { @test "lsusb: List the USB hierarchy as a tree" {
lsusb -t lsusb -t || true
aa_check aa_check
} }
# bats test_tags=lsusb # bats test_tags=lsusb
@test "lsusb: List verbose information about USB devices" { @test "lsusb: List verbose information about USB devices" {
lsusb --verbose lsusb --verbose || true
aa_check aa_check
} }