DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 19th May 2016
acampbell acampbell is offline
Real Name: Anthony Campbell
Shell Scout
 
Join Date: Sep 2014
Location: London, UK
Posts: 138
Default 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?
Reply With Quote
  #2   (View Single Post)  
Old 20th May 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Quote:
Originally Posted by acampbell View Post
Anyone else seeing this?
Yes, I can recreate this problem on amd64-current (May 9 build) with cups-2.1.3p0.
Quote:
Solutions?
lpadmin(8) may be a circumvention to using the web interface. Unfortunately I am travelling and do not have time to analyze the problem or even to test using the lpadmin() alternative. I have not seen this reported or discussed on the ports@ mailing list, either.

If no one else responds to this thread with a solution, or if it is not discussed on ports@ in the next several days, you may contact Antoine Jacoutot, the port maintainer. Antoine's Email address can be found with:

$ pkg_info cups
Reply With Quote
  #3   (View Single Post)  
Old 20th May 2016
acampbell acampbell is offline
Real Name: Anthony Campbell
Shell Scout
 
Join Date: Sep 2014
Location: London, UK
Posts: 138
Default

Thanks for your reply. I'm getting it with i386 as well. I thought of trying lpadmin and may give it a go later.
Reply With Quote
  #4   (View Single Post)  
Old 22nd May 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

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)
Reply With Quote
  #5   (View Single Post)  
Old 23rd May 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

In the event you want the patch, and copypasta doesn't work, here's a downloadable attachment of the patch.
Attached Files
File Type: patch cups.patch (1.2 KB, 48 views)
Reply With Quote
  #6   (View Single Post)  
Old 23rd May 2016
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

Antoine is faster than a speeding bullet

Quote:
Revision 1.210 / (download) - annotate - [select for diffs], Sun May 22 15:44:23 2016 UTC (10 hours, 41 minutes ago) by ajacoutot
Branch: MAIN
CVS Tags: HEAD
Changes since 1.209: +3 -3 lines
Diff to previous 1.209 (colored)

Fix authentication, needs getpwnam_shadow(3).

breakage reported by Anthony Campbell
Reply With Quote
  #7   (View Single Post)  
Old 23rd May 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

It's a more detailed fix than mine.
Reply With Quote
  #8   (View Single Post)  
Old 23rd May 2016
acampbell acampbell is offline
Real Name: Anthony Campbell
Shell Scout
 
Join Date: Sep 2014
Location: London, UK
Posts: 138
Default

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.
Reply With Quote
  #9   (View Single Post)  
Old 23rd May 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

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).
Reply With Quote
Old 23rd May 2016
acampbell acampbell is offline
Real Name: Anthony Campbell
Shell Scout
 
Join Date: Sep 2014
Location: London, UK
Posts: 138
Default

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.
Reply With Quote
Old 23rd May 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

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.
Reply With Quote
Old 23rd May 2016
acampbell acampbell is offline
Real Name: Anthony Campbell
Shell Scout
 
Join Date: Sep 2014
Location: London, UK
Posts: 138
Default

I'll certainly look into this when I have a little more time.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT. The time now is 05:05 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick