[Pkg-shadow-commits] r2916 - in upstream/trunk: . man/login.defs.d src
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Tue May 12 19:23:46 UTC 2009
Author: nekral-guest
Date: 2009-05-12 19:23:46 +0000 (Tue, 12 May 2009)
New Revision: 2916
Modified:
upstream/trunk/ChangeLog
upstream/trunk/NEWS
upstream/trunk/man/login.defs.d/USERDEL_CMD.xml
upstream/trunk/src/userdel.c
Log:
* src/userdel.c, man/login.defs.d/USERDEL_CMD.xml: Move the
USERDEL_CMD script example from the source code to the
documentation.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2009-05-11 20:30:36 UTC (rev 2915)
+++ upstream/trunk/ChangeLog 2009-05-12 19:23:46 UTC (rev 2916)
@@ -1,5 +1,11 @@
2009-05-11 Nicolas François <nicolas.francois at centraliens.net>
+ * src/userdel.c, man/login.defs.d/USERDEL_CMD.xml: Move the
+ USERDEL_CMD script example from the source code to the
+ documentation.
+
+2009-05-11 Nicolas François <nicolas.francois at centraliens.net>
+
* man/newusers.8.xml: PAM enabled version: describe how passwords
are updated and how newusers behave in case of error.
Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS 2009-05-11 20:30:36 UTC (rev 2915)
+++ upstream/trunk/NEWS 2009-05-12 19:23:46 UTC (rev 2916)
@@ -1,5 +1,7 @@
$Id$
+shadow-4.1.4 -> shadow-4.1.4.1 UNRELEASED
+
shadow-4.1.3.1 -> shadow-4.1.4 2009-05-10
- packaging
Modified: upstream/trunk/man/login.defs.d/USERDEL_CMD.xml
===================================================================
--- upstream/trunk/man/login.defs.d/USERDEL_CMD.xml 2009-05-11 20:30:36 UTC (rev 2915)
+++ upstream/trunk/man/login.defs.d/USERDEL_CMD.xml 2009-05-12 19:23:46 UTC (rev 2916)
@@ -1,7 +1,8 @@
<!--
Copyright (c) 1991 - 1993, Julianne Frances Haugh
Copyright (c) 1991 - 1993, Chip Rosenthal
- Copyright (c) 2007 - 2008, Nicolas François
+ Copyright (c) 1996 - 2000, Marek Michałkiewicz
+ Copyright (c) 2007 - 2009, Nicolas François
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -36,5 +37,35 @@
remove any at/cron/print jobs etc. owned by the user to be removed
(passed as the first argument).
</para>
+ <para>
+ The return code of the script is not taken into account.
+ </para>
+ <para>
+ Here is an example script, which removes the user's
+ cron, at and print jobs:
+ <programlisting>
+#! /bin/sh
+
+# Check for the required argument.
+if [ $# != 1 ]; then
+ echo "Usage: $0 username"
+ exit 1
+fi
+
+# Remove cron jobs.
+crontab -r -u $1
+
+# Remove at jobs.
+# Note that it will remove any jobs owned by the same UID,
+# even if it was shared by a different username.
+find /var/spool/cron/atjobs -name "[^.]*" -type f -user $1 -exec rm {} \;
+
+# Remove print jobs.
+lprm $1
+
+# All done.
+exit 0
+ </programlisting>
+ </para>
</listitem>
</varlistentry>
Modified: upstream/trunk/src/userdel.c
===================================================================
--- upstream/trunk/src/userdel.c 2009-05-11 20:30:36 UTC (rev 2915)
+++ upstream/trunk/src/userdel.c 2009-05-12 19:23:46 UTC (rev 2916)
@@ -625,40 +625,10 @@
/*
* user_cancel - cancel cron and at jobs
*
- * user_cancel removes the crontab and any at jobs for a user
+ * user_cancel calls a script for additional cleanups like removal of
+ * cron, at, or print jobs.
*/
-/*
- * We used to have all this stuff hardcoded here, but now
- * we just run an external script - it may need to do other
- * things as well (like removing print jobs) and we may not
- * want to recompile userdel too often. Below is a sample
- * script (should work at least on Debian 1.1). --marekm
-==========
-#! /bin/sh
-
-# Check for the required argument.
-if [ $# != 1 ]; then
- echo Usage: $0 username
- exit 1
-fi
-
-# Remove cron jobs.
-crontab -r -u $1
-
-# Remove at jobs. XXX - will remove any jobs owned by the same UID, even if
-# it was shared by a different username. at really should store the username
-# somewhere, and atrm should support an option to remove all jobs owned by
-# the specified user - for now we have to do this ugly hack...
-find /var/spool/cron/atjobs -name "[^.]*" -type f -user $1 -exec rm {} \;
-
-# Remove print jobs.
-lprm $1
-
-# All done.
-exit 0
-==========
- */
static void user_cancel (const char *user)
{
char *cmd;
More information about the Pkg-shadow-commits
mailing list