From b3682a2d114dd7468f5ea5d208b2fb983c612a57 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Thu, 1 Jun 2006 05:04:13 +0000 Subject: [PATCH] implement configfile for the no_access page --- src/configfile.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/configfile.c b/src/configfile.c index 0d334345..e7c14e7c 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -75,6 +75,7 @@ static void config_emit_readonly(WS_CONNINFO *pwsc, void *value, char *arg); static void config_emit_version(WS_CONNINFO *pwsc, void *value, char *arg); static void config_emit_system(WS_CONNINFO *pwsc, void *value, char *arg); static void config_emit_flags(WS_CONNINFO *pwsc, void *value, char *arg); +static void config_emit_conffile(WS_CONNINFO *pwsc, void *value, char *arg); static void config_emit_host(WS_CONNINFO *pwsc, void *value, char *arg); static void config_subst_stream(WS_CONNINFO *pwsc, int fd_src); static void config_content_type(WS_CONNINFO *pwsc, char *path); @@ -139,6 +140,7 @@ CONFIGELEMENT config_elements[] = { { 1,0,0,CONFIG_TYPE_STRING,"logfile",(void*)&config.logfile, config_emit_string }, { 1,0,0,CONFIG_TYPE_STRING,"art_filename",(void*)&config.artfilename,config_emit_string }, */ + { 0,0,0,CONFIG_TYPE_SPECIAL,"conffile",(void*)NULL,config_emit_conffile }, { 0,0,0,CONFIG_TYPE_SPECIAL,"host",(void*)NULL,config_emit_host }, { 0,0,0,CONFIG_TYPE_SPECIAL,"release",(void*)VERSION,config_emit_literal }, { 0,0,0,CONFIG_TYPE_SPECIAL,"package",(void*)PACKAGE,config_emit_literal }, @@ -428,6 +430,22 @@ void config_emit_host(WS_CONNINFO *pwsc, void *value, char *arg) { return; } + +/** + * emit the path to the current config file + * + * \param pwsc web connection + * \param value the variable that was requested + * \param arg any args passwd with the meta command + */ +void config_emit_conffile(WS_CONNINFO *pwsc, void *value, char *arg) { + char fullpath[PATH_MAX]; + + realpath(conf_get_filename(),fullpath); + ws_writefd(pwsc,"%s",fullpath); + return; +} + /** * Emit a string to the admin page. This is an actual string, * not a pointer to a string pointer, like emit_string.