* NEWS, src/userdel.c, man/userdel.8.xml: Add --root option. Open
audit and syslog after the potential chroot. userdel's usage split in smaller messages.
This commit is contained in:
parent
cecae46ccf
commit
50eafd769b
@ -6,6 +6,9 @@
|
|||||||
are applied to the chroot.
|
are applied to the chroot.
|
||||||
* NEWS, src/useradd.c, man/useradd.8.xml: Add --root option. Open
|
* NEWS, src/useradd.c, man/useradd.8.xml: Add --root option. Open
|
||||||
audit after the potential chroot.
|
audit after the potential chroot.
|
||||||
|
* NEWS, src/userdel.c, man/userdel.8.xml: Add --root option. Open
|
||||||
|
audit and syslog after the potential chroot. userdel's usage split
|
||||||
|
in smaller messages.
|
||||||
|
|
||||||
2011-10-22 Nicolas François <nicolas.francois@centraliens.net>
|
2011-10-22 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
1
NEWS
1
NEWS
@ -77,6 +77,7 @@ shadow-4.1.4.3 -> shadow-4.1.5 UNRELEASED
|
|||||||
it. If it does not exist, a warning is issued, but no failure.
|
it. If it does not exist, a warning is issued, but no failure.
|
||||||
* Do not remove a group with the same name as the user (usergroup) if
|
* Do not remove a group with the same name as the user (usergroup) if
|
||||||
this group isn't the user's primary group.
|
this group isn't the user's primary group.
|
||||||
|
* Add --root option.
|
||||||
- usermod
|
- usermod
|
||||||
* Accept options in any order (username not necessarily at the end)
|
* Accept options in any order (username not necessarily at the end)
|
||||||
* When the shadow file exists but there are no shadow entries, an entry
|
* When the shadow file exists but there are no shadow entries, an entry
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 1991 - 1994, Julianne Frances Haugh
|
Copyright (c) 1991 - 1994, Julianne Frances Haugh
|
||||||
Copyright (c) 2007 - 2009, Nicolas François
|
Copyright (c) 2007 - 2011, Nicolas François
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
@ -123,6 +123,19 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>-R</option>, <option>--root</option>
|
||||||
|
<replaceable>CHROOT_DIR</replaceable>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Apply changes in the <replaceable>CHROOT_DIR</replaceable>
|
||||||
|
directory and use the configuration files from the
|
||||||
|
<replaceable>CHROOT_DIR</replaceable> directory.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -122,14 +122,19 @@ static int remove_tcbdir (const char *user_name, uid_t user_id);
|
|||||||
*/
|
*/
|
||||||
static void usage (int status)
|
static void usage (int status)
|
||||||
{
|
{
|
||||||
fputs (_("Usage: userdel [options] LOGIN\n"
|
FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
|
||||||
"\n"
|
(void) fprintf (usageout,
|
||||||
"Options:\n"
|
_("Usage: %s [options] LOGIN\n"
|
||||||
" -f, --force force removal of files,\n"
|
"\n"
|
||||||
" even if not owned by user\n"
|
"Options:\n"),
|
||||||
" -h, --help display this help message and exit\n"
|
Prog);
|
||||||
" -r, --remove remove home directory and mail spool\n"
|
(void) fputs (_(" -f, --force force removal of files,\n"
|
||||||
"\n"), (E_SUCCESS != status) ? stderr : stdout);
|
" even if not owned by user\n"),
|
||||||
|
usageout);
|
||||||
|
(void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
|
||||||
|
(void) fputs (_(" -r, --remove remove home directory and mail spool\n"), usageout);
|
||||||
|
(void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
|
||||||
|
(void) fputs ("\n", usageout);
|
||||||
exit (status);
|
exit (status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -844,10 +849,6 @@ int main (int argc, char **argv)
|
|||||||
#endif /* USE_PAM */
|
#endif /* USE_PAM */
|
||||||
#endif /* ACCT_TOOLS_SETUID */
|
#endif /* ACCT_TOOLS_SETUID */
|
||||||
|
|
||||||
#ifdef WITH_AUDIT
|
|
||||||
audit_help_open ();
|
|
||||||
#endif /* WITH_AUDIT */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get my name so that I can use it to report errors.
|
* Get my name so that I can use it to report errors.
|
||||||
*/
|
*/
|
||||||
@ -856,6 +857,13 @@ int main (int argc, char **argv)
|
|||||||
(void) bindtextdomain (PACKAGE, LOCALEDIR);
|
(void) bindtextdomain (PACKAGE, LOCALEDIR);
|
||||||
(void) textdomain (PACKAGE);
|
(void) textdomain (PACKAGE);
|
||||||
|
|
||||||
|
process_root_flag ("-R", argc, argv);
|
||||||
|
|
||||||
|
OPENLOG ("userdel");
|
||||||
|
#ifdef WITH_AUDIT
|
||||||
|
audit_help_open ();
|
||||||
|
#endif /* WITH_AUDIT */
|
||||||
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Parse the command line options.
|
* Parse the command line options.
|
||||||
@ -865,9 +873,10 @@ int main (int argc, char **argv)
|
|||||||
{"force", no_argument, NULL, 'f'},
|
{"force", no_argument, NULL, 'f'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"remove", no_argument, NULL, 'r'},
|
{"remove", no_argument, NULL, 'r'},
|
||||||
|
{"root", required_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
while ((c = getopt_long (argc, argv, "fhr",
|
while ((c = getopt_long (argc, argv, "fhrR:",
|
||||||
long_options, NULL)) != -1) {
|
long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'f': /* force remove even if not owned by user */
|
case 'f': /* force remove even if not owned by user */
|
||||||
@ -879,6 +888,8 @@ int main (int argc, char **argv)
|
|||||||
case 'r': /* remove home dir and mailbox */
|
case 'r': /* remove home dir and mailbox */
|
||||||
rflg = true;
|
rflg = true;
|
||||||
break;
|
break;
|
||||||
|
case 'R': /* no-op, handled in process_root_flag () */
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage (E_USAGE);
|
usage (E_USAGE);
|
||||||
}
|
}
|
||||||
@ -889,8 +900,6 @@ int main (int argc, char **argv)
|
|||||||
usage (E_USAGE);
|
usage (E_USAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
OPENLOG ("userdel");
|
|
||||||
|
|
||||||
#ifdef ACCT_TOOLS_SETUID
|
#ifdef ACCT_TOOLS_SETUID
|
||||||
#ifdef USE_PAM
|
#ifdef USE_PAM
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user