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 7, 2024
1 parent 80fe681 commit 15197a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cups/dest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,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)
if (cg->userconfig
#ifndef _WIN32
&& getuid() != 0
#endif // !_WIN32
)
{
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->userconfig);

Expand Down

0 comments on commit 15197a8

Please sign in to comment.