remove unused AUCAT_COOKIE environment variable

This commit is contained in:
Alexandre Ratchov 2015-10-01 08:50:13 +02:00
parent 7062d226ac
commit 6ddedf6c9f
2 changed files with 6 additions and 14 deletions

View File

@ -245,21 +245,17 @@ static int
aucat_mkcookie(unsigned char *cookie)
{
struct stat sb;
char buf[PATH_MAX], tmp[PATH_MAX], *path;
char *home, path[PATH_MAX], tmp[PATH_MAX];
ssize_t len;
int fd;
/*
* try to load the cookie
*/
path = issetugid() ? NULL : getenv("AUCAT_COOKIE");
if (path == NULL) {
path = issetugid() ? NULL : getenv("HOME");
if (path == NULL)
goto bad_gen;
snprintf(buf, PATH_MAX, "%s/.aucat_cookie", path);
path = buf;
}
home = issetugid() ? NULL : getenv("HOME");
if (home == NULL)
goto bad_gen;
snprintf(path, PATH_MAX, "%s/.aucat_cookie", home);
fd = open(path, O_RDONLY);
if (fd < 0) {
if (errno != ENOENT)
@ -301,7 +297,7 @@ bad_gen:
/*
* try to save the cookie
*/
if (path == NULL)
if (home == NULL)
return 1;
if (strlcpy(tmp, path, PATH_MAX) >= PATH_MAX ||
strlcat(tmp, ".XXXXXXXX", PATH_MAX) >= PATH_MAX) {

View File

@ -198,10 +198,6 @@ If a session needs to be shared between multiple users, they
can connect to the server using the same cookie.
.Sh ENVIRONMENT
.Bl -tag -width "AUDIODEVICEXXX" -compact
.It Ev AUCAT_COOKIE
Path to file containing the session cookie to be used
when connecting to
.Xr sndiod 1 .
.It Ev AUDIODEVICE
Audio device to use if the application provides
no device chooser.