aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/bash/bash.inc
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2015-04-21 16:59:32 +0800
committerChen Qi <Qi.Chen@windriver.com>2015-04-21 17:28:36 +0800
commit4dc3c26daf47ec52cc46ed0b46eccbbe834cc43b (patch)
tree94880e3c0dc67e32fd0552791839ee0c15545f24 /meta/recipes-extended/bash/bash.inc
parentc9b06c79ed8a082d1b385e9f61721aeeda9bf1af (diff)
downloadopenembedded-core-contrib-4dc3c26daf47ec52cc46ed0b46eccbbe834cc43b.tar.gz
shadow: fix `su' behaviour
0001-su.c-fix-to-exec-command-correctly.patch is removed. Below is the reason. This patch is introduced to solve the 'su: applet not found' problem when executing `su -l xxx -c env'. The patch references codes of previous release of shadow. However, this patch introduces bug#5359. So it's not correct. Let's first look at the root cause of 'su: applet not found' problem. This problem appears when /bin/sh is provided by busybox. When executing `su -l xxx -c env' command, the following function is invoked. execve("/bin/sh", ["-su", "-c", "env"], [/* 6 vars */]) Note that the argv[0] provided to new executable file (/bin/sh) is "-su". As /bin/sh is a symlink to /bin/busybox. It's /bin/busybox that is executed. In busybox's appletlib.c, it would examine argv[0], try to find an applet that has the same name, and then try to execute the main function of the applet. This logic results in `su' applet from busybox to be executed. However, we default to set 'BUSYBOX_SPLIT_SUID' to "1", so 'su' is not found. Further more, even if we set 'BUSYBOX_SPLIT_SUID' to "0", so that 'su' applet is found. The whole behaviour is still not correct. Because 'su' from shadow takes higher priority than that from busybox, so 'su' from busybox should never be executed on such system unless it's specified clearly by the end user. The logic of busybox's appletlib.c is totally correct from the point of busybox itself. It's an integration problem. To solve the above problem, this patch comment out SU_NAME in /etc/login.defs so that the final function executed in shadow's su is as below. execve("/bin/sh", ["-sh", "-c", "env"], [/* 6 vars */]) [YOCTO #5359] [YOCTO #7137] Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Diffstat (limited to 'meta/recipes-extended/bash/bash.inc')
0 files changed, 0 insertions, 0 deletions