("Can not print on Debian/CUPS due to error |Xprt_64:lpr: unable to
    print file: server-error-not-accepting-jobs|"): Xprt did not setup the
    list of supplementary group ids, causing print failure when the the
    calling user must be a member in a specific group to be allowed to
    print.
This commit is contained in:
Roland Mainz 2004-05-08 02:06:46 +00:00
parent 75d96afcc4
commit 0498d818fe

View File

@ -1170,7 +1170,14 @@ SendFileToCommand(
if((pPasswd = getpwnam(userName)))
{
setuid((uid_t)pPasswd->pw_uid);
if (setgid((gid_t)pPasswd->pw_gid) != 0)
perror("SendFileToCommand: setgid() failure.");
if (initgroups(userName, (gid_t)pPasswd->pw_gid) != 0)
perror("SendFileToCommand: initgroups() failure.");
if (setuid((uid_t)pPasswd->pw_uid) != 0)
perror("SendFileToCommand: setuid() failure.");
}
}
}