lprm : permission denied

If I login as a (normal) user I can submit jobs to a print queue (lp) and cancel jobs (lprm). However, if I su - to the same user I can submit jobs but not cancel them. If I try to cancel a job I get "Permission denied". I tried sourcing .shrc, and also exporting HOST (since that wasn't set) but to no avail. Does anyone know if it's possible to do this?

I'm using FreeBSD 8.0-RELEASE-p4.
 
wblock@ said:
Maybe it's using getuid(2) instead of geteuid(2). There could be security reasons that.
Code:
[b]fonz@spectrum% grep uid /usr/src/usr.sbin/lpr/lprm/lprm.c[/b]
uid_t	 uid, euid;		/* real and effective user id's */
	uid = getuid();
	euid = geteuid();
	[red]seteuid(uid);	/* be safe */[/red]
	if (getuid() == 0) {
		if ((p = getpwuid(getuid())) == NULL)
Fonz

Edit: Looks like a security feature indeed.
 
Back
Top