|
OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD. |
|
Thread Tools | Display Modes |
|
|||
Is Cups broken in -current?
I'm trying to connect a printer using Cups from -current ( 18 May). I can bring up the web page for Cups but if I try to go into printer admin I am repeatedly asked for my username and password. Neither root nor user is accepted.
I've tried with firefox, chromium, and iridieum. Following a suggestion I found on the net I tried adding localhost to the "Restrict access to the admin page" section of /etc/cups/cupsd.conf but no success. I then tried removing Cups altogether and reinstalling but the same thing happens. Anyone else seeing this? Solutions? |
|
|||
Thanks for your reply. I'm getting it with i386 as well. I thought of trying lpadmin and may give it a go later.
|
|
||||
Well, I'm now home, and spent some time figuring out the root cause. It was a change to libc, which has effected multiple packages that used getpwnam(3) and now need to use getpwnam_shadow(3) instead. I'm sending the patch to Antoine, and replicated it below, in the event you'd like to try it.
This is a patch against the -current /usr/ports/print/cups structure. It adds a revision bump to the Makefile and a patch against the Cups source module scheduler/auth.c. Code:
Index: Makefile =================================================================== RCS file: /systems/cvs/ports/print/cups/Makefile,v retrieving revision 1.209 diff -u -p -r1.209 Makefile --- Makefile 12 Apr 2016 06:45:36 -0000 1.209 +++ Makefile 22 May 2016 23:14:04 -0000 @@ -10,7 +10,7 @@ EXTRACT_SUFX= .tar.bz2 PKGNAME-main= cups-${VERSION} PKGNAME-libs= cups-libs-${VERSION} -REVISION-main= 0 +REVISION-main= 1 REVISION-libs= 0 CATEGORIES= print sysutils Index: patches/patch-scheduler_auth_c =================================================================== RCS file: patches/patch-scheduler_auth_c diff -N patches/patch-scheduler_auth_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-scheduler_auth_c 22 May 2016 23:08:43 -0000 @@ -0,0 +1,15 @@ +$OpenBSD$ + +Obtain encrypted password. See getpwnam_shadow(3) + +--- scheduler/auth.c.orig Sun May 22 19:05:35 2016 ++++ scheduler/auth.c Sun May 22 19:05:56 2016 +@@ -651,7 +651,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client conn + # endif /* HAVE_SHADOW_H */ + + +- pw = getpwnam(username); /* Get the current password */ ++ pw = getpwnam_shadow(username); /* Get the current password */ + endpwent(); /* Close the password file */ + + if (!pw) |
|
|||
Antoine is faster than a speeding bullet
Quote:
|
|
|||
I'm not sure how to apply a patch to a package, so I'll wait until it is updated in packages. In the meantime the problem affected me when I was setting up a new desktop, so I started from 5.9 release, installed cups, and then updated things to -current.
|
|
||||
You don't apply it to the package, you apply it to the port that is used to build the package.
Patches to anything on OpenBSD are in the form of unified diff(1) files, which are fairly easy to read.* Lines that begin with a "+" are added, lines that begin with "-" are removed, and the lines that begin with " " are shown for context. * Except for patches to ports which include patches to patch files, because these are applied to files which are themselves unified diff() files. Antoine's patch (or mine, above) both added a complete patch file to the port, which then gets applied to the cups source each time the package is built.We use patch(1) to apply patches. I will typically run patch() with the -C option to test the patch first, because white space alignment may have been broken in transmission (Email or in copy/paste). |
|
|||
Yes, that makes sense - I should have said port. But I haven't used cvs and I think this is a task for another day - I don't know where to find the patch.
|
|
||||
Antoine's patch was committed to the ports repository. It could be applied to one's working directory (/usr/ports) via cvs update, or when one creates a brand new -current working directory via cvs checkout. You could also recreate the patch file with cvs diff for review or manual application, if desired.
As you've noted, you will wait for the snapshot package to be built and distributed to your local mirror. I always recommend that -current users become familiar with diff() and patch() which are used throughout the open source world, but also the use of cvs(1). OpenBSD is source code maintained, and if you ever report a problem the fix will come to you in the form of a source code patch. You'll need this knowledge to apply the patch before you can build/install the affected module. But there are other benefits, too. Not only to apply patches without having to wait for the next snapshot or snapshot package distributions, but to be able to participate with developers in testing new features, or to follow the ports@ mailing list and test new versions of ports as they are being developed. This last is a fairly easy way for us end users to give back to the greater community. To aid us in testing, the FAQ includes a Port Testing Guide. |
|
|||
I'll certainly look into this when I have a little more time.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cups? | amandus | FreeBSD General | 2 | 29th June 2013 08:39 PM |
Cups , authentication issue | welkin | FreeBSD Installation and Upgrading | 2 | 7th March 2010 01:03 AM |
darn cUPS | da1 | FreeBSD General | 0 | 18th February 2009 07:15 PM |
Cups + USB-Printer | nihonto | OpenBSD Packages and Ports | 3 | 21st May 2008 07:49 PM |
FreeBSD+CUPS+Samba | faustcoder | FreeBSD General | 6 | 20th May 2008 12:20 AM |