From 95dee81a465668151cff3ffd757456a9a10c1f1f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 19 Oct 2015 01:20:36 +0200 Subject: loginutils/*: convert to new-style "one file" applets Signed-off-by: Denys Vlasenko --- loginutils/su.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'loginutils/su.c') diff --git a/loginutils/su.c b/loginutils/su.c index f812505..3c0e8c1 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 +//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 + #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. */ -- cgit v1.1