mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-10 13:29:58 -05:00
* use setresuid() instead of setruid() if available
* if fix for the non-fp resampler git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@314 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
758647868f
commit
9a9309f593
3 changed files with 18 additions and 8 deletions
19
polyp/caps.c
19
polyp/caps.c
|
|
@ -23,6 +23,9 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/* setresuid() is only available on GNU */
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
|
@ -41,13 +44,17 @@ void pa_drop_root(void) {
|
|||
|
||||
if (uid == 0 || geteuid() != 0)
|
||||
return;
|
||||
|
||||
/* pa_log(__FILE__": dropping root rights.\n"); */
|
||||
|
||||
setreuid(uid, uid);
|
||||
|
||||
/* setuid(uid);
|
||||
seteuid(uid);*/
|
||||
/* pa_log(__FILE__": dropping root rights.\n"); */
|
||||
|
||||
#if defined(HAVE_SETRESUID)
|
||||
setresuid(uid, uid, uid);
|
||||
#elif defined(HAVE_SETREUID)
|
||||
setreuid(uid, uid);
|
||||
#else
|
||||
setuid(uid);
|
||||
seteuid(uid);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_SYS_CAPABILITY_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue