generic-poky/meta/recipes-extended/shadow/files
Chen Qi d477da6618 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]

(From OE-Core rev: 6820f05dad0b4f9b9bbcf7c2a0af8c34f66199ae)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-24 11:06:56 +01:00
..
pam.d shadow: remove reference to locale env files from login and su 2013-12-09 18:01:43 +00:00
0001-Do-not-read-login.defs-before-doing-chroot.patch shadow: Make useradd work correctly with --root again 2014-09-16 22:13:51 +01:00
0001-useradd.c-create-parent-directories-when-necessary.patch shadow: upgrade from 4.1.4.3 to 4.2.1 2014-07-17 12:36:18 +01:00
allow-for-setting-password-in-clear-text.patch shadow: upgrade from 4.1.4.3 to 4.2.1 2014-07-17 12:36:18 +01:00
check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch shadow: enable support for subordinate IDs 2014-11-04 10:27:12 +00:00
commonio.c-fix-unexpected-open-failure-in-chroot-env.patch shadow: upgrade from 4.1.4.3 to 4.2.1 2014-07-17 12:36:18 +01:00
disable-syslog.patch shadow-native: disable logging to syslog 2012-04-10 13:31:59 +01:00
fix-installation-failure-with-subids-disabled.patch shadow: upgrade from 4.1.4.3 to 4.2.1 2014-07-17 12:36:18 +01:00
login.defs_shadow-sysroot shadow-sysroot: new recipe for useradd.bbclass support 2011-06-28 13:55:40 +01:00
login_defs_pam.sed shadow: upgrade to 4.1.4.3 to fix security vulnerability 2011-03-01 07:27:31 -08:00
securetty shadow: securetty: Add Xilinx Zynq SoC 2015-01-29 15:36:47 +00:00
shadow-4.1.3-dots-in-usernames.patch shadow: recipe and patch cleanup 2011-06-06 15:58:41 +01:00
shadow-update-pam-conf.patch shadow: update pam related configure files 2011-07-27 12:02:42 +01:00
usermod-fix-compilation-failure-with-subids-disabled.patch shadow: upgrade from 4.1.4.3 to 4.2.1 2014-07-17 12:36:18 +01:00