Your message dated Sat, 26 Nov 2016 18:38:14 +0000
with message-id <[email protected]>
and subject line Bug#845765: Removed package(s) from unstable
has caused the Debian Bug report #578234,
regarding Please allow more then one SSI of each type
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
578234: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578234
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: nagios3-cgi
Version: 3.2.0-5
Tags: patch
Severity: wishlist
Please allow using more then one SSI of each type. Attached patch adds
directory support for SSI's.
ex.
ssi/common-header.ssi
ssi/common-header.ssi.d/10_blah
ssi/common-header.ssi.d/11_blah
.ssi file is processed first, followed by files in .ssi.d directory.
--
Omni Flux
diff -uNr nagios3-3.2.0.orig/cgi/cgiutils.c nagios3-3.2.0/cgi/cgiutils.c
--- nagios3-3.2.0.orig/cgi/cgiutils.c 2009-07-31 10:54:20.000000000 -0600
+++ nagios3-3.2.0/cgi/cgiutils.c 2010-04-18 01:20:45.000000000 -0600
@@ -1949,7 +1949,9 @@
/* include user-defined SSI footers or headers */
void include_ssi_files(char *cgi_name, int type){
char common_ssi_file[MAX_INPUT_BUFFER];
+ char common_ssi_dir[MAX_INPUT_BUFFER];
char cgi_ssi_file[MAX_INPUT_BUFFER];
+ char cgi_ssi_dir[MAX_INPUT_BUFFER];
char raw_cgi_name[MAX_INPUT_BUFFER];
char *stripped_cgi_name;
int x;
@@ -1957,6 +1959,9 @@
/* common header or footer */
snprintf(common_ssi_file,sizeof(common_ssi_file)-1,"%scommon-%s.ssi",physical_ssi_path,(type==SSI_HEADER)?"header":"footer");
common_ssi_file[sizeof(common_ssi_file)-1]='\x0';
+ strcpy(common_ssi_dir, common_ssi_file);
+ if(strlen(common_ssi_dir) < sizeof(common_ssi_dir)-2)
+ strcat(common_ssi_dir, ".d");
/* CGI-specific header or footer */
strncpy(raw_cgi_name,cgi_name,sizeof(raw_cgi_name)-1);
@@ -1966,14 +1971,21 @@
cgi_ssi_file[sizeof(cgi_ssi_file)-1]='\x0';
for(x=0;x<strlen(cgi_ssi_file);x++)
cgi_ssi_file[x]=tolower(cgi_ssi_file[x]);
+ strcpy(cgi_ssi_dir, cgi_ssi_file);
+ if(strlen(cgi_ssi_dir) < sizeof(cgi_ssi_dir)-2)
+ strcat(cgi_ssi_dir, ".d");
if(type==SSI_HEADER){
printf("\n<!-- Produced by Nagios (http://www.nagios.org).
Copyright (c) 1999-2007 Ethan Galstad. -->\n");
include_ssi_file(common_ssi_file);
+ include_ssi_dir(common_ssi_dir);
include_ssi_file(cgi_ssi_file);
+ include_ssi_dir(cgi_ssi_dir);
}
else{
+ include_ssi_dir(cgi_ssi_dir);
include_ssi_file(cgi_ssi_file);
+ include_ssi_dir(common_ssi_dir);
include_ssi_file(common_ssi_file);
printf("\n<!-- Produced by Nagios (http://www.nagios.org).
Copyright (c) 1999-2007 Ethan Galstad. -->\n");
}
@@ -2045,6 +2057,64 @@
}
+/* include user-defined SSI footer or header directory */
+void include_ssi_dir(char *dirname){
+ char file[MAX_FILENAME_LENGTH];
+ DIR *dirp=NULL;
+ struct dirent *dirfile=NULL;
+ struct stat stat_buf;
+
+ /* open the directory for reading */
+ dirp=opendir(dirname);
+ if(dirp==NULL)
+ {
+ if (errno != ENOENT)
+ printf("<br /> An opendir call returned %d while
attempting to open directory %s.<br />", errno, dirname);
+ return;
+ }
+
+ /* process all files in the directory... */
+ while((dirfile=readdir(dirp))!=NULL){
+
+ /* skip hidden files and directories, and current and parent
dir */
+ if(dirfile->d_name[0]=='.')
+ continue;
+
+ /* create /path/to/file */
+ snprintf(file,sizeof(file),"%s/%s",dirname,dirfile->d_name);
+ file[sizeof(file)-1]='\x0';
+
+ /* process this if it's a non-hidden file... */
+ if(stat(file,&stat_buf)==-1)
+ {
+ printf("<br /> A stat call returned %d while looking
for the file %s.<br />", errno, file);
+ continue;
+ }
+
+ switch(stat_buf.st_mode & S_IFMT){
+
+ case S_IFREG:
+ /* process the file */
+ include_ssi_file(file);
+ break;
+
+ case S_IFDIR:
+ /* recurse into subdirectories... */
+ include_ssi_dir(file);
+ break;
+
+ default:
+ /* everything else we ignore */
+ break;
+ }
+ }
+
+ closedir(dirp);
+ return;
+ }
+
+
+
/* displays an error if CGI config file could not be read */
void cgi_config_file_error(char *config_file){
diff -uNr nagios3-3.2.0.orig/include/cgiutils.h.in
nagios3-3.2.0/include/cgiutils.h.in
--- nagios3-3.2.0.orig/include/cgiutils.h.in 2008-11-30 10:22:59.000000000
-0700
+++ nagios3-3.2.0/include/cgiutils.h.in 2010-04-18 01:20:25.000000000 -0600
@@ -505,6 +505,7 @@
void include_ssi_files(char *,int); /* include
user-defined SSI footers/headers */
void include_ssi_file(char *); /* include
user-defined SSI footer/header */
+void include_ssi_dir(char *); /* include
user-defined SSI footer/headers */
void cgi_config_file_error(char *);
void main_config_file_error(char *);
--- End Message ---
--- Begin Message ---
Version: 3.5.1.dfsg-2.2+rm
Dear submitter,
as the package nagios3 has just been removed from the Debian archive
unstable we hereby close the associated bug reports. We are sorry
that we couldn't deal with your issue properly.
For details on the removal, please see https://bugs.debian.org/845765
The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.
This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
[email protected].
Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)
--- End Message ---