Whitespace
authorGreg Hudson <ghudson@mit.edu>
Wed, 21 Sep 2011 22:29:25 +0000 (22:29 +0000)
committerGreg Hudson <ghudson@mit.edu>
Wed, 21 Sep 2011 22:29:25 +0000 (22:29 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25224 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/generic/gssapi_ext.h
src/lib/gssapi/mechglue/gssd_pname_to_uid.c
src/lib/gssapi/mechglue/mglueP.h

index 07f0c688eee7870902c656234ada22fb2e0bf666..8fdb567fcee517f38e934ea1d9fcd369233b3320 100644 (file)
@@ -43,23 +43,24 @@ gss_pname_to_uid
         uid_t *uidOut);
 #endif
 
-  /**
-   * Provides a platform-specific name for a GSSAPI name as
-   * interpreted by a given mechanism
-   * @param name The gss name resulting from accept_sec_context
-   * @param mech_type The mechanism that will be asked to map @a name to a local name
-   * @param localname pointer to a buffer_desc allocated by the caller
-   * that will be filled in with the local name on successful completion.
-   */
+/**
+ * Provides a platform-specific name for a GSSAPI name as interpreted by a
+ * given mechanism.
+ *
+ * @param name       The gss name resulting from accept_sec_context
+ * @param mech_type  The mechanism that will be asked to map @a name to a
+ *                   local name
+ * @param localname  Pointer to a buffer_desc allocated by the caller
+ *                   that will be filled in with the local name on successful
+ *                   completion.
+ */
 OM_uint32 KRB5_CALLCONV
 gss_localname
        (OM_uint32 *minor,
-         const gss_name_t name,
+        const gss_name_t name,
         gss_const_OID mech_type,
         gss_buffer_t localname);
 
