2010-01-30 Paweł Hajdan, Jr. <phajdan.jr@gentoo.org>
* NEWS: Add support for TCB. * lib/tcbfuncs.h, lib/tcbfuncs.c, lib/Makefile.am: New library to support TCB. * lib/prototypes, libmisc/copydir.c (remove_tree): Add boolean parameter remove_root. * configure.in: Add conditional WITH_TCB. * src/userdel.c, src/usermod.c: Add support for TCB. Update call to remove_tree(). * src/pwconv.c, src/pwunconv.c: Should not be used with TCB enabled. * src/vipw.c: Add support for TCB. Update call to remove_tree(). * src/useradd.c: Add support for TCB. Open the shadow file outside of open_files(). * src/chage.c: Add support for TCB. * src/Makefile.am: Install passwd sgid shadow when TCB is enabled. * lib/getdefs.c, man/vipw.8.xml, man/login.defs.5.xml, man/login.defs/TCB_AUTH_GROUP.xml, man/login.defs/USE_TCB.xml, man/login.defs/TCB_SYMLINKS.xml, man/generate_mans.mak, man/generate_mans.deps, man/Makefile.am: New configuration parameters: TCB_AUTH_GROUP, TCB_SYMLINKS, USE_TCB. * lib/shadowio.c, lib/commonio.c: Add support for TCB.
This commit is contained in:
@@ -149,6 +149,8 @@ login_defs_v = \
|
||||
SU_WHEEL_ONLY.xml \
|
||||
SYSLOG_SG_ENAB.xml \
|
||||
SYSLOG_SU_ENAB.xml \
|
||||
TCB_AUTH_GROUP.xml \
|
||||
TCB_SYMLINKS.xml \
|
||||
TTYGROUP.xml \
|
||||
TTYTYPE_FILE.xml \
|
||||
UID_MAX.xml \
|
||||
@@ -156,6 +158,7 @@ login_defs_v = \
|
||||
UMASK.xml \
|
||||
USERDEL_CMD.xml \
|
||||
USERGROUPS_ENAB.xml \
|
||||
USE_TCB.xml \
|
||||
SYS_GID_MAX.xml \
|
||||
SYS_UID_MAX.xml
|
||||
|
||||
|
@@ -105,6 +105,8 @@ login.defs.5: login.defs.d/SYS_GID_MAX.xml
|
||||
login.defs.5: login.defs.d/SYSLOG_SG_ENAB.xml
|
||||
login.defs.5: login.defs.d/SYSLOG_SU_ENAB.xml
|
||||
login.defs.5: login.defs.d/SYS_UID_MAX.xml
|
||||
login.defs.5: login.defs.d/TCB_AUTH_GROUP.xml
|
||||
login.defs.5: login.defs.d/TCB_SYMLINKS.xml
|
||||
login.defs.5: login.defs.d/TTYGROUP.xml
|
||||
login.defs.5: login.defs.d/TTYTYPE_FILE.xml
|
||||
login.defs.5: login.defs.d/UID_MAX.xml
|
||||
@@ -112,6 +114,7 @@ login.defs.5: login.defs.d/ULIMIT.xml
|
||||
login.defs.5: login.defs.d/UMASK.xml
|
||||
login.defs.5: login.defs.d/USERDEL_CMD.xml
|
||||
login.defs.5: login.defs.d/USERGROUPS_ENAB.xml
|
||||
login.defs.5: login.defs.d/USE_TCB.xml
|
||||
newgrp.1: login.defs.d/SYSLOG_SG_ENAB.xml
|
||||
newusers.8: login.defs.d/ENCRYPT_METHOD.xml
|
||||
newusers.8: login.defs.d/GID_MAX.xml
|
||||
|
@@ -8,6 +8,11 @@ SHADOWGRP_COND=gshadow
|
||||
else
|
||||
SHADOWGRP_COND=no_gshadow
|
||||
endif
|
||||
if WITH_TCB
|
||||
TCB_COND=tcb
|
||||
else
|
||||
TCB_COND=no_tcb
|
||||
endif
|
||||
|
||||
if USE_SHA_CRYPT
|
||||
SHA_CRYPT_COND=sha_crypt
|
||||
@@ -20,7 +25,7 @@ endif
|
||||
|
||||
%: %.xml-config Makefile config.xml
|
||||
if ENABLE_REGENERATE_MAN
|
||||
$(XSLTPROC) --stringparam profile.condition "$(PAM_COND);$(SHADOWGRP_COND);$(SHA_CRYPT_COND)" \
|
||||
$(XSLTPROC) --stringparam profile.condition "$(PAM_COND);$(SHADOWGRP_COND);$(TCB_COND);$(SHA_CRYPT_COND)" \
|
||||
-nonet http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl $<
|
||||
else
|
||||
@echo you need to run configure with --enable-man to generate man pages
|
||||
|
@@ -82,6 +82,8 @@
|
||||
<!ENTITY SYSLOG_SG_ENAB SYSTEM "login.defs.d/SYSLOG_SG_ENAB.xml">
|
||||
<!ENTITY SYSLOG_SU_ENAB SYSTEM "login.defs.d/SYSLOG_SU_ENAB.xml">
|
||||
<!ENTITY SYS_UID_MAX SYSTEM "login.defs.d/SYS_UID_MAX.xml">
|
||||
<!ENTITY TCB_AUTH_GROUP SYSTEM "login.defs.d/TCB_AUTH_GROUP.xml">
|
||||
<!ENTITY TCB_SYMLINKS SYSTEM "login.defs.d/TCB_SYMLINKS.xml">
|
||||
<!ENTITY TTYGROUP SYSTEM "login.defs.d/TTYGROUP.xml">
|
||||
<!ENTITY TTYTYPE_FILE SYSTEM "login.defs.d/TTYTYPE_FILE.xml">
|
||||
<!ENTITY UID_MAX SYSTEM "login.defs.d/UID_MAX.xml">
|
||||
@@ -89,6 +91,7 @@
|
||||
<!ENTITY UMASK SYSTEM "login.defs.d/UMASK.xml">
|
||||
<!ENTITY USERDEL_CMD SYSTEM "login.defs.d/USERDEL_CMD.xml">
|
||||
<!ENTITY USERGROUPS_ENAB SYSTEM "login.defs.d/USERGROUPS_ENAB.xml">
|
||||
<!ENTITY USE_TCB SYSTEM "login.defs.d/USE_TCB.xml">
|
||||
]>
|
||||
|
||||
<refentry id='login.defs.5'>
|
||||
@@ -195,6 +198,8 @@
|
||||
&SYS_UID_MAX; <!-- documents also SYS_UID_MIN -->
|
||||
&SYSLOG_SG_ENAB;
|
||||
&SYSLOG_SU_ENAB;
|
||||
&TCB_AUTH_GROUP;
|
||||
&TCB_SYMLINKS;
|
||||
&TTYGROUP;
|
||||
&TTYTYPE_FILE;
|
||||
&UID_MAX; <!-- documents also UID_MIN -->
|
||||
@@ -202,6 +207,7 @@
|
||||
&UMASK;
|
||||
&USERDEL_CMD;
|
||||
&USERGROUPS_ENAB;
|
||||
&USE_TCB;
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
@@ -381,16 +387,27 @@
|
||||
<listitem>
|
||||
<para>
|
||||
PASS_MAX_DAYS PASS_MIN_DAYS PASS_WARN_AGE
|
||||
<phrase condition="tcb">USE_TCB</phrase>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>pwconv</term>
|
||||
<listitem>
|
||||
<para>PASS_MAX_DAYS PASS_MIN_DAYS PASS_WARN_AGE</para>
|
||||
<para>
|
||||
PASS_MAX_DAYS PASS_MIN_DAYS PASS_WARN_AGE
|
||||
<phrase condition="tcb">USE_TCB</phrase>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry condition="tcb">
|
||||
<term>pwunconv</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<phrase condition="tcb">USE_TCB</phrase>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<!-- pwunconv: no variables -->
|
||||
<varlistentry>
|
||||
<term>su</term>
|
||||
<listitem>
|
||||
@@ -427,6 +444,7 @@
|
||||
PASS_MAX_DAYS PASS_MIN_DAYS PASS_WARN_AGE
|
||||
SYS_GID_MAX SYS_GID_MIN SYS_UID_MAX SYS_UID_MIN UID_MAX UID_MIN
|
||||
UMASK
|
||||
<phrase condition="tcb">TCB_AUTH_GROUP TCB_SYMLINK USE_TCB</phrase>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -436,6 +454,7 @@
|
||||
<para>
|
||||
MAIL_DIR MAIL_FILE MAX_MEMBERS_PER_GROUP USERDEL_CMD
|
||||
USERGROUPS_ENAB
|
||||
<phrase condition="tcb">USE_TCB</phrase>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -444,10 +463,18 @@
|
||||
<listitem>
|
||||
<para>
|
||||
MAIL_DIR MAIL_FILE MAX_MEMBERS_PER_GROUP
|
||||
<phrase condition="tcb">USE_TCB</phrase>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry condition="tcb">
|
||||
<term>vipw</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<phrase condition="tcb">USE_TCB</phrase>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<!-- vipw / vigr: no variables (MAX_MEMBERS_PER_GROUP linked but not used) -->
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
|
37
man/login.defs.d/TCB_AUTH_GROUP.xml
Normal file
37
man/login.defs.d/TCB_AUTH_GROUP.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<!--
|
||||
Copyright (c) 2010, Pawel Hajdan
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the copyright holders or contributors may not be used to
|
||||
endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<varlistentry condition="tcb">
|
||||
<term><option>TCB_AUTH_GROUP</option> (boolean)</term>
|
||||
<listitem>
|
||||
<para>
|
||||
If <replaceable>yes</replaceable>, newly created tcb shadow files
|
||||
will be group owned by the <replaceable>auth</replaceable> group.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
53
man/login.defs.d/TCB_SYMLINKS.xml
Normal file
53
man/login.defs.d/TCB_SYMLINKS.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<!--
|
||||
Copyright (c) 2010, Pawel Hajdan
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the copyright holders or contributors may not be used to
|
||||
endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<varlistentry condition="tcb">
|
||||
<term><option>TCB_SYMLINKS</option> (boolean)</term>
|
||||
<listitem>
|
||||
<para>
|
||||
If <replaceable>yes</replaceable>, the location of the user tcb
|
||||
directory to be created will not be automatically set to /etc/tcb/user,
|
||||
but will be computed depending on the UID of the user, according to
|
||||
the following algorithm:
|
||||
<programlisting>
|
||||
if ( UID is less than 1000) {
|
||||
use /etc/tcb/user
|
||||
} else if ( UID is less than 1000000) {
|
||||
kilos = UID / 1000
|
||||
use /etc/tcb/:kilos/user
|
||||
make symlink /etc/tcb/user to the above directory
|
||||
} else {
|
||||
megas = UID / 1000000
|
||||
kilos = ( UID / megas * 1000000 ) / 1000
|
||||
use /etc/tcb/:megas/:kilos/user
|
||||
make symlink /etc/tcb/user to the above directory
|
||||
}
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
38
man/login.defs.d/USE_TCB.xml
Normal file
38
man/login.defs.d/USE_TCB.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<!--
|
||||
Copyright (c) 2010, Pawel Hajdan
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the copyright holders or contributors may not be used to
|
||||
endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<varlistentry condition="tcb">
|
||||
<term><option>USE_TCB</option> (boolean)</term>
|
||||
<listitem>
|
||||
<para>
|
||||
If <replaceable>yes</replaceable>, the <citerefentry>
|
||||
<refentrytitle>tcb</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
||||
password shadowing scheme will be used.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
@@ -117,6 +117,12 @@
|
||||
<para>Edit shadow or gshadow database.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry condition="tcb">
|
||||
<term><option>-u</option>, <option>--user</option></term>
|
||||
<listitem>
|
||||
<para>Indicates which user's tcb shadow file to edit.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
@@ -165,6 +171,9 @@
|
||||
<citerefentry>
|
||||
<refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum>
|
||||
</citerefentry>,
|
||||
<citerefentry condition="tcb">
|
||||
<refentrytitle>tcb</refentrytitle><manvolnum>5</manvolnum>
|
||||
</citerefentry>,
|
||||
<citerefentry>
|
||||
<refentrytitle>shadow</refentrytitle><manvolnum>5</manvolnum>
|
||||
</citerefentry>.
|
||||
|
Reference in New Issue
Block a user