Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/usr.sbin/user Pull up revisions 1.30-1.32 (requested by...



details:   https://anonhg.NetBSD.org/src/rev/f7d129986f04
branches:  netbsd-1-4
changeset: 471204:f7d129986f04
user:      he <he%NetBSD.org@localhost>
date:      Sat Nov 04 18:38:29 2000 +0000

description:
Pull up revisions 1.30-1.32 (requested by simonb):
  Make usage message fit in 80 columns.  Recursively make new
  home directory writable by the user after copying skel files.
  Remove some debugging code in the removal of user home dirs.

diffstat:

 usr.sbin/user/user.c |  39 ++++++++++++++++++---------------------
 1 files changed, 18 insertions(+), 21 deletions(-)

diffs (104 lines):

diff -r 475353645de4 -r f7d129986f04 usr.sbin/user/user.c
--- a/usr.sbin/user/user.c      Sat Nov 04 18:32:47 2000 +0000
+++ b/usr.sbin/user/user.c      Sat Nov 04 18:38:29 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: user.c,v 1.10.2.7 2000/10/25 17:08:01 he Exp $ */
+/* $NetBSD: user.c,v 1.10.2.8 2000/11/04 18:38:29 he Exp $ */
 
 /*
  * Copyright (c) 1999 Alistair G. Crooks.  All rights reserved.
@@ -35,7 +35,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999 \
                The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: user.c,v 1.10.2.7 2000/10/25 17:08:01 he Exp $");
+__RCSID("$NetBSD: user.c,v 1.10.2.8 2000/11/04 18:38:29 he Exp $");
 #endif
 
 #include <sys/types.h>
@@ -166,6 +166,7 @@
 };
 
 /* Full paths of programs used here */
+#define CHMOD          "/bin/chmod"
 #define CHOWN          "/usr/sbin/chown"
 #define MKDIR          "/bin/mkdir"
 #define MV             "/bin/mv"
@@ -242,16 +243,12 @@
 
        (void) seteuid(uid);
        /* we add the "|| true" to keep asystem() quiet if there is a non-zero exit status. */
-#if 1
-printf("XXX: %s -rf %s > /dev/null 2>&1 || true", RM, dir);
-#else
        (void) asystem("%s -rf %s > /dev/null 2>&1 || true", RM, dir);
        (void) seteuid(0);
        if (rmdir(dir) < 0) {
                warnx("Unable to remove all files in `%s'\n", dir);
                return 0;
        }
-#endif
        return 1;
 }
 
@@ -392,6 +389,7 @@
                                skeldir, PAX, (verbose) ? "-v" : "", dir);
        }
        (void) asystem("%s -R -h %d:%d %s", CHOWN, uid, gid, dir);
+       (void) asystem("%s -R u+w %s", CHMOD, dir);
        return n;
 }
 
@@ -1189,38 +1187,37 @@
 {
        if (strcmp(prog, "useradd") == 0) {
                (void) fprintf(stderr, "Usage: %s -D [-b basedir] [-e expiry] "
-                   "[-f inactive] [-g group] [-r lowuid..highuid] [-s shell]"
-                   "\n", prog);
+                   "[-f inactive] [-g group]\n\t[-r lowuid..highuid] "
+                   "[-s shell]\n", prog);
                (void) fprintf(stderr, "Usage: %s [-G group] [-b basedir] "
-                   "[-c comment] [-d homedir] [-e expiry] [-f inactive]\n"
-                   "\t[-g group] [-k skeletondir] [-m] [-o] [-p password] "
-                   "[-r lowuid..highuid] [-s shell]\n\t[-u uid] [-v] user\n",
+                   "[-c comment] [-d homedir] [-e expiry]\n\t[-f inactive] "
+                   "[-g group] [-k skeletondir] [-m] [-o] [-p password]\n"
+                   "\t[-r lowuid..highuid] [-s shell]\n\t[-u uid] [-v] user\n",
                    prog);
        } else if (strcmp(prog, "usermod") == 0) {
                (void) fprintf(stderr, "Usage: %s [-G group] [-c comment] "
-                   "[-d homedir] [-e expire] [-f inactive] [-g group] "
-                   "[-l newname] [-m] [-o] [-p password] [-s shell] [-u uid] "
-                   "[-v] user\n", prog);
+                   "[-d homedir] [-e expire] [-f inactive]\n\t[-g group] "
+                   "[-l newname] [-m] [-o] [-p password] [-s shell] [-u uid]\n"
+                   "\t[-v] user\n", prog);
        } else if (strcmp(prog, "userdel") == 0) {
                (void) fprintf(stderr, "Usage: %s -D [-p preserve]\n", prog);
-               (void) fprintf(stderr, "Usage: %s [-p preserve] [-r] [-v] "
-                       "user\n", prog);
+               (void) fprintf(stderr,
+                   "Usage: %s [-p preserve] [-r] [-v] user\n", prog);
 #ifdef EXTENSIONS
        } else if (strcmp(prog, "userinfo") == 0) {
                (void) fprintf(stderr, "Usage: %s [-e] [-v] user\n", prog);
 #endif
        } else if (strcmp(prog, "groupadd") == 0) {
                (void) fprintf(stderr, "Usage: %s [-g gid] [-o] [-v] group\n",
-                       prog);
+                   prog);
        } else if (strcmp(prog, "groupdel") == 0) {
                (void) fprintf(stderr, "Usage: %s [-v] group\n", prog);
        } else if (strcmp(prog, "groupmod") == 0) {
-               (void) fprintf(stderr, "Usage: %s [-g gid] [-o] [-n newname] "
-                       "[-v] group\n", prog);
+               (void) fprintf(stderr,
+                   "Usage: %s [-g gid] [-o] [-n newname] [-v] group\n", prog);
        } else if (strcmp(prog, "user") == 0 || strcmp(prog, "group") == 0) {
                (void) fprintf(stderr,
-                       "Usage: %s ( add | del | mod | info ) ...\n",
-                       prog);
+                   "Usage: %s ( add | del | mod | info ) ...\n", prog);
 #ifdef EXTENSIONS
        } else if (strcmp(prog, "groupinfo") == 0) {
                (void) fprintf(stderr, "Usage: %s [-e] [-v] group\n", prog);



Home | Main Index | Thread Index | Old Index