summaryrefslogtreecommitdiff
path: root/scheduler/cert.c
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-01-22 22:37:41 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-01-22 22:37:41 +0000
commit5bd77a735f888a051bcc81bbb241ddac9274b059 (patch)
tree3d589f86d660d0dfae3501c8be780e56173bdf9c /scheduler/cert.c
parent91c84a3551145559de2956179661e111e373db95 (diff)
downloadcups-5bd77a735f888a051bcc81bbb241ddac9274b059.tar.gz
Merge changes from CUPS 1.4svn-r7242.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@598 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'scheduler/cert.c')
-rw-r--r--scheduler/cert.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/scheduler/cert.c b/scheduler/cert.c
index 77f23b7de..665595632 100644
--- a/scheduler/cert.c
+++ b/scheduler/cert.c
@@ -4,7 +4,7 @@
* Authentication certificate routines for the Common UNIX
* Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -42,7 +42,8 @@
void
cupsdAddCert(int pid, /* I - Process ID */
- const char *username) /* I - Username */
+ const char *username, /* I - Username */
+ void *ccache) /* I - Kerberos credentials or NULL */
{
int i; /* Looping var */
cupsd_cert_t *cert; /* Current certificate */
@@ -244,6 +245,16 @@ cupsdAddCert(int pid, /* I - Process ID */
close(fd);
/*
+ * Add Kerberos credentials as needed...
+ */
+
+#ifdef HAVE_GSSAPI
+ cert->ccache = (krb5_ccache)ccache;
+#else
+ (void)ccache;
+#endif /* HAVE_GSSAPI */
+
+ /*
* Insert the certificate at the front of the list...
*/
@@ -282,6 +293,15 @@ cupsdDeleteCert(int pid) /* I - Process ID */
else
prev->next = cert->next;
+#ifdef HAVE_GSSAPI
+ /*
+ * Release Kerberos credentials as needed...
+ */
+
+ if (cert->ccache)
+ krb5_cc_destroy(KerberosContext, cert->ccache);
+#endif /* HAVE_GSSAPI */
+
free(cert);
/*
@@ -412,7 +432,7 @@ cupsdInitCerts(void)
*/
if (!RunUser)
- cupsdAddCert(0, "root");
+ cupsdAddCert(0, "root", NULL);
}