mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
Handle user switch in a more platform independent manner.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1118 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
b12f29d04b
commit
8d2dc9c4d1
1 changed files with 18 additions and 2 deletions
|
|
@ -37,8 +37,6 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <pwd.h>
|
|
||||||
#include <grp.h>
|
|
||||||
|
|
||||||
#include <liboil/liboil.h>
|
#include <liboil/liboil.h>
|
||||||
|
|
||||||
|
|
@ -46,6 +44,13 @@
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_PWD_H
|
||||||
|
#include <pwd.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GRP_H
|
||||||
|
#include <grp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBWRAP
|
#ifdef HAVE_LIBWRAP
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <tcpd.h>
|
#include <tcpd.h>
|
||||||
|
|
@ -155,6 +160,8 @@ static void close_pipe(int p[2]) {
|
||||||
|
|
||||||
#define set_env(key, value) putenv(pa_sprintf_malloc("%s=%s", (key), (value)))
|
#define set_env(key, value) putenv(pa_sprintf_malloc("%s=%s", (key), (value)))
|
||||||
|
|
||||||
|
#if defined(HAVE_PWD_H) && defined(HAVE_GRP_H)
|
||||||
|
|
||||||
static int change_user(void) {
|
static int change_user(void) {
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
struct group * gr;
|
struct group * gr;
|
||||||
|
|
@ -241,6 +248,15 @@ static int change_user(void) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* HAVE_PWD_H && HAVE_GRP_H */
|
||||||
|
|
||||||
|
static int change_user(void) {
|
||||||
|
pa_log(__FILE__": System wide mode unsupported on this platform.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* HAVE_PWD_H && HAVE_GRP_H */
|
||||||
|
|
||||||
static int create_runtime_dir(void) {
|
static int create_runtime_dir(void) {
|
||||||
char fn[PATH_MAX];
|
char fn[PATH_MAX];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue