Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gc #13

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Gc #13

wants to merge 25 commits into from

Conversation

dionis55rus
Copy link

No description provided.

git-core and others added 25 commits July 19, 2012 16:37
o don't use malloc/free, allocate space on stack
o don't use unsafe sprintf
o use ARG_MAX as cmd size for clarity, cmd isn't just a filename
o remove unsafe logging, ensure last points inside cmd
By doing so we may
- move change of identity to the child, so no need to change it back
- drop saved set-user/group-ID safely
  An attacker will gain no more than a process with its ids. As a side effect,
  the code that unsets environment variables becomes useless.
- implement asynchronous wait for child later
An attacker could access the communication channel between su and Superuser
otherwise.
Restructure the code a bit decreasing the cost of checks for non-CM ROMs
Just check whether ro.cm.version exists without getting its value nobody
cares of anyway. The check_property function used here returns true if
a property with given prefix exists. More than enough for CM and others.

Certainly, the best way is to fix the nighmare called get_property. At least,
those stupid strdup() shall be removed. If somebody is willing to fix
this "code", he/she is welcomed.
Choose the value of the socket field in intents depending on the allow arg,
because the socket_path argument is removed from send_intent. Use enum type
for allow.
Pick up am exit code in the SIGCHLD handler. Kill am with request
(first child) after a response has been received from Requestor,
if that am hangs.
... so su can get its exit status
It's too high on the stack
It's shared between the SIGCHLD signal handler and normal flow. Its type is
still pid_t, however, not sig_atomic_t.
<endian.h> defines htobe32 and like, not htonl we're using. Strictly
speaking, we have to to include <arpa/inet.h>. su isn't aimed to be so
portable though.
Corresponds with Superuser repo commit
e16376e17a7680c50bdf626a73f46a8b60bd4793
@git-core
Copy link
Collaborator

What is the reason for doing a merge like that?

@Money4hire47
Copy link

N/a

@TooTallbmf13 TooTallbmf13 linked an issue Apr 3, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3df90fc9b811728a9b7ee45f598f9ae196783b54
5 participants