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:
nekral-guest
2010-03-04 18:11:13 +00:00
parent 5ba95d4c53
commit 391a384715
27 changed files with 1067 additions and 44 deletions

View File

@ -668,7 +668,7 @@ static int copy_file (const char *src, const char *dst,
* At the end, it deletes the root directory itself.
*/
int remove_tree (const char *root)
int remove_tree (const char *root, bool remove_root)
{
char *new_name = NULL;
int err = 0;
@ -721,7 +721,7 @@ int remove_tree (const char *root)
/*
* Recursively delete this directory.
*/
if (remove_tree (new_name) != 0) {
if (remove_tree (new_name, true) != 0) {
err = -1;
break;
}
@ -740,7 +740,7 @@ int remove_tree (const char *root)
}
(void) closedir (dir);
if (0 == err) {
if (remove_root && 0 == err) {
if (rmdir (root) != 0) {
err = -1;
}