@@ -0,0 +1,59 @@
|
||||
From 4feb1fe2e5bb9f418f51f5f517f70b451159baa2 Mon Sep 17 00:00:00 2001
|
||||
From: Michael R Sweet <michael.r.sweet@gmail.com>
|
||||
Date: Mon, 16 Apr 2018 17:16:31 -0400
|
||||
Subject: [PATCH] - Added a workaround for certain web browsers that do not
|
||||
support multiple authentication schemes in a single response header (Issue
|
||||
#5289)
|
||||
|
||||
---
|
||||
scheduler/client.c | 22 +++++++++++++++++-----
|
||||
scheduler/client.h | 8 +++++---
|
||||
2 files changed, 22 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/scheduler/client.c b/scheduler/client.c
|
||||
index f388499dc..95c34877d 100644
|
||||
--- a/scheduler/client.c
|
||||
+++ b/scheduler/client.c
|
||||
@@ -813,6 +814,18 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
|
||||
|
||||
if (status == HTTP_STATUS_OK)
|
||||
{
|
||||
+ /*
|
||||
+ * Record whether the client is a web browser. "Mozilla" was the original
|
||||
+ * and it seems that every web browser in existence now uses that as the
|
||||
+ * prefix with additional information identifying *which* browser.
|
||||
+ *
|
||||
+ * Chrome (at least) has problems with multiple WWW-Authenticate values in
|
||||
+ * a single header, so we only report Basic or Negotiate to web browsers and
|
||||
+ * leave the multiple choices to the native CUPS client...
|
||||
+ */
|
||||
+
|
||||
+ con->is_browser = !strncmp(httpGetField(con->http, HTTP_FIELD_USER_AGENT), "Mozilla/", 8);
|
||||
+
|
||||
if (httpGetField(con->http, HTTP_FIELD_ACCEPT_LANGUAGE)[0])
|
||||
{
|
||||
/*
|
||||
@@ -2103,8 +2116,7 @@ cupsdSendHeader(
|
||||
strlcpy(auth_str, "Negotiate", sizeof(auth_str));
|
||||
}
|
||||
|
||||
- if (con->best && auth_type != CUPSD_AUTH_NEGOTIATE &&
|
||||
- !_cups_strcasecmp(httpGetHostname(con->http, NULL, 0), "localhost"))
|
||||
+ if (con->best && auth_type != CUPSD_AUTH_NEGOTIATE && !con->is_browser && !_cups_strcasecmp(httpGetHostname(con->http, NULL, 0), "localhost"))
|
||||
{
|
||||
/*
|
||||
* Add a "trc" (try root certification) parameter for local non-Kerberos
|
||||
diff --git a/scheduler/client.h b/scheduler/client.h
|
||||
index aaca8279a..fc7af5400 100644
|
||||
--- a/scheduler/client.h
|
||||
+++ b/scheduler/client.h
|
||||
@@ -26,6 +27,7 @@ struct cupsd_client_s
|
||||
struct timeval start; /* Request start time */
|
||||
http_state_t operation; /* Request operation */
|
||||
off_t bytes; /* Bytes transferred for this request */
|
||||
+ int is_browser; /* Is the client a web browser? */
|
||||
int type; /* AuthType for username */
|
||||
char username[HTTP_MAX_VALUE],
|
||||
/* Username from Authorization: line */
|
||||
--
|
||||
2.17.0
|
||||
@@ -0,0 +1,48 @@
|
||||
diff -up cups-2.0.2/scheduler/main.c.ustTJg cups-2.0.2/scheduler/main.c
|
||||
--- cups-2.0.2/scheduler/main.c.ustTJg 2015-02-10 13:40:24.121547526 +0100
|
||||
+++ cups-2.0.2/scheduler/main.c 2015-02-10 13:40:24.295545063 +0100
|
||||
@@ -690,8 +690,15 @@ main(int argc, /* I - Number of comm
|
||||
|
||||
#if defined(HAVE_ONDEMAND)
|
||||
if (OnDemand)
|
||||
+ {
|
||||
cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started on demand.");
|
||||
- else
|
||||
+# ifdef HAVE_SYSTEMD
|
||||
+ sd_notifyf(0, "READY=1\n"
|
||||
+ "STATUS=Scheduler is running...\n"
|
||||
+ "MAINPID=%lu",
|
||||
+ (unsigned long) getpid());
|
||||
+# endif /* HAVE_SYSTEMD */
|
||||
+ } else
|
||||
#endif /* HAVE_ONDEMAND */
|
||||
if (fg)
|
||||
cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started in foreground.");
|
||||
diff -up cups-2.0.2/scheduler/org.cups.cupsd.path.in.ustTJg cups-2.0.2/scheduler/org.cups.cupsd.path.in
|
||||
--- cups-2.0.2/scheduler/org.cups.cupsd.path.in.ustTJg 2014-03-21 15:50:24.000000000 +0100
|
||||
+++ cups-2.0.2/scheduler/org.cups.cupsd.path.in 2015-02-10 13:40:24.295545063 +0100
|
||||
@@ -2,7 +2,7 @@
|
||||
Description=CUPS Scheduler
|
||||
|
||||
[Path]
|
||||
-PathExists=@CUPS_CACHEDIR@/org.cups.cupsd
|
||||
+PathExistsGlob=@CUPS_REQUESTS@/d*
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
diff -up cups-2.0.2/scheduler/org.cups.cupsd.service.in.ustTJg cups-2.0.2/scheduler/org.cups.cupsd.service.in
|
||||
--- cups-2.0.2/scheduler/org.cups.cupsd.service.in.ustTJg 2014-10-21 13:55:01.000000000 +0200
|
||||
+++ cups-2.0.2/scheduler/org.cups.cupsd.service.in 2015-02-10 13:40:24.296545049 +0100
|
||||
@@ -1,10 +1,11 @@
|
||||
[Unit]
|
||||
Description=CUPS Scheduler
|
||||
Documentation=man:cupsd(8)
|
||||
+After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@sbindir@/cupsd -l
|
||||
-Type=simple
|
||||
+Type=notify
|
||||
|
||||
[Install]
|
||||
Also=org.cups.cupsd.socket org.cups.cupsd.path
|
||||
@@ -0,0 +1,42 @@
|
||||
diff --git a/scheduler/cups-exec.c b/scheduler/cups-exec.c
|
||||
index aab43a797..46c549075 100644
|
||||
--- a/scheduler/cups-exec.c
|
||||
+++ b/scheduler/cups-exec.c
|
||||
@@ -133,8 +133,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (setgid(gid))
|
||||
exit(errno + 100);
|
||||
|
||||
- if (setgroups(1, &gid))
|
||||
+#include <pwd.h>
|
||||
+ struct passwd * pwd = getpwuid(uid);
|
||||
+ if(initgroups(pwd->pw_name,pwd->pw_gid))
|
||||
+ {
|
||||
+ fprintf(stderr, "DEBUG: initgroups failed\n");
|
||||
exit(errno + 100);
|
||||
+ }
|
||||
|
||||
if (uid && setuid(uid))
|
||||
exit(errno + 100);
|
||||
diff --git a/scheduler/util.c b/scheduler/util.c
|
||||
index 19ebf069b..4638562bd 100644
|
||||
--- a/scheduler/util.c
|
||||
+++ b/scheduler/util.c
|
||||
@@ -300,7 +300,16 @@ cupsdPipeCommand(int *pid, /* O - Process ID or 0 on error */
|
||||
*/
|
||||
|
||||
if (!getuid() && user)
|
||||
- setuid(user); /* Run as restricted user */
|
||||
+ {
|
||||
+#include <pwd.h>
|
||||
+ struct passwd * pwd = getpwuid(user);
|
||||
+ if(initgroups(pwd->pw_name,pwd->pw_gid))
|
||||
+ {
|
||||
+ fprintf(stderr, "DEBUG: initgroups failed\n");
|
||||
+ exit(errno + 100);
|
||||
+ }
|
||||
+ setuid(user); /* Run as restricted user */
|
||||
+ }
|
||||
|
||||
if ((fd = open("/dev/null", O_RDONLY)) > 0)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
diff -up cups-2.2.5/scheduler/avahi.c.avahi-no-threaded cups-2.2.5/scheduler/avahi.c
|
||||
--- cups-2.2.5/scheduler/avahi.c.avahi-no-threaded 2017-10-17 19:03:00.760881016 +0200
|
||||
+++ cups-2.2.5/scheduler/avahi.c 2017-10-17 19:03:00.760881016 +0200
|
||||
diff -up cups-2.2.7/scheduler/avahi.c.avahi-no-threaded cups-2.2.7/scheduler/avahi.c
|
||||
--- cups-2.2.7/scheduler/avahi.c.avahi-no-threaded 2018-04-03 14:27:17.067410826 +0200
|
||||
+++ cups-2.2.7/scheduler/avahi.c 2018-04-03 14:27:17.067410826 +0200
|
||||
@@ -0,0 +1,441 @@
|
||||
+/*
|
||||
+ * "$Id$"
|
||||
@@ -443,9 +443,9 @@ diff -up cups-2.2.5/scheduler/avahi.c.avahi-no-threaded cups-2.2.5/scheduler/ava
|
||||
+/*
|
||||
+ * End of "$Id$".
|
||||
+ */
|
||||
diff -up cups-2.2.5/scheduler/avahi.h.avahi-no-threaded cups-2.2.5/scheduler/avahi.h
|
||||
--- cups-2.2.5/scheduler/avahi.h.avahi-no-threaded 2017-10-17 19:03:00.760881016 +0200
|
||||
+++ cups-2.2.5/scheduler/avahi.h 2017-10-17 19:03:00.760881016 +0200
|
||||
diff -up cups-2.2.7/scheduler/avahi.h.avahi-no-threaded cups-2.2.7/scheduler/avahi.h
|
||||
--- cups-2.2.7/scheduler/avahi.h.avahi-no-threaded 2018-04-03 14:27:17.067410826 +0200
|
||||
+++ cups-2.2.7/scheduler/avahi.h 2018-04-03 14:27:17.067410826 +0200
|
||||
@@ -0,0 +1,69 @@
|
||||
+/*
|
||||
+ * "$Id$"
|
||||
@@ -516,9 +516,9 @@ diff -up cups-2.2.5/scheduler/avahi.h.avahi-no-threaded cups-2.2.5/scheduler/ava
|
||||
+/*
|
||||
+ * End of "$Id$".
|
||||
+ */
|
||||
diff -up cups-2.2.5/scheduler/cupsd.h.avahi-no-threaded cups-2.2.5/scheduler/cupsd.h
|
||||
--- cups-2.2.5/scheduler/cupsd.h.avahi-no-threaded 2017-10-13 20:22:26.000000000 +0200
|
||||
+++ cups-2.2.5/scheduler/cupsd.h 2017-10-17 19:03:00.760881016 +0200
|
||||
diff -up cups-2.2.7/scheduler/cupsd.h.avahi-no-threaded cups-2.2.7/scheduler/cupsd.h
|
||||
--- cups-2.2.7/scheduler/cupsd.h.avahi-no-threaded 2018-03-23 04:48:36.000000000 +0100
|
||||
+++ cups-2.2.7/scheduler/cupsd.h 2018-04-03 14:27:17.067410826 +0200
|
||||
@@ -118,6 +118,7 @@ extern const char *cups_hstrerror(int);
|
||||
#include "colorman.h"
|
||||
#include "conf.h"
|
||||
@@ -570,9 +570,9 @@ diff -up cups-2.2.5/scheduler/cupsd.h.avahi-no-threaded cups-2.2.5/scheduler/cup
|
||||
+extern void cupsdRemoveTimeout (cupsd_timeout_t *timeout);
|
||||
+#endif /* HAVE_AVAHI */
|
||||
\ No newline at end of file
|
||||
diff -up cups-2.2.5/scheduler/dirsvc.c.avahi-no-threaded cups-2.2.5/scheduler/dirsvc.c
|
||||
--- cups-2.2.5/scheduler/dirsvc.c.avahi-no-threaded 2017-10-13 20:22:26.000000000 +0200
|
||||
+++ cups-2.2.5/scheduler/dirsvc.c 2017-10-17 19:05:35.938592292 +0200
|
||||
diff -up cups-2.2.7/scheduler/dirsvc.c.avahi-no-threaded cups-2.2.7/scheduler/dirsvc.c
|
||||
--- cups-2.2.7/scheduler/dirsvc.c.avahi-no-threaded 2018-03-23 04:48:36.000000000 +0100
|
||||
+++ cups-2.2.7/scheduler/dirsvc.c 2018-04-03 14:30:13.099422499 +0200
|
||||
@@ -193,7 +193,7 @@ cupsdStartBrowsing(void)
|
||||
cupsdUpdateDNSSDName();
|
||||
|
||||
@@ -613,21 +613,25 @@ diff -up cups-2.2.5/scheduler/dirsvc.c.avahi-no-threaded cups-2.2.5/scheduler/di
|
||||
|
||||
if (!DNSSDClient)
|
||||
{
|
||||
@@ -701,13 +699,7 @@ dnssdDeregisterInstance(
|
||||
@@ -701,17 +699,11 @@ dnssdDeregisterInstance(
|
||||
*srv = NULL;
|
||||
|
||||
# else /* HAVE_AVAHI */
|
||||
- if (!from_callback)
|
||||
- avahi_threaded_poll_lock(DNSSDMaster);
|
||||
-
|
||||
if (*srv)
|
||||
{
|
||||
- if (!from_callback)
|
||||
- avahi_threaded_poll_lock(DNSSDMaster);
|
||||
-
|
||||
avahi_entry_group_free(*srv);
|
||||
-
|
||||
- if (!from_callback)
|
||||
- avahi_threaded_poll_unlock(DNSSDMaster);
|
||||
*srv = NULL;
|
||||
}
|
||||
-
|
||||
- if (!from_callback)
|
||||
- avahi_threaded_poll_unlock(DNSSDMaster);
|
||||
# endif /* HAVE_DNSSD */
|
||||
}
|
||||
|
||||
@@ -1029,16 +1021,10 @@ dnssdRegisterInstance(
|
||||
@@ -1030,16 +1022,10 @@ dnssdRegisterInstance(
|
||||
(void)commit;
|
||||
|
||||
# else /* HAVE_AVAHI */
|
||||
@@ -644,7 +648,7 @@ diff -up cups-2.2.5/scheduler/dirsvc.c.avahi-no-threaded cups-2.2.5/scheduler/di
|
||||
cupsdLogMessage(CUPSD_LOG_WARN, "DNS-SD registration of \"%s\" failed: %s",
|
||||
name, dnssdErrorString(avahi_client_errno(DNSSDClient)));
|
||||
return (0);
|
||||
@@ -1153,9 +1139,6 @@ dnssdRegisterInstance(
|
||||
@@ -1154,9 +1140,6 @@ dnssdRegisterInstance(
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG, "DNS-SD commit of \"%s\" failed.",
|
||||
name);
|
||||
}
|
||||
@@ -654,7 +658,7 @@ diff -up cups-2.2.5/scheduler/dirsvc.c.avahi-no-threaded cups-2.2.5/scheduler/di
|
||||
# endif /* HAVE_DNSSD */
|
||||
|
||||
if (error)
|
||||
@@ -1326,9 +1309,6 @@ dnssdStop(void)
|
||||
@@ -1327,9 +1310,6 @@ dnssdStop(void)
|
||||
DNSSDMaster = NULL;
|
||||
|
||||
# else /* HAVE_AVAHI */
|
||||
@@ -664,7 +668,7 @@ diff -up cups-2.2.5/scheduler/dirsvc.c.avahi-no-threaded cups-2.2.5/scheduler/di
|
||||
if (DNSSDClient)
|
||||
{
|
||||
avahi_client_free(DNSSDClient);
|
||||
@@ -1337,7 +1317,7 @@ dnssdStop(void)
|
||||
@@ -1338,7 +1318,7 @@ dnssdStop(void)
|
||||
|
||||
if (DNSSDMaster)
|
||||
{
|
||||
@@ -673,9 +677,9 @@ diff -up cups-2.2.5/scheduler/dirsvc.c.avahi-no-threaded cups-2.2.5/scheduler/di
|
||||
DNSSDMaster = NULL;
|
||||
}
|
||||
# endif /* HAVE_DNSSD */
|
||||
diff -up cups-2.2.5/scheduler/dirsvc.h.avahi-no-threaded cups-2.2.5/scheduler/dirsvc.h
|
||||
--- cups-2.2.5/scheduler/dirsvc.h.avahi-no-threaded 2017-10-13 20:22:26.000000000 +0200
|
||||
+++ cups-2.2.5/scheduler/dirsvc.h 2017-10-17 19:03:00.761881007 +0200
|
||||
diff -up cups-2.2.7/scheduler/dirsvc.h.avahi-no-threaded cups-2.2.7/scheduler/dirsvc.h
|
||||
--- cups-2.2.7/scheduler/dirsvc.h.avahi-no-threaded 2018-03-23 04:48:36.000000000 +0100
|
||||
+++ cups-2.2.7/scheduler/dirsvc.h 2018-04-03 14:27:17.068410820 +0200
|
||||
@@ -49,7 +49,7 @@ VAR cups_array_t *DNSSDPrinters VALUE(NU
|
||||
VAR DNSServiceRef DNSSDMaster VALUE(NULL);
|
||||
/* Master DNS-SD service reference */
|
||||
@@ -685,9 +689,9 @@ diff -up cups-2.2.5/scheduler/dirsvc.h.avahi-no-threaded cups-2.2.5/scheduler/di
|
||||
/* Master polling interface for Avahi */
|
||||
VAR AvahiClient *DNSSDClient VALUE(NULL);
|
||||
/* Client information */
|
||||
diff -up cups-2.2.5/scheduler/main.c.avahi-no-threaded cups-2.2.5/scheduler/main.c
|
||||
--- cups-2.2.5/scheduler/main.c.avahi-no-threaded 2017-10-17 19:03:00.753881074 +0200
|
||||
+++ cups-2.2.5/scheduler/main.c 2017-10-17 19:03:00.761881007 +0200
|
||||
diff -up cups-2.2.7/scheduler/main.c.avahi-no-threaded cups-2.2.7/scheduler/main.c
|
||||
--- cups-2.2.7/scheduler/main.c.avahi-no-threaded 2018-04-03 14:27:17.057410882 +0200
|
||||
+++ cups-2.2.7/scheduler/main.c 2018-04-03 14:27:17.069410814 +0200
|
||||
@@ -131,7 +131,10 @@ main(int argc, /* I - Number of comm
|
||||
int service_idle_exit;
|
||||
/* Idle exit on select timeout? */
|
||||
@@ -763,9 +767,9 @@ diff -up cups-2.2.5/scheduler/main.c.avahi-no-threaded cups-2.2.5/scheduler/main
|
||||
/*
|
||||
* Check whether we are accepting new connections...
|
||||
*/
|
||||
diff -up cups-2.2.5/scheduler/Makefile.avahi-no-threaded cups-2.2.5/scheduler/Makefile
|
||||
--- cups-2.2.5/scheduler/Makefile.avahi-no-threaded 2017-10-13 20:22:26.000000000 +0200
|
||||
+++ cups-2.2.5/scheduler/Makefile 2017-10-17 19:03:00.762880999 +0200
|
||||
diff -up cups-2.2.7/scheduler/Makefile.avahi-no-threaded cups-2.2.7/scheduler/Makefile
|
||||
--- cups-2.2.7/scheduler/Makefile.avahi-no-threaded 2018-03-23 04:48:36.000000000 +0100
|
||||
+++ cups-2.2.7/scheduler/Makefile 2018-04-03 14:27:17.069410814 +0200
|
||||
@@ -15,6 +15,7 @@ include ../Makedefs
|
||||
|
||||
CUPSDOBJS = \
|
||||
@@ -784,9 +788,9 @@ diff -up cups-2.2.5/scheduler/Makefile.avahi-no-threaded cups-2.2.5/scheduler/Ma
|
||||
LIBOBJS = \
|
||||
filter.o \
|
||||
mime.o \
|
||||
diff -up cups-2.2.5/scheduler/timeout.c.avahi-no-threaded cups-2.2.5/scheduler/timeout.c
|
||||
--- cups-2.2.5/scheduler/timeout.c.avahi-no-threaded 2017-10-17 19:03:00.762880999 +0200
|
||||
+++ cups-2.2.5/scheduler/timeout.c 2017-10-17 19:03:00.762880999 +0200
|
||||
diff -up cups-2.2.7/scheduler/timeout.c.avahi-no-threaded cups-2.2.7/scheduler/timeout.c
|
||||
--- cups-2.2.7/scheduler/timeout.c.avahi-no-threaded 2018-04-03 14:27:17.069410814 +0200
|
||||
+++ cups-2.2.7/scheduler/timeout.c 2018-04-03 14:27:17.069410814 +0200
|
||||
@@ -0,0 +1,235 @@
|
||||
+/*
|
||||
+ * "$Id$"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
diff -up cups-1.7rc1/cgi-bin/admin.c.web-devices-timeout cups-1.7rc1/cgi-bin/admin.c
|
||||
--- cups-1.7rc1/cgi-bin/admin.c.web-devices-timeout 2013-05-29 12:51:34.000000000 +0100
|
||||
+++ cups-1.7rc1/cgi-bin/admin.c 2013-08-16 16:01:17.308264287 +0100
|
||||
@@ -1019,13 +1019,13 @@ do_am_printer(http_t *http, /* I - HTTP
|
||||
}
|
||||
|
||||
/*
|
||||
- * Scan for devices for up to 30 seconds...
|
||||
+ * Scan for devices for up to 10 seconds...
|
||||
*/
|
||||
|
||||
fputs("DEBUG: Getting list of devices...\n", stderr);
|
||||
|
||||
current_device = 0;
|
||||
- if (cupsGetDevices(http, 5, CUPS_INCLUDE_ALL, CUPS_EXCLUDE_NONE,
|
||||
+ if (cupsGetDevices(http, 10, CUPS_INCLUDE_ALL, CUPS_EXCLUDE_NONE,
|
||||
(cups_device_cb_t)choose_device_cb,
|
||||
(void *)title) == IPP_OK)
|
||||
{
|
||||
@@ -0,0 +1,182 @@
|
||||
diff -Nuar a/scheduler/auth.c b/scheduler/auth.c
|
||||
--- a/scheduler/auth.c 2018-03-23 06:48:36.000000000 +0300
|
||||
+++ b/scheduler/auth.c 2018-05-21 00:36:33.632853551 +0300
|
||||
@@ -1,17 +1,14 @@
|
||||
/*
|
||||
* Authorization routines for the CUPS scheduler.
|
||||
*
|
||||
- * Copyright 2007-2016 by Apple Inc.
|
||||
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
+ * Copyright © 2007-2018 by Apple Inc.
|
||||
+ * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* This file contains Kerberos support code, copyright 2006 by
|
||||
* Jelmer Vernooij.
|
||||
*
|
||||
- * These coded instructions, statements, and computer programs are the
|
||||
- * property of Apple Inc. and are protected by Federal copyright
|
||||
- * law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
- * which should have been included with this file. If this file is
|
||||
- * missing or damaged, see the license at "http://www.cups.org/".
|
||||
+ * Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
+ * information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -71,9 +68,6 @@
|
||||
static int compare_locations(cupsd_location_t *a,
|
||||
cupsd_location_t *b);
|
||||
static cupsd_authmask_t *copy_authmask(cupsd_authmask_t *am, void *data);
|
||||
-#if !HAVE_LIBPAM
|
||||
-static char *cups_crypt(const char *pw, const char *salt);
|
||||
-#endif /* !HAVE_LIBPAM */
|
||||
static void free_authmask(cupsd_authmask_t *am, void *data);
|
||||
#if HAVE_LIBPAM
|
||||
static int pam_func(int, const struct pam_message **,
|
||||
@@ -694,14 +688,14 @@
|
||||
* client...
|
||||
*/
|
||||
|
||||
- pass = cups_crypt(password, pw->pw_passwd);
|
||||
+ pass = crypt(password, pw->pw_passwd);
|
||||
|
||||
if (!pass || strcmp(pw->pw_passwd, pass))
|
||||
{
|
||||
# ifdef HAVE_SHADOW_H
|
||||
if (spw)
|
||||
{
|
||||
- pass = cups_crypt(password, spw->sp_pwdp);
|
||||
+ pass = crypt(password, spw->sp_pwdp);
|
||||
|
||||
if (pass == NULL || strcmp(spw->sp_pwdp, pass))
|
||||
{
|
||||
@@ -1995,129 +1989,6 @@
|
||||
}
|
||||
|
||||
|
||||
-#if !HAVE_LIBPAM
|
||||
-/*
|
||||
- * 'cups_crypt()' - Encrypt the password using the DES or MD5 algorithms,
|
||||
- * as needed.
|
||||
- */
|
||||
-
|
||||
-static char * /* O - Encrypted password */
|
||||
-cups_crypt(const char *pw, /* I - Password string */
|
||||
- const char *salt) /* I - Salt (key) string */
|
||||
-{
|
||||
- if (!strncmp(salt, "$1$", 3))
|
||||
- {
|
||||
- /*
|
||||
- * Use MD5 passwords without the benefit of PAM; this is for
|
||||
- * Slackware Linux, and the algorithm was taken from the
|
||||
- * old shadow-19990827/lib/md5crypt.c source code... :(
|
||||
- */
|
||||
-
|
||||
- int i; /* Looping var */
|
||||
- unsigned long n; /* Output number */
|
||||
- int pwlen; /* Length of password string */
|
||||
- const char *salt_end; /* End of "salt" data for MD5 */
|
||||
- char *ptr; /* Pointer into result string */
|
||||
- _cups_md5_state_t state; /* Primary MD5 state info */
|
||||
- _cups_md5_state_t state2; /* Secondary MD5 state info */
|
||||
- unsigned char digest[16]; /* MD5 digest result */
|
||||
- static char result[120]; /* Final password string */
|
||||
-
|
||||
-
|
||||
- /*
|
||||
- * Get the salt data between dollar signs, e.g. $1$saltdata$md5.
|
||||
- * Get a maximum of 8 characters of salt data after $1$...
|
||||
- */
|
||||
-
|
||||
- for (salt_end = salt + 3; *salt_end && (salt_end - salt) < 11; salt_end ++)
|
||||
- if (*salt_end == '$')
|
||||
- break;
|
||||
-
|
||||
- /*
|
||||
- * Compute the MD5 sum we need...
|
||||
- */
|
||||
-
|
||||
- pwlen = strlen(pw);
|
||||
-
|
||||
- _cupsMD5Init(&state);
|
||||
- _cupsMD5Append(&state, (unsigned char *)pw, pwlen);
|
||||
- _cupsMD5Append(&state, (unsigned char *)salt, salt_end - salt);
|
||||
-
|
||||
- _cupsMD5Init(&state2);
|
||||
- _cupsMD5Append(&state2, (unsigned char *)pw, pwlen);
|
||||
- _cupsMD5Append(&state2, (unsigned char *)salt + 3, salt_end - salt - 3);
|
||||
- _cupsMD5Append(&state2, (unsigned char *)pw, pwlen);
|
||||
- _cupsMD5Finish(&state2, digest);
|
||||
-
|
||||
- for (i = pwlen; i > 0; i -= 16)
|
||||
- _cupsMD5Append(&state, digest, i > 16 ? 16 : i);
|
||||
-
|
||||
- for (i = pwlen; i > 0; i >>= 1)
|
||||
- _cupsMD5Append(&state, (unsigned char *)((i & 1) ? "" : pw), 1);
|
||||
-
|
||||
- _cupsMD5Finish(&state, digest);
|
||||
-
|
||||
- for (i = 0; i < 1000; i ++)
|
||||
- {
|
||||
- _cupsMD5Init(&state);
|
||||
-
|
||||
- if (i & 1)
|
||||
- _cupsMD5Append(&state, (unsigned char *)pw, pwlen);
|
||||
- else
|
||||
- _cupsMD5Append(&state, digest, 16);
|
||||
-
|
||||
- if (i % 3)
|
||||
- _cupsMD5Append(&state, (unsigned char *)salt + 3, salt_end - salt - 3);
|
||||
-
|
||||
- if (i % 7)
|
||||
- _cupsMD5Append(&state, (unsigned char *)pw, pwlen);
|
||||
-
|
||||
- if (i & 1)
|
||||
- _cupsMD5Append(&state, digest, 16);
|
||||
- else
|
||||
- _cupsMD5Append(&state, (unsigned char *)pw, pwlen);
|
||||
-
|
||||
- _cupsMD5Finish(&state, digest);
|
||||
- }
|
||||
-
|
||||
- /*
|
||||
- * Copy the final sum to the result string and return...
|
||||
- */
|
||||
-
|
||||
- memcpy(result, salt, (size_t)(salt_end - salt));
|
||||
- ptr = result + (salt_end - salt);
|
||||
- *ptr++ = '$';
|
||||
-
|
||||
- for (i = 0; i < 5; i ++, ptr += 4)
|
||||
- {
|
||||
- n = ((((unsigned)digest[i] << 8) | (unsigned)digest[i + 6]) << 8);
|
||||
-
|
||||
- if (i < 4)
|
||||
- n |= (unsigned)digest[i + 12];
|
||||
- else
|
||||
- n |= (unsigned)digest[5];
|
||||
-
|
||||
- to64(ptr, n, 4);
|
||||
- }
|
||||
-
|
||||
- to64(ptr, (unsigned)digest[11], 2);
|
||||
- ptr += 2;
|
||||
- *ptr = '\0';
|
||||
-
|
||||
- return (result);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- /*
|
||||
- * Use the standard crypt() function...
|
||||
- */
|
||||
-
|
||||
- return (crypt(pw, salt));
|
||||
- }
|
||||
-}
|
||||
-#endif /* !HAVE_LIBPAM */
|
||||
-
|
||||
-
|
||||
/*
|
||||
* 'free_authmask()' - Free function for auth masks.
|
||||
*/
|
||||
@@ -12,7 +12,7 @@
|
||||
<IsA>service</IsA>
|
||||
<Summary>Common Unix Printing System</Summary>
|
||||
<Description>cups provides a portable printing layer for *nix-based operating systems.</Description>
|
||||
<Archive sha1sum="b5e3389fb9450bfed377c95c0230c029c053acc4" type="targz">https://github.com/apple/cups/releases/download/v2.2.6/cups-2.2.6-source.tar.gz</Archive>
|
||||
<Archive sha1sum="aa2ae7c486d5957c9fc5f00aec63e453b19311b4" type="targz">https://github.com/apple/cups/releases/download/v2.2.7/cups-2.2.7-source.tar.gz</Archive>
|
||||
<!-- <Archive sha1sum="062beea95c6f8dda0a5e7eed51604e22806ffad3" type="tar" target="cups-2.2.3">http://source.pisilinux.org/1.0/cups-tr.tar</Archive> --> -->
|
||||
<BuildDependencies>
|
||||
<Dependency>acl-devel</Dependency>
|
||||
@@ -35,6 +35,8 @@
|
||||
<!-- ARCH Linux patches -->
|
||||
<Patch level="1">archlinux/cups-no-export-ssllibs.patch</Patch>
|
||||
<Patch level="1">archlinux/cups-no-gzip-man.patch</Patch>
|
||||
<Patch level="1">archlinux/auth-workaround-for-certain-web-browsers.patch</Patch>
|
||||
<Patch level="1">archlinux/guid.patch</Patch>
|
||||
|
||||
<!-- Fedora patches -->
|
||||
<Patch level="1">fedora/cups-final-content-type.patch</Patch>
|
||||
@@ -42,6 +44,7 @@
|
||||
<Patch level="1">fedora/cups-hp-deviceid-oid.patch</Patch>
|
||||
<Patch level="1">fedora/cups-logrotate.patch</Patch>
|
||||
<Patch level="1">fedora/cups-avahi-no-threaded.patch</Patch>
|
||||
<Patch level="1">fedora/cups-web-devices-timeout.patch</Patch>
|
||||
|
||||
<!-- Gentoo patches -->
|
||||
<Patch>gentoo/cups-2.2.6-fix-install-perms.patch</Patch>
|
||||
@@ -53,6 +56,7 @@
|
||||
<Patch level="1">pisilinux/lib64.patch</Patch>
|
||||
<Patch level="1">pisilinux/statedir.patch</Patch>
|
||||
<Patch level="1">pisilinux/desktop.patch</Patch>
|
||||
<Patch level="1">pisilinux/auth.patch</Patch>
|
||||
|
||||
<!-- Pld-linux patches -->
|
||||
<Patch>pld-linux/cups-avahi-address.patch</Patch>
|
||||
@@ -142,6 +146,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="7">
|
||||
<Date>2017-12-13</Date>
|
||||
<Version>2.2.7</Version>
|
||||
<Comment>Version bump</Comment>
|
||||
<Name>Mustafa Cinasal</Name>
|
||||
<Email>muscnsl@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="6">
|
||||
<Date>2017-12-13</Date>
|
||||
<Version>2.2.6</Version>
|
||||
|
||||
Reference in New Issue
Block a user