]> granicus.if.org Git - shadow/commitdiff
* src/userdel.c, man/login.defs.d/USERDEL_CMD.xml: Move the
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Tue, 12 May 2009 19:23:46 +0000 (19:23 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Tue, 12 May 2009 19:23:46 +0000 (19:23 +0000)
USERDEL_CMD script example from the source code to the
documentation.

ChangeLog
NEWS
man/login.defs.d/USERDEL_CMD.xml
src/userdel.c

index 405f0c7033069ccb2a364ed938e916475a025b12..bc1323f1d57c7a0675a18d8b184eb710a8b273bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-11  Nicolas François  <nicolas.francois@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@centraliens.net>
 
        * man/newusers.8.xml: PAM enabled version: describe how passwords
diff --git a/NEWS b/NEWS
index 905799905b7d359115cfd2b87ffd1303f2d39b2d..792ed44243c214f02ed7ce2339343b5eda88f456 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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
index 993530ee3014ff32e0da0847ac4420fff545822e..6529b51ff1624e528913ca5afc8bcbcb76994bfd 100644 (file)
@@ -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
       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>
index 189ccf0b0a2265be819e1ffd554abb79f05ed132..c341d02777ab0c7a8026a4b7aca736d30bd849bb 100644 (file)
@@ -625,40 +625,10 @@ static void user_busy (const char *name, uid_t uid)
 /* 
  * 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;