[mod_gnutls-devel] populating REMOTE_USER

Ramkumar Chinchani ramkumar.chinchani at gmail.com
Tue Jul 1 05:21:38 CEST 2014


Hi Marc,

About mod_gnutls populating REMOTE_USER, would the following patch work for
you?

Thanks.


diff --git a/src/gnutls_hooks.c b/src/gnutls_hooks.c
index d068ebb..415b3ed 100644
--- a/src/gnutls_hooks.c
+++ b/src/gnutls_hooks.c
@@ -1008,6 +1008,9 @@ static void mgs_add_common_cert_vars(request_rec * r,
gnutls_x509_crt_t cert, in
                 san = "UNSUPPORTED";
             }
             apr_table_setn(env, sanlabel, san);
+            if (side == 1) {
+                apr_table_setn(env, "REMOTE_USER", san);
+            }
         }
     }
 }
@@ -1060,6 +1063,9 @@ static void mgs_add_common_pgpcert_vars(request_rec *
r, gnutls_openpgp_crt_t ce
     len = sizeof (buf);
     gnutls_openpgp_crt_get_name(cert, 0, buf, &len);
     apr_table_setn(env, MGS_SIDE("_NAME"), apr_pstrmemdup(r->pool, buf,
len));
+    if (side == 1) {
+        apr_table_setn(env, "REMOTE_USER", apr_pstrmemdup(r->pool, buf,
len));
+    }

     len = sizeof (sbuf);
     gnutls_openpgp_crt_get_fingerprint(cert, sbuf, &len);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20140630/cb913260/attachment.html>


More information about the mod_gnutls-devel mailing list