From: mike Date: Mon, 2 May 2011 23:33:49 +0000 (+0000) Subject: Add _cupsGSSServiceName private API. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b26e4185d0ef9506af622d88546f96a61120a0f;p=thirdparty%2Fcups.git Add _cupsGSSServiceName private API. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@9734 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/cups/auth.c b/cups/auth.c index 5ab48e0531..0852c646c9 100644 --- a/cups/auth.c +++ b/cups/auth.c @@ -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) diff --git a/cups/cups-private.h b/cups/cups-private.h index 25d3fd6661..99b478320d 100644 --- a/cups/cups-private.h +++ b/cups/cups-private.h @@ -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, diff --git a/cups/usersys.c b/cups/usersys.c index 1739f4aacf..fe05e736f3 100644 --- a/cups/usersys.c +++ b/cups/usersys.c @@ -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. */