]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add _cupsGSSServiceName private API.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 2 May 2011 23:33:49 +0000 (23:33 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 2 May 2011 23:33:49 +0000 (23:33 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@9734 7a7537e8-13f0-0310-91df-b6672ffda945

cups/auth.c
cups/cups-private.h
cups/usersys.c

index 5ab48e0531f85124df2c41b15efa97b8b6a62600..0852c646c9cdd1e8df10589847e3ebf180dbfb12 100644 (file)
@@ -301,7 +301,6 @@ _cupsSetNegotiateAuthString(
                major_status;           /* Major status code */
   gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER;
                                        /* Output token */
-  _cups_globals_t *cg = _cupsGlobals();        /* Thread globals */
 
 
 #  ifdef __APPLE__
@@ -320,10 +319,7 @@ _cupsSetNegotiateAuthString(
 
   if (http->gssname == GSS_C_NO_NAME)
   {
-    if (!cg->gss_service_name[0])
-      _cupsSetDefaults();
-
-    http->gssname = cups_gss_getname(http, cg->gss_service_name);
+    http->gssname = cups_gss_getname(http, _cupsGSSServiceName());
   }
 
   if (http->gssctx != GSS_C_NO_CONTEXT)
index 25d3fd66613738f9b6d7b6a56393925f2e605cbb..99b478320d466e90c9766bb4212943a20bdc6ee2 100644 (file)
@@ -183,6 +183,9 @@ extern const char   *_cupsGetPassword(const char *prompt);
 extern void            _cupsGlobalLock(void);
 extern _cups_globals_t *_cupsGlobals(void);
 extern void            _cupsGlobalUnlock(void);
+#  ifdef HAVE_GSSAPI
+extern const char      *_cupsGSSServiceName(void);
+#  endif /* HAVE_GSSAPI */
 extern int             _cupsNextDelay(int current, int *previous);
 extern void            _cupsSetDefaults(void);
 extern void            _cupsSetError(ipp_status_t status, const char *message,
index 1739f4aacfbd36fb8e4d834604661a770f343420..fe05e736f37c50a614ffc870e74c0287f0b3f516 100644 (file)
@@ -31,6 +31,7 @@
  *   cupsSetUser()           - Set the default user name.
  *   cupsUser()              - Return the current user's name.
  *   _cupsGetPassword()      - Get a password from the user.
+ *   _cupsGSSServiceName()   - Get the GSS (Kerberos) service name.
  *   _cupsSetDefaults()      - Set the default server, port, and encryption.
  *   cups_read_client_conf() - Read a client.conf file.
  */
@@ -511,6 +512,23 @@ _cupsGetPassword(const char *prompt)       /* I - Prompt string */
 }
 
 
+/*
+ * '_cupsGSSServiceName()' - Get the GSS (Kerberos) service name.
+ */
+
+const char *
+_cupsGSSServiceName(void)
+{
+  _cups_globals_t *cg = _cupsGlobals();        /* Thread globals */
+
+
+  if (!cg->gss_service_name[0])
+    _cupsSetDefaults();
+
+  return (cg->gss_service_name);
+}
+
+
 /*
  * '_cupsSetDefaults()' - Set the default server, port, and encryption.
  */