File: root

package info (click to toggle)
opensysusers 0.7.3-5.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 476 kB
  • sloc: xml: 578; sh: 239; makefile: 194
file content (24 lines) | stat: -rwxr-xr-x 523 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -euo pipefail

CHROOTDIR="$AUTOPKGTEST_TMP/root"

mkdir -p "$CHROOTDIR/etc"
cp /etc/passwd /etc/group /etc/login.defs "$CHROOTDIR/etc"

if grep -q opensysusers-test-root /etc/passwd
then
	printf 'test user already exists\n'
	exit 1
fi

PATH="$PATH:/usr/sbin" ./sysusers --root="$CHROOTDIR" --inline 'u opensysusers-test-root - - - -'

grep opensysusers-test-root "$CHROOTDIR/etc/passwd"

if grep -q opensysusers-test-root /etc/passwd
then
	printf 'test user should not exist outside the chroot\n'
	exit 1
fi