CHANGES IN CUPS V1.1.19
+ - The lpadmin command now allows printer access control
+ by group name as well as user name.
- "lpoptions -l" got in an infinite loop if no default
printer was available.
- The scheduler now logs the job-originating-host-name
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2003, All Rights Reserved">
- <META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.1.18">
+ <META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.1.19">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Administrators Manual</TITLE>
</HEAD>
<P>This software administrators manual provides printer administration
information for the Common UNIX Printing System<SUP>TM</SUP>
-("CUPS<SUP>TM</SUP>"), version 1.1.18.
+("CUPS<SUP>TM</SUP>"), version 1.1.19.
<EMBED SRC="system-overview.shtml">
<P>has the opposite effect. All users except peter, paul, and mary will
be able to print to the named printer.</P>
+<P>You can control access by UNIX groups as well by placing an
+"@" character before each group name. The command:</P>
+
+<UL>
+<PRE>
+<B>/usr/sbin/lpadmin -p <I>printer</I> -u allow:peter,paul,mary,@printgods <I>ENTER</I></B>
+</PRE>
+</UL>
+
+<P>allows the users peter, paul, and mary to print, as well as
+any user in the printgods group to print.
+
<CENTER>
<TABLE BGCOLOR="#cccccc" BORDER="1" CELLPADDING="5" WIDTH="80%">
<TR>
.\"
-.\" "$Id: lpadmin.man,v 1.10 2003/01/31 20:09:23 mike Exp $"
+.\" "$Id: lpadmin.man,v 1.11 2003/03/04 21:41:39 mike Exp $"
.\"
.\" lpadmin man page for the Common UNIX Printing System (CUPS).
.\"
Removes the named \fIprinter\fR from \fIclass\fR. If the resulting class
becomes empty it is removed.
.TP 5
-\-u \fIallow:user,user\fR
-\-u \fIdeny:user,user\fR
+\-u \fIallow:user,user,@group\fR
+\-u \fIdeny:user,user,@group\fR
\-u \fIallow:all\fR
\-u \fIdeny:none\fR
.br
-Sets user-level access control on a printer. The latter two forms turn
+Sets user-level access control on a printer. Names starting with
+"@" are interpreted as UNIX groups. The latter two forms turn
user-level access control off.
.TP 5
\-v \fIdevice-uri\fR
.SH COPYRIGHT
Copyright 1993-2003 by Easy Software Products, All Rights Reserved.
.\"
-.\" End of "$Id: lpadmin.man,v 1.10 2003/01/31 20:09:23 mike Exp $".
+.\" End of "$Id: lpadmin.man,v 1.11 2003/03/04 21:41:39 mike Exp $".
.\"
/*
- * "$Id: ipp.c,v 1.189 2003/02/26 19:49:24 mike Exp $"
+ * "$Id: ipp.c,v 1.190 2003/03/04 21:41:40 mike Exp $"
*
* IPP routines for the Common UNIX Printing System (CUPS) scheduler.
*
check_quotas(client_t *con, /* I - Client connection */
printer_t *p) /* I - Printer or class */
{
- int i; /* Looping var */
+ int i, j; /* Looping vars */
ipp_attribute_t *attr; /* Current attribute */
char username[33]; /* Username */
quota_t *q; /* Quota data */
+ struct passwd *pw; /* User password data */
+ struct group *grp; /* Group data */
LogMessage(L_DEBUG2, "check_quotas(%p[%d], %p[%s])\n",
if (p->num_users)
{
+ pw = getpwnam(username);
+ endpwent();
+
for (i = 0; i < p->num_users; i ++)
- if (strcasecmp(username, p->users[i]) == 0)
+ if (p->users[i][0] == '@')
+ {
+ /*
+ * Check group membership...
+ */
+
+ grp = getgrnam(p->users[i] + 1);
+ endgrent();
+
+ if (grp)
+ {
+ /*
+ * Check primary group...
+ */
+
+ if (pw && grp->gr_gid == pw->pw_gid)
+ break;
+
+ /*
+ * Check usernames in group...
+ */
+
+ for (j = 0; grp->gr_mem[j]; j ++)
+ if (!strcmp(username, grp->gr_mem[j]))
+ break;
+
+ if (grp->gr_mem[j])
+ break;
+ }
+ }
+ else if (!strcasecmp(username, p->users[i]))
break;
if ((i < p->num_users) == p->deny_users)
/*
- * End of "$Id: ipp.c,v 1.189 2003/02/26 19:49:24 mike Exp $".
+ * End of "$Id: ipp.c,v 1.190 2003/03/04 21:41:40 mike Exp $".
*/