mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-19 05:38:43 +00:00
Use UID instead of PID to identify the user to avoid changing projects everytime ##projects
This commit is contained in:
parent
8d4709bc0b
commit
f7000b7dcb
@ -1239,12 +1239,12 @@ R_API void r_sys_set_environ(char **e) {
|
||||
|
||||
R_API char *r_sys_whoami (char *buf) {
|
||||
char _buf[32];
|
||||
int pid = getpid ();
|
||||
int uid = getuid ();
|
||||
int hasbuf = (buf)? 1: 0;
|
||||
if (!hasbuf) {
|
||||
buf = _buf;
|
||||
}
|
||||
sprintf (buf, "pid%d", pid);
|
||||
sprintf (buf, "uid%d", uid);
|
||||
return hasbuf? buf: strdup (buf);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user