summaryrefslogtreecommitdiff
path: root/Xprint
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-05-08 02:06:46 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-05-08 02:06:46 +0000
commit0498d818fe40cb4eb03983e27a980791bbadf6db (patch)
tree5ba85a790c03718c4a273019cb47e68e6f07ba47 /Xprint
parent75d96afcc4a1f201da665bd73b7067e8e7139a3f (diff)
Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=608
("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.
Diffstat (limited to 'Xprint')
-rw-r--r--Xprint/attributes.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Xprint/attributes.c b/Xprint/attributes.c
index d02c54e37..3ad9ceca0 100644
--- a/Xprint/attributes.c
+++ b/Xprint/attributes.c
@@ -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.");
}
}
}