-
-
 /** Determine whether a mechanism name is authorized to act as a username.
  *
  * @param [in] name      Mechanism name
index 23e2cf931f44692cba40c4d78e1b31c7d7b7aab5..eab6bd6f58e5c3b7a016ab8723ae2d0a6ac99e54 100644 (file)
 
 static OM_uint32
 attr_localname(OM_uint32 *minor,
-                  const gss_mechanism mech,
-                  const gss_name_t mech_name,
-              gss_buffer_t localname)
+               const gss_mechanism mech,
+               const gss_name_t mech_name,
+               gss_buffer_t localname)
 {
     OM_uint32 major = GSS_S_UNAVAILABLE;
     OM_uint32 tmpMinor;
     int more = -1;
     gss_buffer_desc value;
-           gss_buffer_desc display_value;
-           int authenticated = 0, complete = 0;
+    gss_buffer_desc display_value;
+    int authenticated = 0, complete = 0;
 
-           value.value = NULL;
-           display_value.value = NULL;
+    value.value = NULL;
+    display_value.value = NULL;
     if (mech->gss_get_name_attribute == NULL)
         return GSS_S_UNAVAILABLE;
 
-        major = mech->gss_get_name_attribute(minor,
-                                             mech_name,
-                                             GSS_C_ATTR_LOCAL_LOGIN_USER,
-                                             &authenticated,
-                                             &complete,
-                                             &value,
-                                             &display_value,
-                                             &more);
-        if (GSS_ERROR(major)) {
-            map_error(minor, mech);
-           goto cleanup;
-        }
+    major = mech->gss_get_name_attribute(minor,
+                                         mech_name,
+                                         GSS_C_ATTR_LOCAL_LOGIN_USER,
+                                         &authenticated,
+                                         &complete,
+                                         &value,
+                                         &display_value,
+                                         &more);
+    if (GSS_ERROR(major)) {
+        map_error(minor, mech);
+        goto cleanup;
+    }
+
+    if (!authenticated)
+        major = GSS_S_UNAVAILABLE;
+    else {
+        localname->value = value.value;
+        localname->length = value.length;
+        value.value = NULL;
+    }
 
-        if (!authenticated)
-           major = GSS_S_UNAVAILABLE;
-       else {
-               localname->value = value.value;
-       localname->length = value.length;
-       value.value = NULL;
-       }
 cleanup:
-       if (display_value.value)
-               gss_release_buffer(&tmpMinor, &display_value);
-       if (value.value)
-               gss_release_buffer(&tmpMinor, &value);
+    if (display_value.value)
+        gss_release_buffer(&tmpMinor, &display_value);
+    if (value.value)
+        gss_release_buffer(&tmpMinor, &value);
     return major;
 }
+
 OM_uint32 KRB5_CALLCONV
 gss_localname(OM_uint32 *minor,
-                 const gss_name_t pname,
-             gss_const_OID mech_type,
-    gss_buffer_t localname)
+              const gss_name_t pname,
+              gss_const_OID mech_type,
+              gss_buffer_t localname)
 {
     OM_uint32 major, tmpMinor;
     gss_mechanism mech;
@@ -179,40 +181,40 @@ gss_localname(OM_uint32 *minor,
 
 #ifndef _WIN32
 OM_uint32 KRB5_CALLCONV
-gss_pname_to_uid
-       (OM_uint32 *minor,
-         const gss_name_t name,
-        const gss_OID mech_type,
-        uid_t *uidOut)
+gss_pname_to_uid(OM_uint32 *minor,
+                 const gss_name_t name,
+                 const gss_OID mech_type,
+                 uid_t *uidOut)
 {
-  OM_uint32 major = GSS_S_UNAVAILABLE, tmpminor;
-    #ifndef NO_PASSWORD
+    OM_uint32 major = GSS_S_UNAVAILABLE, tmpminor;
+#ifndef NO_PASSWORD
     gss_buffer_desc localname;
-            char pwbuf[BUFSIZ];
-           char *localuser = NULL;
-           struct passwd *pwd = NULL;
-           struct passwd pw;
-           int code = 0;
-
-           localname.value = NULL;
-           major = gss_localname(minor, name, mech_type, &localname);
-           if (!GSS_ERROR(major) && localname.value) {
-             localuser = malloc(localname.length + 1);
-             if (localuser == NULL)
-               code = ENOMEM;
-             if (code == 0) {
-                 memcpy(localuser, localname.value, localname.length);
-                 localuser[localname.length] = '\0';
-                 code = k5_getpwnam_r(localuser, &pw, pwbuf, sizeof(pwbuf), &pwd);
-             }
-             if ((code == 0) && pwd)
-                   *uidOut = pwd->pw_uid;
-               else major = GSS_S_FAILURE;
-           }
-           free(localuser);
-           if (localname.value)
-             gss_release_buffer(&tmpminor, &localname);
+    char pwbuf[BUFSIZ];
+    char *localuser = NULL;
+    struct passwd *pwd = NULL;
+    struct passwd pw;
+    int code = 0;
+
+    localname.value = NULL;
+    major = gss_localname(minor, name, mech_type, &localname);
+    if (!GSS_ERROR(major) && localname.value) {
+        localuser = malloc(localname.length + 1);
+        if (localuser == NULL)
+            code = ENOMEM;
+        if (code == 0) {
+            memcpy(localuser, localname.value, localname.length);
+            localuser[localname.length] = '\0';
+            code = k5_getpwnam_r(localuser, &pw, pwbuf, sizeof(pwbuf), &pwd);
+        }
+        if ((code == 0) && pwd)
+            *uidOut = pwd->pw_uid;
+        else
+            major = GSS_S_FAILURE;
+    }
+    free(localuser);
+    if (localname.value)
+        gss_release_buffer(&tmpminor, &localname);
 #endif /*NO_PASSWORD*/
-           return major;
+    return major;
 }
 #endif /*_WIN32*/
index 356dc68776a2f30bedd978c3da06e4b187724de5..577f5730855a61b2898dab99aec721c872dc128f 100644 (file)
@@ -323,7 +323,7 @@ typedef struct gss_config {
                    OM_uint32,          /* req_output_size */
                    OM_uint32 *         /* max_input_size */
         );
-    OM_uint32       (* KRB5_CALLCONV gss_localname)
+    OM_uint32       (KRB5_CALLCONV *gss_localname)
        (
                    OM_uint32 *,        /* minor */
                    const gss_name_t,   /* name */