[Nagios-devel] patch for cgi: change authentication env-variable

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] patch for cgi: change authentication env-variable

Post by Guest »

--Boundary-00=_szqzMrb33Dmib32
Content-Type: Text/Plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

=2D-- cgi/cgiauth.c.orig 2010-10-30 16:43:36.000000000 +0200
+++ cgi/cgiauth.c 2010-11-01 11:06:12.000000000 +0100
@@ -36,7 +36,7 @@
=20
extern int use_authentication;
extern int use_ssl_authentication;
=2D
+extern char cgi_user_env[MAX_INPUT_BUFFER];
=20
=20
/* get current authentication information */
@@ -64,7 +64,7 @@
temp_ptr=3Dgetenv("SSL_CLIENT_S_DN_CN");
}
else{
=2D temp_ptr=3Dgetenv("REMOTE_USER");
+ temp_ptr=3Dgetenv(cgi_user_env);
}
if(temp_ptr=3D=3DNULL){
authinfo->username=3D"";




=2D-=20
Christian Schneemann =20
Linux Consultant & Developer
Tel.: +49-175-7250665
Mail: [email protected]

B1 Systems GmbH
Osterfeldstra=DFe 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

--Boundary-00=_szqzMrb33Dmib32
Content-Type: text/x-patch;
charset="UTF-8";
name="cgiauth.c.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="cgiauth.c.patch"

--- cgi/cgiauth.c.orig 2010-10-30 16:43:36.000000000 +0200
+++ cgi/cgiauth.c 2010-11-01 11:06:12.000000000 +0100
@@ -36,7 +36,7 @@

extern int use_authentication;
extern int use_ssl_authentication;
-
+extern char cgi_user_env[MAX_INPUT_BUFFER];


/* get current authentication information */
@@ -64,7 +64,7 @@
temp_ptr=getenv("SSL_CLIENT_S_DN_CN");
}
else{
- temp_ptr=getenv("REMOTE_USER");
+ temp_ptr=getenv(cgi_user_env);
}
if(temp_ptr==NULL){
authinfo->username="";

--Boundary-00=_szqzMrb33Dmib32
Content-Type: text/x-patch;
charset="UTF-8";
name="cgiutils.c.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="cgiutils.c.patch"

--- cgi/cgiutils.c.orig 2010-11-01 10:56:28.000000000 +0100
+++ cgi/cgiutils.c 2010-11-01 11:20:02.000000000 +0100
@@ -110,6 +110,8 @@
int escape_html_tags=FALSE;

int use_ssl_authentication=FALSE;
+char *cgi_user_env=NULL;
+

int default_statusmap_layout_method=0;
int default_statuswrl_layout_method=0;
@@ -427,6 +429,10 @@

else if(!strcmp(var,"use_ssl_authentication"))
use_ssl_authentication=(atoi(val)>0)?TRUE:FALSE;
+
+ else if (!strcmp(var, "cgi_user_env"))
+ cgi_user_env=strdup(val);
+
}

/* free memory and close the file */

--Boundary-00=_szqzMrb33Dmib32--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked