aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/addgroup.c9
-rw-r--r--loginutils/adduser.c15
-rw-r--r--loginutils/chpasswd.c14
-rw-r--r--loginutils/cryptpw.c39
-rw-r--r--loginutils/deluser.c12
-rw-r--r--loginutils/login.c10
-rw-r--r--loginutils/passwd.c12
-rw-r--r--loginutils/sulogin.c7
-rw-r--r--loginutils/vlock.c7
9 files changed, 125 insertions, 0 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index 5a0714501..2d6736f1a 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -9,6 +9,15 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
*/
+
+//usage:#define addgroup_trivial_usage
+//usage: "[-g GID] " IF_FEATURE_ADDUSER_TO_GROUP("[USER] ") "GROUP"
+//usage:#define addgroup_full_usage "\n\n"
+//usage: "Add a group " IF_FEATURE_ADDUSER_TO_GROUP("or add a user to a group") "\n"
+//usage: "\nOptions:"
+//usage: "\n -g GID Group id"
+//usage: "\n -S Create a system group"
+
#include "libbb.h"
#if CONFIG_LAST_SYSTEM_ID < CONFIG_FIRST_SYSTEM_ID
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index 0c675caf9..1944d9d56 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -7,6 +7,21 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+
+//usage:#define adduser_trivial_usage
+//usage: "[OPTIONS] USER"
+//usage:#define adduser_full_usage "\n\n"
+//usage: "Add a user\n"
+//usage: "\nOptions:"
+//usage: "\n -h DIR Home directory"
+//usage: "\n -g GECOS GECOS field"
+//usage: "\n -s SHELL Login shell"
+//usage: "\n -G GRP Add user to existing group"
+//usage: "\n -S Create a system user"
+//usage: "\n -D Don't assign a password"
+//usage: "\n -H Don't create home directory"
+//usage: "\n -u UID User id"
+
#include "libbb.h"
#if CONFIG_LAST_SYSTEM_ID < CONFIG_FIRST_SYSTEM_ID
diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c
index 48cf9b130..c2d86664d 100644
--- a/loginutils/chpasswd.c
+++ b/loginutils/chpasswd.c
@@ -7,6 +7,20 @@
*/
#include "libbb.h"
+//usage:#define chpasswd_trivial_usage
+//usage: IF_LONG_OPTS("[--md5|--encrypted]") IF_NOT_LONG_OPTS("[-m|-e]")
+//usage:#define chpasswd_full_usage "\n\n"
+//usage: "Read user:password from stdin and update /etc/passwd\n"
+//usage: "\nOptions:"
+//usage: IF_LONG_OPTS(
+//usage: "\n -e,--encrypted Supplied passwords are in encrypted form"
+//usage: "\n -m,--md5 Use MD5 encryption instead of DES"
+//usage: )
+//usage: IF_NOT_LONG_OPTS(
+//usage: "\n -e Supplied passwords are in encrypted form"
+//usage: "\n -m Use MD5 encryption instead of DES"
+//usage: )
+
#if ENABLE_LONG_OPTS
static const char chpasswd_longopts[] ALIGN1 =
"encrypted\0" No_argument "e"
diff --git a/loginutils/cryptpw.c b/loginutils/cryptpw.c
index 6c801f9fa..72388c492 100644
--- a/loginutils/cryptpw.c
+++ b/loginutils/cryptpw.c
@@ -10,6 +10,45 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//usage:#define cryptpw_trivial_usage
+//usage: "[OPTIONS] [PASSWORD] [SALT]"
+/* We do support -s, we just don't mention it */
+//usage:#define cryptpw_full_usage "\n\n"
+//usage: "Crypt the PASSWORD using crypt(3)\n"
+//usage: "\nOptions:"
+//usage: IF_LONG_OPTS(
+//usage: "\n -P,--password-fd=N Read password from fd N"
+/* //usage: "\n -s,--stdin Use stdin; like -P0" */
+//usage: "\n -m,--method=TYPE Encryption method TYPE"
+//usage: "\n -S,--salt=SALT"
+//usage: )
+//usage: IF_NOT_LONG_OPTS(
+//usage: "\n -P N Read password from fd N"
+/* //usage: "\n -s Use stdin; like -P0" */
+//usage: "\n -m TYPE Encryption method TYPE"
+//usage: "\n -S SALT"
+//usage: )
+
+/* mkpasswd is an alias to cryptpw */
+//usage:#define mkpasswd_trivial_usage
+//usage: "[OPTIONS] [PASSWORD] [SALT]"
+/* We do support -s, we just don't mention it */
+//usage:#define mkpasswd_full_usage "\n\n"
+//usage: "Crypt the PASSWORD using crypt(3)\n"
+//usage: "\nOptions:"
+//usage: IF_LONG_OPTS(
+//usage: "\n -P,--password-fd=N Read password from fd N"
+/* //usage: "\n -s,--stdin Use stdin; like -P0" */
+//usage: "\n -m,--method=TYPE Encryption method TYPE"
+//usage: "\n -S,--salt=SALT"
+//usage: )
+//usage: IF_NOT_LONG_OPTS(
+//usage: "\n -P N Read password from fd N"
+/* //usage: "\n -s Use stdin; like -P0" */
+//usage: "\n -m TYPE Encryption method TYPE"
+//usage: "\n -S SALT"
+//usage: )
+
#include "libbb.h"
/* Debian has 'mkpasswd' utility, manpage says:
diff --git a/loginutils/deluser.c b/loginutils/deluser.c
index 47a10fe14..e39ac5506 100644
--- a/loginutils/deluser.c
+++ b/loginutils/deluser.c
@@ -9,6 +9,18 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*
*/
+
+//usage:#define deluser_trivial_usage
+//usage: "USER"
+//usage:#define deluser_full_usage "\n\n"
+//usage: "Delete USER from the system"
+
+//usage:#define delgroup_trivial_usage
+//usage: IF_FEATURE_DEL_USER_FROM_GROUP("[USER] ")"GROUP"
+//usage:#define delgroup_full_usage "\n\n"
+//usage: "Delete group GROUP from the system"
+//usage: IF_FEATURE_DEL_USER_FROM_GROUP(" or user USER from group GROUP")
+
#include "libbb.h"
int deluser_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/loginutils/login.c b/loginutils/login.c
index ce0d1741f..f2563dc09 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -2,6 +2,16 @@
/*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+
+//usage:#define login_trivial_usage
+//usage: "[-p] [-h HOST] [[-f] USER]"
+//usage:#define login_full_usage "\n\n"
+//usage: "Begin a new session on the system\n"
+//usage: "\nOptions:"
+//usage: "\n -f Don't authenticate (user already authenticated)"
+//usage: "\n -h Name of the remote host"
+//usage: "\n -p Preserve environment"
+
#include "libbb.h"
#include <syslog.h>
#include <sys/resource.h>
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index f3928cecc..8b6a63eec 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -2,6 +2,18 @@
/*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+
+//usage:#define passwd_trivial_usage
+//usage: "[OPTIONS] [USER]"
+//usage:#define passwd_full_usage "\n\n"
+//usage: "Change USER's password. If no USER is specified,\n"
+//usage: "changes the password for the current user.\n"
+//usage: "\nOptions:"
+//usage: "\n -a ALG Algorithm to use for password (des, md5)" /* ", sha1)" */
+//usage: "\n -d Delete password for the account"
+//usage: "\n -l Lock (disable) account"
+//usage: "\n -u Unlock (re-enable) account"
+
#include "libbb.h"
#include <syslog.h>
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 0e5b59433..28edf067c 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -5,6 +5,13 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//usage:#define sulogin_trivial_usage
+//usage: "[-t N] [TTY]"
+//usage:#define sulogin_full_usage "\n\n"
+//usage: "Single user login\n"
+//usage: "\nOptions:"
+//usage: "\n -t N Timeout"
+
#include "libbb.h"
#include <syslog.h>
diff --git a/loginutils/vlock.c b/loginutils/vlock.c
index 3299afa50..efad63ff3 100644
--- a/loginutils/vlock.c
+++ b/loginutils/vlock.c
@@ -15,6 +15,13 @@
/* Fixed by Erik Andersen to do passwords the tinylogin way...
* It now works with md5, sha1, etc passwords. */
+//usage:#define vlock_trivial_usage
+//usage: "[-a]"
+//usage:#define vlock_full_usage "\n\n"
+//usage: "Lock a virtual terminal. A password is required to unlock.\n"
+//usage: "\nOptions:"
+//usage: "\n -a Lock all VTs"
+
#include "libbb.h"
#ifdef __linux__