Skip to content

Commit

Permalink
Apply feedback+cover another case
Browse files Browse the repository at this point in the history
  • Loading branch information
zdohnal committed Oct 8, 2024
1 parent 15197a8 commit 41044e2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 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,11 +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);

if (cg->userconfig
#ifndef _WIN32
&& getuid() != 0
#endif // !_WIN32
)
#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 41044e2

Please sign in to comment.