diff options
-rw-r--r-- | source3/utils/smbpasswd.c | 42 |
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); } |