Skip to content

Commit

Permalink
dest.c: Don't look for user config in cupsGetNamedDest as root
Browse files Browse the repository at this point in the history
We were still looking into ~/.cups/lpoptions as root in the function,
which IMHO is not expected.
  • Loading branch information
zdohnal committed Oct 8, 2024
1 parent 80fe681 commit c9205f4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cups/dest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,11 @@ cupsGetNamedDest(http_t *http, // I - Connection to server or @code CUPS_HTT
else
instance = NULL;
}
#ifdef _WIN32
else if (cg->userconfig)
#else
else if (cg->userconfig && getuid() != 0)
#endif // _WIN32
{
/*
* No default in the environment, try the user's lpoptions files...
Expand Down Expand Up @@ -1805,7 +1809,11 @@ cupsGetNamedDest(http_t *http, // I - Connection to server or @code CUPS_HTT
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->sysconfig);
cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);

#ifdef _WIN32
if (cg->userconfig)
#else
if (cg->userconfig && getuid() != 0)
#endif // _WIN32
{
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->userconfig);

Expand Down

0 comments on commit c9205f4

Please sign in to comment.