]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cgi-bin/admin.c
Merge CUPS 1.4svn-r7319.
[thirdparty/cups.git] / cgi-bin / admin.c
index 0a981d231841b671a155c0784ed66e4d24753618..6fa500d71c83b8f15b464b0fc9fb3aee40a60e5b 100644 (file)
@@ -1370,12 +1370,12 @@ do_config_server(http_t *http)          /* I - HTTP connection */
                        *remote_printers,
                                        /* REMOTE_PRINTERS value */
                        *share_printers,/* SHARE_PRINTERS value */
+                       *user_cancel_any;
+                                       /* USER_CANCEL_ANY value */
 #ifdef HAVE_GSSAPI
-                       *default_auth_type,
+    char               default_auth_type[255];
                                        /* DefaultAuthType value */
 #endif /* HAVE_GSSAPI */
-                       *user_cancel_any;
-                                       /* USER_CANCEL_ANY value */
 
 
    /*
@@ -1410,13 +1410,16 @@ do_config_server(http_t *http)          /* I - HTTP connection */
     */
 
     if (cgiGetVariable("KERBEROS"))
-      default_auth_type = "Negotiate";
+      strlcpy(default_auth_type, "Negotiate", sizeof(default_auth_type));
     else
     {
-      default_auth_type = cupsGetOption("DefaultAuthType", num_settings,
-                                        settings);
-      if (!strcasecmp(default_auth_type, "Negotiate"))
-        default_auth_type = "Basic";
+      const char *val = cupsGetOption("DefaultAuthType", num_settings,
+                                      settings);
+
+      if (val && !strcasecmp(val, "Negotiate"))
+        strlcpy(default_auth_type, "Basic", sizeof(default_auth_type));
+      else
+        strlcpy(default_auth_type, val, sizeof(default_auth_type));
     }
 
     fprintf(stderr, "DEBUG: DefaultAuthType %s\n", default_auth_type);