aboutsummaryrefslogtreecommitdiff
path: root/ex.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-02-01 13:48:23 +0000
committerOmar Polo <op@omarpolo.com>2021-02-01 13:48:23 +0000
commit3e5418099fb2d44e0ffa9c65af66657cb28b466b (patch)
treee22e2aee0527466da92684715c68df4cc00fa51f /ex.c
parentee655e64d757e972d3fa3748b6dc4ade8a829035 (diff)
[cgi] always set some variables
Diffstat (limited to 'ex.c')
-rw-r--r--ex.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ex.c b/ex.c
index fbed2fe..7696a02 100644
--- a/ex.c
+++ b/ex.c
@@ -298,12 +298,14 @@ launch_cgi(struct iri *iri, const char *spath, char *relpath,
safe_setenv("SERVER_PROTOCOL", "GEMINI");
safe_setenv("SERVER_SOFTWARE", "gmid/1.5");
- if (ruser != NULL) {
+ if (ruser != NULL)
safe_setenv("AUTH_TYPE", "Certificate");
- safe_setenv("REMOTE_USER", ruser);
- safe_setenv("TLS_CLIENT_ISSUER", cissuer);
- safe_setenv("TLS_CLIENT_HASH", chash);
- }
+ else
+ safe_setenv("AUTH_TYPE", "");
+
+ safe_setenv("REMOTE_USER", ruser);
+ safe_setenv("TLS_CLIENT_ISSUER", cissuer);
+ safe_setenv("TLS_CLIENT_HASH", chash);
strlcpy(path, argv[0], sizeof(path));
pwd = dirname(path);