Handle authentication

Daniel Nicoletti dantti85-pk at yahoo.com.br
Mon Feb 8 08:50:43 PST 2010


> On Feb 4, 2010, at 10:57 AM, Daniel Nicoletti wrote:
> > Hi,
> > I'm writing a GUI for cups (KDE4),
> > I used the cups API to get dests and jobs,
> > and my queue is working nicely, but
> > there is one thing that is not working well
> > it's authentication.
> > Even if i set the callback funcion if I try
> > to remove a job from another user or pause the
> > printer i get FORBIDEN 403, and the callback
> > function is not called.
> > I niticed that if I run this app and setUser("root")
> > it calls the callback and I can authenticate as root,
> > but this seems to be wrong since the prompt message
> > shows "password for root?", in linux this is not actually
> > a problem since root is root, but if my client.conf
> > points to a mac machine it's "Mac Admin" iirc.
> >=20
> > To resume, what is the right way to do this?
>
>
> OK, so currently the best way is to try with the current username and =
> then if that fails with a forbidden error try with user "root" which =
> works on Mac OS X as well - any user in the system group ("admin" on Mac =
> OS X, other groups on Linux) will be able to authenticate.
>
> UI-wise I'd just not fill-in the username and use your own prompt string =
> with your password dialog. The callback can set the current username as =
> needed...
>
> ___________________________________________________
> Michael Sweet, Senior Printing System Engineer
>
>
>
Hey thanks,
It's working quite well now, except that I think
I found a bug in cups.
When I try to cancel a job that is not
mine the dialog pops up (since the option to cancel others
users jobs is disabled), if i put invalid
users or my unprivileged user the job is not canceled,
I get 403...
But if i type root with NO PASSWORD(my root user does have a pass),
the auth fails but on next try I can cancel the job,
this does not happens if I try to pause the printer..
, this happens
only when I try to cancel a job.
What happens is that





More information about the cups-devel mailing list