[cups.general] JobPrivateAccess and JobPrivateValues directives

Alex Korobkin korobkin+cups at gmail.com
Tue Nov 6 09:20:43 PST 2012


I enabled debug for JobPrivate* directives and this is what I see in logs
for every job when Completed Jobs are being listed:

d [06/Nov/2012:17:06:46 +0000] cupsdGetPrivateAttrs: Returning list.

d [06/Nov/2012:17:06:46 +0000]
cupsdGetPrivateAttrs(policy=0x7f6128ad6c30(default),
con=0x7f612929e2f0(15), printer=(nil)(), owner="korobkin")
d [06/Nov/2012:17:06:46 +0000] cupsdGetPrivateAttrs: Get-Jobs

d [06/Nov/2012:17:06:46 +0000] cupsdGetPrivateAttrs: username="anonymous"

d [06/Nov/2012:17:06:46 +0000] cupsdGetPrivateAttrs: name=@OWNER

d [06/Nov/2012:17:06:46 +0000] cupsdGetPrivateAttrs: name=@cups-admins


d [06/Nov/2012:17:06:46 +0000] cupsdGetPrivateAttrs: Returning list.

Why would it think that the user is anonymous, when the user is actually
authenticated properly?

This is a snippet of code that is supposed to get the proper user name:

 /*
  * Otherwise check the user against the access list...
  */

  if (con->username[0]) {
    username = con->username;
    cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdGetPrivateAttrs:
username=\"%s\"",
                  username);
  }
  else if ((attr = ippFindAttribute(con->request, "requesting-user-name",
                                    IPP_TAG_NAME)) != NULL)
                                    {
    username = attr->values[0].string.text;
    cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdGetPrivateAttrs:
username=\"%s\"",
                  username);
    }
  else
    username = "anonymous";



On 2 November 2012 10:17, Alex Korobkin <korobkin+cups at gmail.com> wrote:

> Hi all,
>
> I cannot seem to understand how the JobPrivateAccess and JobPrivateValues
> directives actually work. My CUPS 1.5.4 Linux server authenticates users
> against LDAP, and I want it to hide print job names, displaying it only to
> job owners and cups-admins.
>
> My cupsd.conf has single policy, "default". Here is the what I specify in
> the policy:
>
> <Policy default>
>   JobPrivateAccess @OWNER @cups-admins
>   JobPrivateValues job-name
>
> However, job-name is displayed as Unknown (why not Withheld, btw?) to
> anyone, from anonymous to authenticated ones. I even modified page template
> and added this stance to be able to see how I'm authenticated to CUPS.
> <TD>{remote_user=?:You are authenticated as
> <strong>{remote_user}</strong></TD>
>
> It correctly shows my username, but never shows me any job names: neither
> my own ones, nor of everyone else.
> I tried multiple variations of JobPrivateAccess directive, including just
> "JobPrivateAccess my_username" and "JobPrivateAccess default", but I never
> see a difference between authenticated and non-authenticated users.
>
> Excerpt from the logs:
>
> D [01/Nov/2012:17:05:38 +0000] [Job 13] Loading attributes...
> d [01/Nov/2012:17:05:38 +0000] cupsdCheckGroup(username="anonymous",
> user=(nil), groupname="OWNER")
> d [01/Nov/2012:17:05:38 +0000] get_md5_password(username="anonymous",
> group="OWNER", passwd=0x7fff945d0dc0)
> d [01/Nov/2012:17:05:38 +0000] cupsdCheckGroup(username="anonymous",
> user=(nil), groupname="cups-admins")
> d [01/Nov/2012:17:05:38 +0000] get_md5_password(username="anonymous",
> group="cups-admins", passwd=0x7fff945d0dc0)
> d [01/Nov/2012:17:05:38 +0000] copy_attrs(to=0x7f3905ca7ba0,
> from=0x7f3905cb7880, ra=0x7f39055087c0, group=2, quickcopy=0)
> d [01/Nov/2012:17:05:38 +0000] copy_attribute(0x7f3905ca7ba0,
> 0x7f3905cb7990[job-originating-user-name,2,42])
> d [01/Nov/2012:17:05:38 +0000] copy_attribute(0x7f3905ca7ba0,
> 0x7f3905cb7d10[time-at-creation,2,21])
> d [01/Nov/2012:17:05:38 +0000] copy_attribute(0x7f3905ca7ba0,
> 0x7f3905cb7d50[time-at-processing,2,21])
> d [01/Nov/2012:17:05:38 +0000] copy_attribute(0x7f3905ca7ba0,
> 0x7f3905cb7d90[time-at-completed,2,21])
> d [01/Nov/2012:17:05:38 +0000] copy_attribute(0x7f3905ca7ba0,
> 0x7f3905cb7dd0[job-id,2,21])
> d [01/Nov/2012:17:05:38 +0000] copy_attribute(0x7f3905ca7ba0,
> 0x7f3905cb7e10[job-state,2,23])
> d [01/Nov/2012:17:05:38 +0000] copy_attribute(0x7f3905ca7ba0,
> 0x7f3905cb7e50[job-media-sheets-completed,2,21])
> d [01/Nov/2012:17:05:38 +0000] copy_attribute(0x7f3905ca7ba0,
> 0x7f3905cb7ed0[job-k-octets,2,21])
> d [01/Nov/2012:17:05:38 +0000] copy_attribute(0x7f3905ca7ba0,
> 0x7f3905cb7f10[job-printer-state-message,2,41])
> d [01/Nov/2012:17:05:38 +0000] get_jobs: job->id=14, dest="james-color",
> username="korobkin", state_value=9, attrs=(nil)
> D [01/Nov/2012:17:05:38 +0000] [Job 14] Loading attributes...
>
> Any advice?
> Thanks
> -Alex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cups.org/pipermail/cups/attachments/20121106/7d4e823d/attachment-0001.html>


More information about the cups mailing list