]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
negotiate_kerberos_auth update to version 3.0.4sq
authorMarkus Moeller <huaraz@moeller.plus.com>
Mon, 14 Mar 2011 06:15:51 +0000 (00:15 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 14 Mar 2011 06:15:51 +0000 (00:15 -0600)
Fixes a minor error in printing gss errors

helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.8
helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc
helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc

index 69913b913092b03ad34659b75a6ed946949729ca..66de16374ea069bab45ca657e9a9b45fe193cbbf 100644 (file)
@@ -5,7 +5,7 @@
 .if !'po4a'hide' \-
 Squid kerberos based authentication helper
 .PP
-Version 3.0.3sq
+Version 3.0.4sq
 .
 .SH SYNOPSIS
 .if !'po4a'hide' .B negotiate_kerberos_auth
@@ -37,7 +37,7 @@ Provide Service Principal Name.
 .PP See FAQ wiki page for examples of how to write configuration snippets. (TBD)
 .PP 
 This helper is intended to be used as an
-.B external_acl_type
+.B authentication
 helper in
 .B squid.conf.
 .if !'po4a'hide' .P
index 9631d5f841f65e190fd3a2f9fb1252a2d5173565..c57734924f55babf59ffbf67de906969560c17bb 100644 (file)
@@ -82,7 +82,7 @@
 #define MAX_AUTHTOKEN_LEN   65535
 #endif
 #ifndef SQUID_KERB_AUTH_VERSION
-#define SQUID_KERB_AUTH_VERSION "3.0.3sq"
+#define SQUID_KERB_AUTH_VERSION "3.0.4sq"
 #endif
 
 int check_gss_err(OM_uint32 major_status, OM_uint32 minor_status,
@@ -165,39 +165,37 @@ check_gss_err(OM_uint32 major_status, OM_uint32 minor_status,
 
         len = 0;
         msg_ctx = 0;
-        while (!msg_ctx) {
+        do {
             /* convert major status code (GSS-API error) to text */
             maj_stat = gss_display_status(&min_stat, major_status,
                                           GSS_C_GSS_CODE, GSS_C_NULL_OID, &msg_ctx, &status_string);
-            if (maj_stat == GSS_S_COMPLETE) {
+            if (maj_stat == GSS_S_COMPLETE && status_string.length > 0) {
                 if (sizeof(buf) > len + status_string.length + 1) {
                     snprintf(buf + len, (sizeof(buf) - len), "%s", (char *) status_string.value);
                     len += status_string.length;
                 }
-                gss_release_buffer(&min_stat, &status_string);
-                break;
-            }
+            } else
+                msg_ctx = 0;
             gss_release_buffer(&min_stat, &status_string);
-        }
+        } while (msg_ctx);
         if (sizeof(buf) > len + 2) {
             snprintf(buf + len, (sizeof(buf) - len), "%s", ". ");
             len += 2;
         }
         msg_ctx = 0;
-        while (!msg_ctx) {
+        do {
             /* convert minor status code (underlying routine error) to text */
             maj_stat = gss_display_status(&min_stat, minor_status,
                                           GSS_C_MECH_CODE, GSS_C_NULL_OID, &msg_ctx, &status_string);
-            if (maj_stat == GSS_S_COMPLETE) {
+            if (maj_stat == GSS_S_COMPLETE && status_string.length > 0) {
                 if (sizeof(buf) > len + status_string.length) {
                     snprintf(buf + len, (sizeof(buf) - len), "%s", (char *) status_string.value);
                     len += status_string.length;
                 }
-                gss_release_buffer(&min_stat, &status_string);
-                break;
-            }
+            } else
+                msg_ctx = 0;
             gss_release_buffer(&min_stat, &status_string);
-        }
+        } while (msg_ctx);
         debug((char *) "%s| %s: ERROR: %s failed: %s\n", LogTime(), PROGRAM, function, buf);
         fprintf(stdout, "BH %s failed: %s\n", function, buf);
         if (log)
index afa2712e690fa1d3e19251bedcdb43cfedba14fe..0c13ec7eed53590e4c7a1cc7a10e80a5218cab21 100644 (file)
@@ -117,39 +117,37 @@ check_gss_err(OM_uint32 major_status, OM_uint32 minor_status,
 
         len = 0;
         msg_ctx = 0;
-        while (!msg_ctx) {
+        do {
             /* convert major status code (GSS-API error) to text */
             maj_stat = gss_display_status(&min_stat, major_status,
                                           GSS_C_GSS_CODE, GSS_C_NULL_OID, &msg_ctx, &status_string);
-            if (maj_stat == GSS_S_COMPLETE) {
+            if (maj_stat == GSS_S_COMPLETE && status_string.length > 0) {
                 if (sizeof(buf) > len + status_string.length + 1) {
                     snprintf(buf + len, (sizeof(buf) - len), "%s", (char *) status_string.value);
                     len += status_string.length;
                 }
-                gss_release_buffer(&min_stat, &status_string);
-                break;
-            }
+            } else
+                msg_ctx = 0;
             gss_release_buffer(&min_stat, &status_string);
-        }
+        } while (msg_ctx);
         if (sizeof(buf) > len + 2) {
             snprintf(buf + len, (sizeof(buf) - len), "%s", ". ");
             len += 2;
         }
         msg_ctx = 0;
-        while (!msg_ctx) {
+        do {
             /* convert minor status code (underlying routine error) to text */
             maj_stat = gss_display_status(&min_stat, minor_status,
                                           GSS_C_MECH_CODE, GSS_C_NULL_OID, &msg_ctx, &status_string);
-            if (maj_stat == GSS_S_COMPLETE) {
+            if (maj_stat == GSS_S_COMPLETE && status_string.length > 0) {
                 if (sizeof(buf) > len + status_string.length) {
                     snprintf(buf + len, (sizeof(buf) - len), "%s", (char *) status_string.value);
                     len += status_string.length;
                 }
-                gss_release_buffer(&min_stat, &status_string);
-                break;
-            }
+            } else
+                msg_ctx = 0;
             gss_release_buffer(&min_stat, &status_string);
-        }
+        } while (msg_ctx);
         fprintf(stderr, "%s| %s: %s failed: %s\n", LogTime(), PROGRAM, function,
                 buf);
         return (1);