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) aucat_mkcookie(unsigned char *cookie)
{ {
struct stat sb; struct stat sb;
char buf[PATH_MAX], tmp[PATH_MAX], *path; char *home, path[PATH_MAX], tmp[PATH_MAX];
ssize_t len; ssize_t len;
int fd; int fd;
/* /*
* try to load the cookie * try to load the cookie
*/ */
path = issetugid() ? NULL : getenv("AUCAT_COOKIE"); home = issetugid() ? NULL : getenv("HOME");
if (path == NULL) { if (home == NULL)
path = issetugid() ? NULL : getenv("HOME"); goto bad_gen;
if (path == NULL) snprintf(path, PATH_MAX, "%s/.aucat_cookie", home);
goto bad_gen;
snprintf(buf, PATH_MAX, "%s/.aucat_cookie", path);
path = buf;
}
fd = open(path, O_RDONLY); fd = open(path, O_RDONLY);
if (fd < 0) { if (fd < 0) {
if (errno != ENOENT) if (errno != ENOENT)
@ -301,7 +297,7 @@ bad_gen:
/* /*
* try to save the cookie * try to save the cookie
*/ */
if (path == NULL) if (home == NULL)
return 1; return 1;
if (strlcpy(tmp, path, PATH_MAX) >= PATH_MAX || if (strlcpy(tmp, path, PATH_MAX) >= PATH_MAX ||
strlcat(tmp, ".XXXXXXXX", 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. can connect to the server using the same cookie.
.Sh ENVIRONMENT .Sh ENVIRONMENT
.Bl -tag -width "AUDIODEVICEXXX" -compact .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 .It Ev AUDIODEVICE
Audio device to use if the application provides Audio device to use if the application provides
no device chooser. no device chooser.