diff options
Diffstat (limited to 'src/pulsecore/authkey.c')
-rw-r--r-- | src/pulsecore/authkey.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/pulsecore/authkey.c b/src/pulsecore/authkey.c index d422d6a2..f3f40f80 100644 --- a/src/pulsecore/authkey.c +++ b/src/pulsecore/authkey.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -49,7 +47,7 @@ /* Generate a new authorization key, store it in file fd and return it in *data */ static int generate(int fd, void *ret_data, size_t length) { ssize_t r; - + pa_assert(fd >= 0); pa_assert(ret_data); pa_assert(length > 0); @@ -82,13 +80,13 @@ static int load(const char *fn, void *data, size_t length) { int writable = 1; int unlock = 0, ret = -1; ssize_t r; - + pa_assert(fn); pa_assert(data); pa_assert(length > 0); if ((fd = open(fn, O_RDWR|O_CREAT|O_BINARY|O_NOCTTY, S_IRUSR|S_IWUSR)) < 0) { - + if (errno != EACCES || (fd = open(fn, O_RDONLY|O_BINARY|O_NOCTTY)) < 0) { pa_log("Failed to open cookie file '%s': %s", fn, pa_cstrerror(errno)); goto finish; @@ -161,7 +159,7 @@ static const char *normalize_path(const char *fn, char *s, size_t l) { if (strlen(fn) < 3 || !isalpha(fn[0]) || fn[1] != ':' || fn[2] != '\\') { #endif char homedir[PATH_MAX]; - + if (!pa_get_home_dir(homedir, sizeof(homedir))) return NULL; @@ -181,7 +179,7 @@ static const char *normalize_path(const char *fn, char *s, size_t l) { int pa_authkey_load_auto(const char *fn, void *data, size_t length) { char path[PATH_MAX]; const char *p; - + pa_assert(fn); pa_assert(data); pa_assert(length > 0); @@ -199,7 +197,7 @@ int pa_authkey_save(const char *fn, const void *data, size_t length) { ssize_t r; char path[PATH_MAX]; const char *p; - + pa_assert(fn); pa_assert(data); pa_assert(length > 0); |