summaryrefslogtreecommitdiffhomepage
path: root/loginutils/su.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-10-19 01:20:36 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-10-19 01:20:36 +0200
commit95dee81a465668151cff3ffd757456a9a10c1f1f (patch)
treea9f128900d1fc484f26cd521525907fa1af262c0 /loginutils/su.c
parent28826ac8c02793431203edb4adb961d5521d643d (diff)
loginutils/*: convert to new-style "one file" applets
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils/su.c')
-rw-r--r--loginutils/su.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/loginutils/su.c b/loginutils/su.c
index f8125054a..3c0e8c100 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -4,9 +4,31 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
-
-#include "libbb.h"
-#include <syslog.h>
+//config:config SU
+//config: bool "su"
+//config: default y
+//config: select FEATURE_SYSLOG
+//config: help
+//config: su is used to become another user during a login session.
+//config: Invoked without a username, su defaults to becoming the super user.
+//config:
+//config: Note that Busybox binary must be setuid root for this applet to
+//config: work properly.
+//config:
+//config:config FEATURE_SU_SYSLOG
+//config: bool "Enable su to write to syslog"
+//config: default y
+//config: depends on SU
+//config:
+//config:config FEATURE_SU_CHECKS_SHELLS
+//config: bool "Enable su to check user's shell to be listed in /etc/shells"
+//config: depends on SU
+//config: default y
+
+//applet:/* Needs to be run by root or be suid root - needs to change uid and gid: */
+//applet:IF_SU(APPLET(su, BB_DIR_BIN, BB_SUID_REQUIRE))
+
+//kbuild:lib-$(CONFIG_SU) += su.o
//usage:#define su_trivial_usage
//usage: "[OPTIONS] [-] [USER]"
@@ -17,6 +39,9 @@
//usage: "\n -c CMD Command to pass to 'sh -c'"
//usage: "\n -s SH Shell to use instead of user's default"
+#include "libbb.h"
+#include <syslog.h>
+
#if ENABLE_FEATURE_SU_CHECKS_SHELLS
/* Return 1 if SHELL is a restricted shell (one not returned by
* getusershell), else 0, meaning it is a standard shell. */