summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-11-19 08:12:06 +0000
committerMartin Pool <mbp@samba.org>2001-11-19 08:12:06 +0000
commit59b852fd723ef5d46dfeb50ba5856826cb38cc63 (patch)
treeec377c26012f6e291ec8a38d7799bd3a86e2fff3
parent9b1f2c4090e351826d82e977f0c5908c0b126123 (diff)
downloadsamba-59b852fd723ef5d46dfeb50ba5856826cb38cc63.tar.gz
samba-59b852fd723ef5d46dfeb50ba5856826cb38cc63.tar.bz2
samba-59b852fd723ef5d46dfeb50ba5856826cb38cc63.zip
Make the smbpasswd options/usage message a little less bizarre: it now
shows all the available options, but explains that you must be root to use them. Surely this is less confusing? (This used to be commit 19f5f813995d1cf3874df705ab5e71aa5eb14ae6)
-rw-r--r--source3/utils/smbpasswd.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 1e637ede35..ea8fffc295 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -1,7 +1,5 @@
/*
* Unix SMB/Netbios implementation.
- * Version 1.9.
- * smbpasswd module.
* Copyright (C) Jeremy Allison 1995-1998
* Copyright (C) Tim Potter 2001
*
@@ -30,36 +28,36 @@ extern pstring global_myname;
extern char *optarg;
extern int optind;
-/* forced running in root-mode */
+/** forced running in root-mode **/
static BOOL local_mode;
-/*********************************************************
- Print command usage on stderr and die.
-**********************************************************/
+/**
+ * Print command usage on stderr and die.
+ **/
static void usage(void)
{
- if (getuid() == 0) {
- printf("smbpasswd [options] [username] [password]\n");
- } else {
- printf("smbpasswd [options] [password]\n");
- }
+ printf("When run by root:\n");
+ printf(" smbpasswd [options] [username] [password]\n");
+ printf("otherwise:\n");
+ printf(" smbpasswd [options] [password]\n\n");
+
printf("options:\n");
printf(" -s use stdin for password prompt\n");
printf(" -D LEVEL debug level\n");
printf(" -U USER remote username\n");
printf(" -r MACHINE remote machine\n");
- if (getuid() == 0 || local_mode) {
- printf(" -L local mode (must be first option)\n");
- printf(" -R ORDER name resolve order\n");
- printf(" -j DOMAIN join domain name\n");
- printf(" -a add user\n");
- printf(" -x delete user\n");
- printf(" -d disable user\n");
- printf(" -e enable user\n");
- printf(" -n set no password\n");
- printf(" -m machine trust account\n");
- }
+ printf("extra options when run by root or in local mode:\n");
+ printf(" -L local mode (must be first option)\n");
+ printf(" -R ORDER name resolve order\n");
+ printf(" -j DOMAIN join domain name\n");
+ printf(" -a add user\n");
+ printf(" -x delete user\n");
+ printf(" -d disable user\n");
+ printf(" -e enable user\n");
+ printf(" -n set no password\n");
+ printf(" -m machine trust account\n");
+
exit(1);
}