summaryrefslogtreecommitdiffstats
path: root/plugins/sudoers/regress/testsudoers/test8.sh
blob: c22b590ac9278eda37e5d946eb74a07d7f5e7dad (plain)
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
#
# Test @include facility w/o a final newline.
# Same as test2.sh but missing the final newline.
#

: ${TESTSUDOERS=testsudoers}

MYUID=`\ls -ln $TESTDIR/test2.inc | awk '{print $3}'`
MYGID=`\ls -ln $TESTDIR/test2.inc | awk '{print $4}'`
exec 2>&1

echo "Testing @include without a newline"
echo ""
printf "@include $TESTDIR/test2.inc" | \
    $TESTSUDOERS -U $MYUID -G $MYGID root id

echo ""
echo "Testing #include without a newline"
echo ""
printf "#include $TESTDIR/test2.inc" | \
    $TESTSUDOERS -U $MYUID -G $MYGID root id

exit 0