]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/auth.c
Merge changes from CUPS 1.4svn-r7485.
[thirdparty/cups.git] / scheduler / auth.c
index ed49087a8920ae03aa4b9748aefa21b7cc07adba..9516f28babfaacdef99b6083fbdc584e17cfee22 100644 (file)
@@ -114,7 +114,8 @@ static int          compare_locations(cupsd_location_t *a,
 static char            *cups_crypt(const char *pw, const char *salt);
 #endif /* !HAVE_LIBPAM && !HAVE_USERSEC_H */
 #ifdef HAVE_GSSAPI
-static gss_cred_id_t   get_gss_creds(const char *service_name);
+static gss_cred_id_t   get_gss_creds(const char *service_name,
+                                     const char *con_server_name);
 #endif /* HAVE_GSSAPI */
 static char            *get_md5_password(const char *username,
                                          const char *group, char passwd[33]);
@@ -990,7 +991,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
     * Get the server credentials...
     */
 
-    if ((server_creds = get_gss_creds(GSSServiceName)) == NULL)
+    if ((server_creds = get_gss_creds(GSSServiceName, con->servername)) == NULL)
       return;  
 
    /*
@@ -2468,7 +2469,9 @@ cups_crypt(const char *pw,                /* I - Password string */
  */
 
 static gss_cred_id_t                   /* O - Server credentials */
-get_gss_creds(const char *service_name)        /* I - Service name */
+get_gss_creds(
+    const char *service_name,          /* I - Service name */
+    const char *con_server_name)       /* I - Hostname of server */
 {
   OM_uint32    major_status,           /* Major status code */
                minor_status;           /* Minor status code */
@@ -2476,12 +2479,10 @@ get_gss_creds(const char *service_name) /* I - Service name */
   gss_cred_id_t        server_creds;           /* Server credentials */
   gss_buffer_desc token = GSS_C_EMPTY_BUFFER;
                                        /* Service name token */
-  char         buf[1024],              /* Service name buffer */
-               fqdn[HTTP_MAX_URI];     /* Hostname of server */
+  char         buf[1024];              /* Service name buffer */
 
 
-  snprintf(buf, sizeof(buf), "%s@%s", service_name,
-          httpGetHostname(NULL, fqdn, sizeof(fqdn)));
+  snprintf(buf, sizeof(buf), "%s@%s", service_name, con_server_name);
 
   token.value  = buf;
   token.length = strlen(buf);