[519ee45] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-tools-changingowner">
|
---|
| 9 | <?dbhtml filename="changingowner.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Changing Ownership</title>
|
---|
| 12 |
|
---|
| 13 | <note>
|
---|
| 14 | <para>The commands in the remainder of this book must be performed while
|
---|
| 15 | logged in as user <systemitem class="username">root</systemitem> and no
|
---|
| 16 | longer as user <systemitem class="username">lfs</systemitem>. Also, double
|
---|
| 17 | check that <envar>$LFS</envar> is set in <systemitem
|
---|
| 18 | class="username">root</systemitem>'s environment.</para>
|
---|
| 19 | </note>
|
---|
| 20 |
|
---|
| 21 | <para>Currently, the <filename class="directory">$LFS/tools</filename> directory
|
---|
| 22 | is owned by the user <systemitem class="username">lfs</systemitem>, a user
|
---|
| 23 | that exists only on the host system. If the <filename
|
---|
| 24 | class="directory">$LFS/tools</filename> directory is kept as is, the files are
|
---|
| 25 | owned by a user ID without a corresponding account. This is dangerous because
|
---|
| 26 | a user account created later could get this same user ID and would own the
|
---|
| 27 | <filename class="directory">$LFS/tools</filename> directory and all the files
|
---|
| 28 | therein, thus exposing these files to possible malicious manipulation.</para>
|
---|
| 29 |
|
---|
| 30 | <para>To avoid this issue, you could add the <systemitem
|
---|
| 31 | class="username">lfs</systemitem> user to the new LFS system later when
|
---|
| 32 | creating the <filename>/etc/passwd</filename> file, taking care to assign it
|
---|
| 33 | the same user and group IDs as on the host system. Better yet, change the
|
---|
| 34 | ownership of the <filename class="directory">$LFS/tools</filename> directory to
|
---|
| 35 | user <systemitem class="username">root</systemitem> by running the following
|
---|
| 36 | command:</para>
|
---|
| 37 |
|
---|
| 38 | <screen><userinput>chown -R root:root $LFS/tools</userinput></screen>
|
---|
| 39 |
|
---|
| 40 | <para>Although the <filename class="directory">$LFS/tools</filename> directory
|
---|
| 41 | can be deleted once the LFS system has been finished, it can be retained to build
|
---|
| 42 | additional LFS systems <emphasis>of the same book version</emphasis>. How best
|
---|
| 43 | to backup <filename class="directory">$LFS/tools</filename> is a matter of
|
---|
| 44 | personal preference and is left as an exercise for the reader.</para>
|
---|
| 45 |
|
---|
| 46 | </sect1>
|
---|