do not use UID hack for tester

It's causing "root-tester namesis" (both have UID 0) if the tty is owned
by root.  To fix bash test, use Expect to spawn a new PTY for it.
This commit is contained in:
Xi Ruoyao 2021-07-18 01:04:22 +08:00
parent 28bdcfe0ef
commit ef61313366
No known key found for this signature in database
GPG Key ID: D95E4716CCBB34DC
3 changed files with 4 additions and 4 deletions

View File

@ -218,7 +218,7 @@
<segmentedlist id="bash-testdeps">
<segtitle>&testsuites;</segtitle>
<seglistitem>
<seg>Shadow</seg>
<seg>Expect and Shadow</seg>
</seglistitem>
</segmentedlist>

View File

@ -175,7 +175,7 @@ EOF</userinput></screen>
user. We add this user here and delete this account at the end of that
chapter.</para>
<screen><userinput>echo "tester:x:$(ls -n $(tty) | cut -d" " -f3):101::/home/tester:/bin/bash" &gt;&gt; /etc/passwd
<screen><userinput>echo "tester:x:101:101::/home/tester:/bin/bash" &gt;&gt; /etc/passwd
echo "tester:x:101:" &gt;&gt; /etc/group
install -o tester -d /home/tester</userinput></screen>

View File

@ -76,8 +76,8 @@
<para>Now, run the tests as the <systemitem
class="username">tester</systemitem> user:</para>
<screen><userinput remap="test">su tester &lt;&lt; EOF
PATH=$PATH make tests &lt; $(tty)
<screen><userinput remap="test">su -s /usr/bin/expect tester &lt;&lt; EOF
spawn make tests; expect EOF;
EOF</userinput></screen>
<para>Install the package:</para>