Commit aa3e3242 authored by Sandeep Patil's avatar Sandeep Patil
Browse files

libc: Add support to allow library calls to find appropriate shell executable for a process



Library calls like system() and popen() invoke the shell executable
pointed to by '_PATH_BSHELL' in order to run the command passed into the
function. The _PATH_BSHELL points to /system/bin/sh by default and thus
breaks any vendor process trying to use system() / popen(), as they are
denied access to system shell by selinux.

This CL make necessary changes, so the implmentations of system() and popen()
can use the appropriate shell (e.g. /vendor/bin/sh for processes running
out of /vendor partition). Also, changes the implementation of system()
and popen().

Bug: 64832610
Test: Manual, Using a test program running from /system/bin and
      /vendor/bin to ensure correct shell is being used.

Change-Id: Ie7168d69decb1ae98284446ae7db34dec930dc33
Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
parent c88fe932
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment