aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-09-10 13:15:28 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-09-10 13:15:28 +0000
commita2f61012b6f93473ed002e6609557cb1cd81b7dd (patch)
tree51ce422afbda2249a5de22e834ed04e200e0961f /include
parentac074b3f87cc22c2ddadb074d630156fea720744 (diff)
downloadbusybox-w32-a2f61012b6f93473ed002e6609557cb1cd81b7dd.tar.gz
busybox-w32-a2f61012b6f93473ed002e6609557cb1cd81b7dd.tar.bz2
busybox-w32-a2f61012b6f93473ed002e6609557cb1cd81b7dd.zip
setup_environment: code shrink
run_shell: mark as NORETURN setup_environment, run_shell: add usage comments login: add FIXME :( function old new delta UNSPEC_print 64 66 +2 sulogin_main 509 506 -3 mkfs_minix_main 3070 3067 -3 login_main 1615 1612 -3 su_main 461 448 -13 setup_environment 261 206 -55 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/5 up/down: 2/-77) Total: -75 bytes text data bss dec hex filename 772578 1051 10724 784353 bf7e1 busybox_old 772502 1051 10724 784277 bf795 busybox_unstripped
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index a4aa90da3..e5f03517f 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -780,6 +780,7 @@ char *bb_simplify_path(const char *path);
780extern void bb_do_delay(int seconds); 780extern void bb_do_delay(int seconds);
781extern void change_identity(const struct passwd *pw); 781extern void change_identity(const struct passwd *pw);
782extern const char *change_identity_e2str(const struct passwd *pw); 782extern const char *change_identity_e2str(const struct passwd *pw);
783extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) ATTRIBUTE_NORETURN;
783extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args); 784extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args);
784#if ENABLE_SELINUX 785#if ENABLE_SELINUX
785extern void renew_current_security_context(void); 786extern void renew_current_security_context(void);
@@ -790,6 +791,21 @@ extern void setfscreatecon_or_die(security_context_t scontext);
790#endif 791#endif
791extern void selinux_or_die(void); 792extern void selinux_or_die(void);
792extern int restricted_shell(const char *shell); 793extern int restricted_shell(const char *shell);
794
795/* setup_environment:
796 * if loginshell = 1: cd(pw->pw_dir), clear environment, then set
797 * TERM=(old value)
798 * USER=pw->pw_name, LOGNAME=pw->pw_name
799 * PATH=bb_default_[root_]path
800 * HOME=pw->pw_dir
801 * SHELL=shell
802 * else if changeenv = 1:
803 * if not root (if pw->pw_uid != 0):
804 * USER=pw->pw_name, LOGNAME=pw->pw_name
805 * HOME=pw->pw_dir
806 * SHELL=shell
807 * else does nothing
808 */
793extern void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw); 809extern void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw);
794extern int correct_password(const struct passwd *pw); 810extern int correct_password(const struct passwd *pw);
795/* Returns a ptr to static storage */ 811/* Returns a ptr to static storage */