mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
make the protocol plugins make use of modargs
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@62 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
a96ed347a3
commit
216591d95e
17 changed files with 275 additions and 79 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include <netinet/ip.h>
|
||||
|
||||
#include "socket-util.h"
|
||||
#include "util.h"
|
||||
|
||||
void pa_socket_peer_to_string(int fd, char *c, size_t l) {
|
||||
struct stat st;
|
||||
|
|
@ -150,3 +151,41 @@ int pa_unix_socket_remove_stale(const char *fn) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pa_unix_socket_make_secure_dir(const char *fn) {
|
||||
int ret = -1;
|
||||
char *slash, *dir = strdup(fn);
|
||||
assert(dir);
|
||||
|
||||
if (!(slash = strrchr(dir, '/')))
|
||||
goto finish;
|
||||
*slash = 0;
|
||||
|
||||
if (pa_make_secure_dir(dir) < 0)
|
||||
goto finish;
|
||||
|
||||
ret = 0;
|
||||
|
||||
finish:
|
||||
free(dir);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int pa_unix_socket_remove_secure_dir(const char *fn) {
|
||||
int ret = -1;
|
||||
char *slash, *dir = strdup(fn);
|
||||
assert(dir);
|
||||
|
||||
if (!(slash = strrchr(dir, '/')))
|
||||
goto finish;
|
||||
*slash = 0;
|
||||
|
||||
if (rmdir(dir) < 0)
|
||||
goto finish;
|
||||
|
||||
ret = 0;
|
||||
|
||||
finish:
|
||||
free(dir);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue