diff options
author | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2009-06-17 00:47:57 +0000 |
---|---|---|
committer | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2009-06-17 00:47:57 +0000 |
commit | 01a5b1deb99d3d17dcc4f4c9c8299e1bb822afde (patch) | |
tree | fa555756a2d2c573a08061a8e8cf90dea2353578 /pki/base | |
parent | 69784296f92aef800646449809e0ee50eb82d00f (diff) | |
download | pki-01a5b1deb99d3d17dcc4f4c9c8299e1bb822afde.tar.gz pki-01a5b1deb99d3d17dcc4f4c9c8299e1bb822afde.tar.xz pki-01a5b1deb99d3d17dcc4f4c9c8299e1bb822afde.zip |
Bugzilla Bug #502908 - Current page not found handling is a Cat 2 finding with
the Tomcat STIG.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@617 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base')
-rw-r--r-- | pki/base/ca/shared/conf/web.xml | 5 | ||||
-rw-r--r-- | pki/base/kra/shared/conf/web.xml | 5 | ||||
-rw-r--r-- | pki/base/ocsp/shared/conf/web.xml | 5 | ||||
-rw-r--r-- | pki/base/ra/apache/conf/httpd.conf | 5 | ||||
-rwxr-xr-x | pki/base/ra/lib/perl/PKI/RA/DonePanel.pm | 23 | ||||
-rw-r--r-- | pki/base/tks/shared/conf/web.xml | 5 | ||||
-rw-r--r-- | pki/base/tps/Makefile.am | 10 | ||||
-rw-r--r-- | pki/base/tps/Makefile.in | 70 | ||||
-rw-r--r-- | pki/base/tps/apache/conf/httpd.conf | 5 | ||||
-rwxr-xr-x | pki/base/tps/configure | 56 | ||||
-rw-r--r-- | pki/base/tps/configure.ac | 4 | ||||
-rwxr-xr-x | pki/base/tps/forms/index.cgi | 76 | ||||
-rw-r--r-- | pki/base/tps/forms/index.html | 2 | ||||
-rwxr-xr-x | pki/base/tps/lib/perl/PKI/Base/Conf.pm | 130 | ||||
-rwxr-xr-x | pki/base/tps/lib/perl/PKI/Base/Registry.pm | 55 | ||||
-rwxr-xr-x | pki/base/tps/lib/perl/PKI/Service/Op.pm | 127 | ||||
-rwxr-xr-x | pki/base/tps/lib/perl/PKI/TPS/DonePanel.pm | 23 | ||||
-rwxr-xr-x | pki/base/tps/lib/perl/PKI/TPS/TKSInfoPanel.pm | 3 | ||||
-rwxr-xr-x | pki/base/tps/setup_package | 7 |
19 files changed, 578 insertions, 38 deletions
diff --git a/pki/base/ca/shared/conf/web.xml b/pki/base/ca/shared/conf/web.xml index edb523698..1033e4434 100644 --- a/pki/base/ca/shared/conf/web.xml +++ b/pki/base/ca/shared/conf/web.xml @@ -976,4 +976,9 @@ <welcome-file>index.jsp</welcome-file> </welcome-file-list> + <error-page> + <error-code>404</error-code> + <location>/404.html</location> + </error-page> + </web-app> diff --git a/pki/base/kra/shared/conf/web.xml b/pki/base/kra/shared/conf/web.xml index edb523698..1033e4434 100644 --- a/pki/base/kra/shared/conf/web.xml +++ b/pki/base/kra/shared/conf/web.xml @@ -976,4 +976,9 @@ <welcome-file>index.jsp</welcome-file> </welcome-file-list> + <error-page> + <error-code>404</error-code> + <location>/404.html</location> + </error-page> + </web-app> diff --git a/pki/base/ocsp/shared/conf/web.xml b/pki/base/ocsp/shared/conf/web.xml index 3dab6a237..e4ae1bc4d 100644 --- a/pki/base/ocsp/shared/conf/web.xml +++ b/pki/base/ocsp/shared/conf/web.xml @@ -980,4 +980,9 @@ <welcome-file>index.jsp</welcome-file> </welcome-file-list> + <error-page> + <error-code>404</error-code> + <location>/404.html</location> + </error-page> + </web-app> diff --git a/pki/base/ra/apache/conf/httpd.conf b/pki/base/ra/apache/conf/httpd.conf index b3e36d279..4f00995da 100644 --- a/pki/base/ra/apache/conf/httpd.conf +++ b/pki/base/ra/apache/conf/httpd.conf @@ -562,7 +562,7 @@ CustomLog logs/access_log common # Set to one of: Full | OS | Minor | Minimal | Major | Prod # where Full conveys the most information, and Prod the least. # -ServerTokens Full +ServerTokens Prod # # Optionally add a line containing the server version and virtual host @@ -572,7 +572,7 @@ ServerTokens Full # Set to "EMail" to also include a mailto: link to the ServerAdmin. # Set to one of: On | Off | EMail # -ServerSignature On +ServerSignature Off # # Aliases: Add here as many aliases as you need (with no limit). The format is @@ -981,6 +981,7 @@ AddHandler type-map var # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var +#[ErrorDocument_404] # diff --git a/pki/base/ra/lib/perl/PKI/RA/DonePanel.pm b/pki/base/ra/lib/perl/PKI/RA/DonePanel.pm index f5e86fc6b..604eff015 100755 --- a/pki/base/ra/lib/perl/PKI/RA/DonePanel.pm +++ b/pki/base/ra/lib/perl/PKI/RA/DonePanel.pm @@ -310,6 +310,29 @@ sub display $::config->put("preop.done.status", "done"); $::config->commit(); + # update httpd.conf + open(TMP_HTTPD_CONF, ">$instDir/conf/httpd.conf.tmp"); + system( "chmod 00660 $instDir/conf/httpd.conf.tmp" ); + open(HTTPD_CONF, "<$instDir/conf/httpd.conf"); + while (<HTTPD_CONF>) { + if (/^#\[ErrorDocument_404\]/) { + print TMP_HTTPD_CONF "ErrorDocument 404 /404.html\n"; + } else { + print TMP_HTTPD_CONF $_; + } + } + close(HTTPD_CONF); + close(TMP_HTTPD_CONF); + + # Create a copy of the original file which + # preserves the original file permissions + system( "cp -p $instDir/conf/httpd.conf.tmp $instDir/conf/httpd.conf" ); + + # Remove the original file only if the backup copy was successful + if( -e "$instDir/conf/httpd.conf" ) { + system( "rm $instDir/conf/httpd.conf.tmp" ); + } + # update nss.conf open(TMP_NSS_CONF, ">$instDir/conf/nss.conf.tmp"); system( "chmod 00660 $instDir/conf/nss.conf.tmp" ); diff --git a/pki/base/tks/shared/conf/web.xml b/pki/base/tks/shared/conf/web.xml index 3dab6a237..e4ae1bc4d 100644 --- a/pki/base/tks/shared/conf/web.xml +++ b/pki/base/tks/shared/conf/web.xml @@ -980,4 +980,9 @@ <welcome-file>index.jsp</welcome-file> </welcome-file-list> + <error-page> + <error-code>404</error-code> + <location>/404.html</location> + </error-page> + </web-app> diff --git a/pki/base/tps/Makefile.am b/pki/base/tps/Makefile.am index 2099fc726..c13bc5802 100644 --- a/pki/base/tps/Makefile.am +++ b/pki/base/tps/Makefile.am @@ -90,7 +90,9 @@ docroot_tps_jsdir = $(prefix)@docroot_tps_jsdir@ initddir = $(sysconfdir)@initddir@ licensedir = $(prefix)@licensedir@ logsdir = $(prefix)@logsdir@ +perl_basedir = $(prefix)@perl_basedir@ perl_modulesdir = $(prefix)@perl_modulesdir@ +perl_servicedir = $(prefix)@perl_servicedir@ perl_templatesdir = $(prefix)@perl_templatesdir@ samplesdir = $(prefix)@samplesdir@ scriptsdir = $(prefix)@scriptsdir@ @@ -162,7 +164,8 @@ conf_DATA = $(srcdir)/apache/conf/httpd.conf \ $(srcdir)/apache/conf/perl.conf \ $(srcdir)/doc/CS.cfg -docroot_DATA = $(srcdir)/forms/index.html +docroot_DATA = $(srcdir)/forms/index.cgi \ + $(srcdir)/forms/index.html docroot_demo_DATA = @@ -189,6 +192,9 @@ libexec_SCRIPTS = $(srcdir)/apache/apachectl # create an empty 'logs' directory logs_DATA = +perl_base_SCRIPTS = $(srcdir)/lib/perl/PKI/Base/Conf.pm \ + $(srcdir)/lib/perl/PKI/Base/Registry.pm + perl_modules_SCRIPTS = $(srcdir)/lib/perl/PKI/TPS/AdminAuthPanel.pm \ $(srcdir)/lib/perl/PKI/TPS/AdminPanel.pm \ $(srcdir)/lib/perl/PKI/TPS/AgentAuthPanel.pm \ @@ -222,6 +228,8 @@ perl_modules_SCRIPTS = $(srcdir)/lib/perl/PKI/TPS/AdminAuthPanel.pm \ $(srcdir)/lib/perl/PKI/TPS/WelcomePanel.pm \ $(srcdir)/lib/perl/PKI/TPS/wizard.pm +perl_service_SCRIPTS = $(srcdir)/lib/perl/PKI/Service/Op.pm + perl_templates_SCRIPTS = $(srcdir)/lib/perl/Template/Velocity.pm samples_DATA = $(srcdir)/tools/raclient/enroll.tps \ diff --git a/pki/base/tps/Makefile.in b/pki/base/tps/Makefile.in index 7b53bb75d..1a182e005 100644 --- a/pki/base/tps/Makefile.in +++ b/pki/base/tps/Makefile.in @@ -84,7 +84,8 @@ am__installdirs = "$(DESTDIR)$(apache_modulesdir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cgibin_demodir)" \ "$(DESTDIR)$(cgibin_homedir)" "$(DESTDIR)$(cgibin_sodir)" \ "$(DESTDIR)$(cgibin_sowdir)" "$(DESTDIR)$(initddir)" \ - "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(perl_modulesdir)" \ + "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(perl_basedir)" \ + "$(DESTDIR)$(perl_modulesdir)" "$(DESTDIR)$(perl_servicedir)" \ "$(DESTDIR)$(perl_templatesdir)" "$(DESTDIR)$(scriptsdir)" \ "$(DESTDIR)$(setupdir)" "$(DESTDIR)$(aliasdir)" \ "$(DESTDIR)$(appletsdir)" "$(DESTDIR)$(cgibin_demodir)" \ @@ -308,13 +309,16 @@ cgibin_soSCRIPT_INSTALL = $(INSTALL_SCRIPT) cgibin_sowSCRIPT_INSTALL = $(INSTALL_SCRIPT) initdSCRIPT_INSTALL = $(INSTALL_SCRIPT) libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) +perl_baseSCRIPT_INSTALL = $(INSTALL_SCRIPT) perl_modulesSCRIPT_INSTALL = $(INSTALL_SCRIPT) +perl_serviceSCRIPT_INSTALL = $(INSTALL_SCRIPT) perl_templatesSCRIPT_INSTALL = $(INSTALL_SCRIPT) scriptsSCRIPT_INSTALL = $(INSTALL_SCRIPT) setupSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) $(cgibin_demo_SCRIPTS) $(cgibin_home_SCRIPTS) \ $(cgibin_so_SCRIPTS) $(cgibin_sow_SCRIPTS) $(initd_SCRIPTS) \ - $(libexec_SCRIPTS) $(perl_modules_SCRIPTS) \ + $(libexec_SCRIPTS) $(perl_base_SCRIPTS) \ + $(perl_modules_SCRIPTS) $(perl_service_SCRIPTS) \ $(perl_templates_SCRIPTS) $(scripts_SCRIPTS) $(setup_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -534,7 +538,9 @@ nss_lib = @nss_lib@ nss_libdir = @nss_libdir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +perl_basedir = $(prefix)@perl_basedir@ perl_modulesdir = $(prefix)@perl_modulesdir@ +perl_servicedir = $(prefix)@perl_servicedir@ perl_templatesdir = $(prefix)@perl_templatesdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -652,7 +658,9 @@ conf_DATA = $(srcdir)/apache/conf/httpd.conf \ $(srcdir)/apache/conf/perl.conf \ $(srcdir)/doc/CS.cfg -docroot_DATA = $(srcdir)/forms/index.html +docroot_DATA = $(srcdir)/forms/index.cgi \ + $(srcdir)/forms/index.html + docroot_demo_DATA = docroot_home_DATA = docroot_so_DATA = @@ -667,6 +675,9 @@ libexec_SCRIPTS = $(srcdir)/apache/apachectl # create an empty 'logs' directory logs_DATA = +perl_base_SCRIPTS = $(srcdir)/lib/perl/PKI/Base/Conf.pm \ + $(srcdir)/lib/perl/PKI/Base/Registry.pm + perl_modules_SCRIPTS = $(srcdir)/lib/perl/PKI/TPS/AdminAuthPanel.pm \ $(srcdir)/lib/perl/PKI/TPS/AdminPanel.pm \ $(srcdir)/lib/perl/PKI/TPS/AgentAuthPanel.pm \ @@ -700,6 +711,7 @@ perl_modules_SCRIPTS = $(srcdir)/lib/perl/PKI/TPS/AdminAuthPanel.pm \ $(srcdir)/lib/perl/PKI/TPS/WelcomePanel.pm \ $(srcdir)/lib/perl/PKI/TPS/wizard.pm +perl_service_SCRIPTS = $(srcdir)/lib/perl/PKI/Service/Op.pm perl_templates_SCRIPTS = $(srcdir)/lib/perl/Template/Velocity.pm samples_DATA = $(srcdir)/tools/raclient/enroll.tps \ $(srcdir)/tools/raclient/format.tps \ @@ -1614,6 +1626,25 @@ uninstall-libexecSCRIPTS: echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ done +install-perl_baseSCRIPTS: $(perl_base_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(perl_basedir)" || $(MKDIR_P) "$(DESTDIR)$(perl_basedir)" + @list='$(perl_base_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(perl_baseSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(perl_basedir)/$$f'"; \ + $(perl_baseSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(perl_basedir)/$$f"; \ + else :; fi; \ + done + +uninstall-perl_baseSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(perl_base_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(perl_basedir)/$$f'"; \ + rm -f "$(DESTDIR)$(perl_basedir)/$$f"; \ + done install-perl_modulesSCRIPTS: $(perl_modules_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(perl_modulesdir)" || $(MKDIR_P) "$(DESTDIR)$(perl_modulesdir)" @@ -1633,6 +1664,25 @@ uninstall-perl_modulesSCRIPTS: echo " rm -f '$(DESTDIR)$(perl_modulesdir)/$$f'"; \ rm -f "$(DESTDIR)$(perl_modulesdir)/$$f"; \ done +install-perl_serviceSCRIPTS: $(perl_service_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(perl_servicedir)" || $(MKDIR_P) "$(DESTDIR)$(perl_servicedir)" + @list='$(perl_service_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(perl_serviceSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(perl_servicedir)/$$f'"; \ + $(perl_serviceSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(perl_servicedir)/$$f"; \ + else :; fi; \ + done + +uninstall-perl_serviceSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(perl_service_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(perl_servicedir)/$$f'"; \ + rm -f "$(DESTDIR)$(perl_servicedir)/$$f"; \ + done install-perl_templatesSCRIPTS: $(perl_templates_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(perl_templatesdir)" || $(MKDIR_P) "$(DESTDIR)$(perl_templatesdir)" @@ -4021,7 +4071,7 @@ check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \ config.h installdirs: - for dir in "$(DESTDIR)$(apache_modulesdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cgibin_demodir)" "$(DESTDIR)$(cgibin_homedir)" "$(DESTDIR)$(cgibin_sodir)" "$(DESTDIR)$(cgibin_sowdir)" "$(DESTDIR)$(initddir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(perl_modulesdir)" "$(DESTDIR)$(perl_templatesdir)" "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(setupdir)" "$(DESTDIR)$(aliasdir)" "$(DESTDIR)$(appletsdir)" "$(DESTDIR)$(cgibin_demodir)" "$(DESTDIR)$(cgibin_homedir)" "$(DESTDIR)$(cgibin_sodir)" "$(DESTDIR)$(cgibin_sowdir)" "$(DESTDIR)$(confdir)" "$(DESTDIR)$(docrootdir)" "$(DESTDIR)$(docroot_demodir)" "$(DESTDIR)$(docroot_homedir)" "$(DESTDIR)$(docroot_sodir)" "$(DESTDIR)$(docroot_sowdir)" "$(DESTDIR)$(docroot_tokendbdir)" "$(DESTDIR)$(docroot_tps_configdir)" "$(DESTDIR)$(docroot_tps_imgdir)" "$(DESTDIR)$(docroot_tps_jsdir)" "$(DESTDIR)$(licensedir)" "$(DESTDIR)$(logsdir)" "$(DESTDIR)$(samplesdir)" "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(setupdir)" "$(DESTDIR)$(templatesdir)"; do \ + for dir in "$(DESTDIR)$(apache_modulesdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cgibin_demodir)" "$(DESTDIR)$(cgibin_homedir)" "$(DESTDIR)$(cgibin_sodir)" "$(DESTDIR)$(cgibin_sowdir)" "$(DESTDIR)$(initddir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(perl_basedir)" "$(DESTDIR)$(perl_modulesdir)" "$(DESTDIR)$(perl_servicedir)" "$(DESTDIR)$(perl_templatesdir)" "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(setupdir)" "$(DESTDIR)$(aliasdir)" "$(DESTDIR)$(appletsdir)" "$(DESTDIR)$(cgibin_demodir)" "$(DESTDIR)$(cgibin_homedir)" "$(DESTDIR)$(cgibin_sodir)" "$(DESTDIR)$(cgibin_sowdir)" "$(DESTDIR)$(confdir)" "$(DESTDIR)$(docrootdir)" "$(DESTDIR)$(docroot_demodir)" "$(DESTDIR)$(docroot_homedir)" "$(DESTDIR)$(docroot_sodir)" "$(DESTDIR)$(docroot_sowdir)" "$(DESTDIR)$(docroot_tokendbdir)" "$(DESTDIR)$(docroot_tps_configdir)" "$(DESTDIR)$(docroot_tps_imgdir)" "$(DESTDIR)$(docroot_tps_jsdir)" "$(DESTDIR)$(licensedir)" "$(DESTDIR)$(logsdir)" "$(DESTDIR)$(samplesdir)" "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(setupdir)" "$(DESTDIR)$(templatesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -4108,7 +4158,8 @@ install-data-am: install-aliasDATA install-apache_modulesLTLIBRARIES \ install-docroot_tokendbDATA install-docroot_tps_configDATA \ install-docroot_tps_imgDATA install-docroot_tps_jsDATA \ install-initdSCRIPTS install-licenseDATA install-logsDATA \ - install-perl_modulesSCRIPTS install-perl_templatesSCRIPTS \ + install-perl_baseSCRIPTS install-perl_modulesSCRIPTS \ + install-perl_serviceSCRIPTS install-perl_templatesSCRIPTS \ install-samplesDATA install-scriptsDATA install-scriptsSCRIPTS \ install-setupDATA install-setupSCRIPTS install-templatesDATA @@ -4163,7 +4214,8 @@ uninstall-am: uninstall-aliasDATA uninstall-apache_modulesLTLIBRARIES \ uninstall-initdSCRIPTS uninstall-libLTLIBRARIES \ uninstall-libexecPROGRAMS uninstall-libexecSCRIPTS \ uninstall-licenseDATA uninstall-logsDATA \ - uninstall-perl_modulesSCRIPTS uninstall-perl_templatesSCRIPTS \ + uninstall-perl_baseSCRIPTS uninstall-perl_modulesSCRIPTS \ + uninstall-perl_serviceSCRIPTS uninstall-perl_templatesSCRIPTS \ uninstall-samplesDATA uninstall-scriptsDATA \ uninstall-scriptsSCRIPTS uninstall-setupDATA \ uninstall-setupSCRIPTS uninstall-templatesDATA @@ -4194,7 +4246,8 @@ uninstall-am: uninstall-aliasDATA uninstall-apache_modulesLTLIBRARIES \ install-libLTLIBRARIES install-libexecPROGRAMS \ install-libexecSCRIPTS install-licenseDATA install-logsDATA \ install-man install-pdf install-pdf-am \ - install-perl_modulesSCRIPTS install-perl_templatesSCRIPTS \ + install-perl_baseSCRIPTS install-perl_modulesSCRIPTS \ + install-perl_serviceSCRIPTS install-perl_templatesSCRIPTS \ install-ps install-ps-am install-samplesDATA \ install-scriptsDATA install-scriptsSCRIPTS install-setupDATA \ install-setupSCRIPTS install-strip install-templatesDATA \ @@ -4215,7 +4268,8 @@ uninstall-am: uninstall-aliasDATA uninstall-apache_modulesLTLIBRARIES \ uninstall-docroot_tps_jsDATA uninstall-initdSCRIPTS \ uninstall-libLTLIBRARIES uninstall-libexecPROGRAMS \ uninstall-libexecSCRIPTS uninstall-licenseDATA \ - uninstall-logsDATA uninstall-perl_modulesSCRIPTS \ + uninstall-logsDATA uninstall-perl_baseSCRIPTS \ + uninstall-perl_modulesSCRIPTS uninstall-perl_serviceSCRIPTS \ uninstall-perl_templatesSCRIPTS uninstall-samplesDATA \ uninstall-scriptsDATA uninstall-scriptsSCRIPTS \ uninstall-setupDATA uninstall-setupSCRIPTS \ diff --git a/pki/base/tps/apache/conf/httpd.conf b/pki/base/tps/apache/conf/httpd.conf index d3ec8e050..f80ad43b8 100644 --- a/pki/base/tps/apache/conf/httpd.conf +++ b/pki/base/tps/apache/conf/httpd.conf @@ -566,7 +566,7 @@ CustomLog logs/access_log common # Set to one of: Full | OS | Minor | Minimal | Major | Prod # where Full conveys the most information, and Prod the least. # -ServerTokens Full +ServerTokens Prod # # Optionally add a line containing the server version and virtual host @@ -576,7 +576,7 @@ ServerTokens Full # Set to "EMail" to also include a mailto: link to the ServerAdmin. # Set to one of: On | Off | EMail # -ServerSignature On +ServerSignature Off # # Aliases: Add here as many aliases as you need (with no limit). The format is @@ -985,6 +985,7 @@ AddHandler type-map var # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var +#[ErrorDocument_404] # diff --git a/pki/base/tps/configure b/pki/base/tps/configure index edd76b8e2..59d5ef92a 100755 --- a/pki/base/tps/configure +++ b/pki/base/tps/configure @@ -900,7 +900,9 @@ docroot_tps_jsdir initddir licensedir logsdir +perl_basedir perl_modulesdir +perl_servicedir perl_templatesdir samplesdir scriptsdir @@ -5029,7 +5031,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5032 "configure"' > conftest.$ac_ext + echo '#line 5034 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7300,11 +7302,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7303: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7305: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7307: \$? = $ac_status" >&5 + echo "$as_me:7309: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7590,11 +7592,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7593: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7595: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7597: \$? = $ac_status" >&5 + echo "$as_me:7599: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7694,11 +7696,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7697: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7699: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7701: \$? = $ac_status" >&5 + echo "$as_me:7703: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10045,7 +10047,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10048 "configure" +#line 10050 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10145,7 +10147,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10148 "configure" +#line 10150 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12565,11 +12567,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12568: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12570: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12572: \$? = $ac_status" >&5 + echo "$as_me:12574: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12669,11 +12671,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12672: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12674: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12676: \$? = $ac_status" >&5 + echo "$as_me:12678: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14233,11 +14235,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14236: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14238: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14240: \$? = $ac_status" >&5 + echo "$as_me:14242: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14337,11 +14339,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14340: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14342: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14344: \$? = $ac_status" >&5 + echo "$as_me:14346: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16526,11 +16528,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16529: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16531: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16533: \$? = $ac_status" >&5 + echo "$as_me:16535: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16816,11 +16818,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16819: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16821: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16823: \$? = $ac_status" >&5 + echo "$as_me:16825: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16920,11 +16922,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16923: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16925: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16927: \$? = $ac_status" >&5 + echo "$as_me:16929: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -23686,7 +23688,9 @@ initddir=/init.d # relative to prefix licensedir=/doc logsdir=/logs/signedAudit +perl_basedir=/perl/base perl_modulesdir=/perl/modules +perl_servicedir=/perl/service perl_templatesdir=/perl/templates samplesdir=/samples scriptsdir=/scripts @@ -23723,6 +23727,8 @@ templatesdir=/templates + + # WINNT should be true if building on Windows system not using # cygnus, mingw, or the like and using cmd.exe as the shell if false; then @@ -26467,7 +26473,9 @@ docroot_tps_jsdir!$docroot_tps_jsdir$ac_delim initddir!$initddir$ac_delim licensedir!$licensedir$ac_delim logsdir!$logsdir$ac_delim +perl_basedir!$perl_basedir$ac_delim perl_modulesdir!$perl_modulesdir$ac_delim +perl_servicedir!$perl_servicedir$ac_delim perl_templatesdir!$perl_templatesdir$ac_delim samplesdir!$samplesdir$ac_delim scriptsdir!$scriptsdir$ac_delim @@ -26511,7 +26519,7 @@ apr_bindir!$apr_bindir$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 76; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 78; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/pki/base/tps/configure.ac b/pki/base/tps/configure.ac index 13a7746ac..163f4eb70 100644 --- a/pki/base/tps/configure.ac +++ b/pki/base/tps/configure.ac @@ -136,7 +136,9 @@ initddir=/init.d # relative to prefix licensedir=/doc logsdir=/logs/signedAudit +perl_basedir=/perl/base perl_modulesdir=/perl/modules +perl_servicedir=/perl/service perl_templatesdir=/perl/templates samplesdir=/samples scriptsdir=/scripts @@ -166,7 +168,9 @@ AC_SUBST(docroot_tps_jsdir) AC_SUBST(initddir) AC_SUBST(licensedir) AC_SUBST(logsdir) +AC_SUBST(perl_basedir) AC_SUBST(perl_modulesdir) +AC_SUBST(perl_servicedir) AC_SUBST(perl_templatesdir) AC_SUBST(samplesdir) AC_SUBST(scriptsdir) diff --git a/pki/base/tps/forms/index.cgi b/pki/base/tps/forms/index.cgi new file mode 100755 index 000000000..0e643166b --- /dev/null +++ b/pki/base/tps/forms/index.cgi @@ -0,0 +1,76 @@ +#!/usr/bin/perl +# +# --- BEGIN COPYRIGHT BLOCK --- +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2007 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- +# +# +# +# + +package op; + +use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; + +use CGI; +use PKI::Service::Op; +use Template::Velocity; +use PKI::Base::Conf; +use PKI::Base::Registry; + +use vars qw (@ISA); +use PKI::Service::Op; +@ISA = qw(PKI::Service::Op); + +sub new { + my $self = {}; + bless ($self); + return $self; +} + +sub process() +{ + my $self = shift; + + my $q = CGI->new(); + + my $docroot = PKI::Base::Registry->get_docroot(); + my $parser = PKI::Base::Registry->get_parser(); + my $cfg = PKI::Base::Registry->get_config(); + + $self->debug_params($cfg, $q); + + $::symbol{machineName} = $cfg->get("service.machineName"); + $::symbol{non_clientauth_securePort} = $cfg->get("service.non_clientauth_securePort"); + $::symbol{securePort} = $cfg->get("service.securePort"); + $::symbol{unsecurePort} = $cfg->get("service.unsecurePort"); + + my $result = $parser->execute_file("index.vm"); + + my $xml = $q->param('xml'); + if ($xml eq "true") { + print "Content-Type: text/xml\n\n"; + print $self->xml_output(\%::symbol); + } else { + print "Content-Type: text/html\n\n"; + print "$result"; + } +} + + +my $op = op->new(); +$op->execute(); diff --git a/pki/base/tps/forms/index.html b/pki/base/tps/forms/index.html index ba31afd8c..b225251a1 100644 --- a/pki/base/tps/forms/index.html +++ b/pki/base/tps/forms/index.html @@ -18,5 +18,5 @@ All rights reserved. --- END COPYRIGHT BLOCK --- --> <html> -<META HTTP-EQUIV="Refresh" CONTENT="0; URL=/tus"> +<META HTTP-EQUIV="Refresh" CONTENT="0; URL=/index.cgi"> </html> diff --git a/pki/base/tps/lib/perl/PKI/Base/Conf.pm b/pki/base/tps/lib/perl/PKI/Base/Conf.pm new file mode 100755 index 000000000..7783eb8c6 --- /dev/null +++ b/pki/base/tps/lib/perl/PKI/Base/Conf.pm @@ -0,0 +1,130 @@ +#!/usr/bin/pkiperl +# +# --- BEGIN COPYRIGHT BLOCK --- +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2007 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- +# +# +# +# + +package PKI::Base::Conf; + +use strict; +use warnings; +use Exporter; + +$PKI::Base::Conf::VERSION = '1.00'; + +####################################################### +# Configuration Store +####################################################### +sub new { + my $class = shift; + my $self = {}; + my %hash = (); + $self->{filename} = ""; + $self->{hash} = \%hash; + bless $self,$class; + return $self; +} + +sub load_file +{ + my ($self, $filename) = @_; + + $self->{filename} = $filename; + if (-e $filename) { + open(CF, "<$filename"); + if (defined fileno CF) { + while (<CF>) { + if (/^#/) { + # comments + } elsif (/([^=]+)=(.*)$/) { + # print "$1 = $2\n"; + $self->{hash}{$1} = $2; + } else { + # preserve comments + } + } + } + close(CF); + } +} + +sub get_filename +{ + my ($self) = @_; + return $self->{filename}; +} + +sub get +{ + my ($self, $n) = @_; + return $self->{hash}{$n}; +} + +sub put +{ + my ($self, $n, $v) = @_; + $self->{hash}{$n} = $v; +} + +sub commit +{ + my ($self) = @_; + + # write stuff back to the file +# print $self->{filename} . "\n"; + my $hash = $self->{hash}; + my $suffix = time(); + + if (-e $self->{filename}) { + system("mv \"" . $self->{filename} . "\" \"" . + $self->{filename} . "." . $suffix . "\""); + } + + open(F, ">" . $self->{filename}); + foreach my $k (sort keys %{$hash}) { + print F "$k=$self->{hash}{$k}\n"; + } + close(F); + + if (-e $self->{filename} . "." . $suffix) { + system("rm \"" . $self->{filename} . "." . $suffix . "\""); + } +} + +sub commit_with_backup +{ + my ($self) = @_; + + # write stuff back to the file +# print $self->{filename} . "\n"; + my $hash = $self->{hash}; + my $suffix = time(); + system("mv \"" . $self->{filename} . "\" \"" . + $self->{filename} . "." . $suffix . "\""); + + open(F, ">" . $self->{filename}); + foreach my $k (sort keys %{$hash}) { + print F "$k=$self->{hash}{$k}\n"; + } + close(F); +} + +1; diff --git a/pki/base/tps/lib/perl/PKI/Base/Registry.pm b/pki/base/tps/lib/perl/PKI/Base/Registry.pm new file mode 100755 index 000000000..a4fb83f28 --- /dev/null +++ b/pki/base/tps/lib/perl/PKI/Base/Registry.pm @@ -0,0 +1,55 @@ +#!/usr/bin/perl +# +# --- BEGIN COPYRIGHT BLOCK --- +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2007 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- +# +# +# +# +package PKI::Base::Registry; + +use PKI::Base::Conf; + +my $docroot; +my $cfg; +my $parser; + +BEGIN { + $docroot = $ENV{DOCUMENT_ROOT}; + $cfg = PKI::Base::Conf->new(); + $cfg->load_file("$docroot/../conf/CS.cfg"); + $parser = new Template::Velocity($docroot); + +} + +sub get_docroot { + my ($self) = @_; + return $docroot; +} + +sub get_parser { + my ($self) = @_; + return $parser; +} + +sub get_config { + my ($self) = @_; + return $cfg; +} + +1; diff --git a/pki/base/tps/lib/perl/PKI/Service/Op.pm b/pki/base/tps/lib/perl/PKI/Service/Op.pm new file mode 100755 index 000000000..9e2a63d4f --- /dev/null +++ b/pki/base/tps/lib/perl/PKI/Service/Op.pm @@ -0,0 +1,127 @@ +# +# --- BEGIN COPYRIGHT BLOCK --- +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2007 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- +# +# +# +# + +package PKI::Service::Op; + +sub new { + my $self = {}; + bless ($self); + return $self; +} + +sub debug_log() +{ + my ($self, $cfg, $msg) = @_; + + my $date = `date`; + chomp($date); + open(DEBUG, ">>" . $cfg->get("logging.debug.filename")); + print DEBUG "$date - $msg\n"; + close(DEBUG); +} + +sub debug_params() +{ + my ($self, $cfg, $q) = @_; + + my $date = `date`; + chomp($date); + $self->debug_log($cfg, "$date - URL '" . $ENV{REQUEST_URI} . "'"); + my @names = $q->param(); + foreach my $k (@names) { + $self->debug_log($cfg, "$date - Param $k='" . $q->param($k) . "'"); + } +} + +sub process { + my ($self) = @_; +} + +sub escape_xml +{ + my ($v) = @_; + $v =~ s/\"/"/g; + $v =~ s/\'/'/g; + $v =~ s/\&/&/g; + $v =~ s/</</g; + $v =~ s/>/>/g; + return $v; +} + +sub get_xml +{ + my ($s, $v) = @_; + + my $result; + if (ref($v) eq "HASH") { + foreach my $xkey (keys %$v) { + $result .= "<" . $xkey . ">"; + $result .= &get_xml($xkey, $v{$xkey}); + # $result .= "-" . ref($xkey); + $result .= "</" . $xkey . ">"; + } + } elsif (ref($v) eq "PKI::RA::GlobalVar") { + foreach my $xkey (keys %$v) { + $result .= "<" . $xkey . ">"; + $result .= &get_xml($xkey, $$v{$xkey}->()); + # $result .= "-" . ref($xkey); + $result .= "</" . $xkey . ">"; + } + } elsif (ref($v) eq "ARRAY") { + my $pos = 0; + foreach my $item (@$v) { + $result .= "<element>"; + $result .= &get_xml("p" . $pos, $item); + # $result .= "-" . ref($item); + $result .= "</element>"; + $pos++; + } + } else { + $result .= &escape_xml($v); + } + return $result; +} + +sub xml_output { + my ($self, $c) = @_; + + my $result = "<xml>"; + foreach $s (sort keys %$c) { + if ($s =~ /^__/) { + next; + } + $result .= "<" . $s . ">"; + my $v = $$c{$s}; + $result .= &get_xml($s, $v); + $result .= "</" . $s . ">"; + } + $result .= "</xml>"; + return "$result\n"; +} + +sub execute { + my ($self) = @_; + $self->process(); +} + +1; diff --git a/pki/base/tps/lib/perl/PKI/TPS/DonePanel.pm b/pki/base/tps/lib/perl/PKI/TPS/DonePanel.pm index a99acda5a..8cf15bff6 100755 --- a/pki/base/tps/lib/perl/PKI/TPS/DonePanel.pm +++ b/pki/base/tps/lib/perl/PKI/TPS/DonePanel.pm @@ -323,6 +323,29 @@ sub display $::config->put("tps.configured", "true"); $::config->commit(); + # update httpd.conf + open(TMP_HTTPD_CONF, ">$instDir/conf/httpd.conf.tmp"); + system( "chmod 00660 $instDir/conf/httpd.conf.tmp" ); + open(HTTPD_CONF, "<$instDir/conf/httpd.conf"); + while (<HTTPD_CONF>) { + if (/^#\[ErrorDocument_404\]/) { + print TMP_HTTPD_CONF "ErrorDocument 404 /404.html\n"; + } else { + print TMP_HTTPD_CONF $_; + } + } + close(HTTPD_CONF); + close(TMP_HTTPD_CONF); + + # Create a copy of the original file which + # preserves the original file permissions + system( "cp -p $instDir/conf/httpd.conf.tmp $instDir/conf/httpd.conf" ); + + # Remove the original file only if the backup copy was successful + if( -e "$instDir/conf/httpd.conf" ) { + system( "rm $instDir/conf/httpd.conf.tmp" ); + } + # update nss.conf open(TMP_NSS_CONF, ">$instDir/conf/nss.conf.tmp"); system( "chmod 00660 $instDir/conf/nss.conf.tmp" ); diff --git a/pki/base/tps/lib/perl/PKI/TPS/TKSInfoPanel.pm b/pki/base/tps/lib/perl/PKI/TPS/TKSInfoPanel.pm index 54e1243b9..3788b4b8a 100755 --- a/pki/base/tps/lib/perl/PKI/TPS/TKSInfoPanel.pm +++ b/pki/base/tps/lib/perl/PKI/TPS/TKSInfoPanel.pm @@ -74,7 +74,10 @@ sub update &PKI::TPS::Wizard::debug_log("TKSInfoPanel: update"); my $count = $q->param('urls'); + &PKI::TPS::Wizard::debug_log("TKSInfoPanel: update - got urls = $count"); + &PKI::TPS::Wizard::debug_log("TKSInfoPanel: update - selected ca= $count"); + my $instanceID = $::config->get("service.instanceID"); my $host = ""; diff --git a/pki/base/tps/setup_package b/pki/base/tps/setup_package index 52e90fb40..f6d65cb90 100755 --- a/pki/base/tps/setup_package +++ b/pki/base/tps/setup_package @@ -148,7 +148,9 @@ PKI_WRAPPERS=${PKI_BUILD_PREFIX}/usr/${WRAPPER_DIR} PKI_SHARED_DATA=${PKI_BUILD_PREFIX}/usr/share/${PKI_PRODUCT_NAME} PKI_SUBSYSTEM_SHARED_DATA=${PKI_SHARED_DATA}/${PKI_SUBSYSTEM_NAME} PKI_SUBSYSTEM_SHARED_DOCROOT_DATA=${PKI_SHARED_DATA}/${PKI_SUBSYSTEM_NAME}/docroot +PKI_SUBSYSTEM_SHARED_PERL_BASE=${PKI_SUBSYSTEM_SHARED_DATA}/lib/perl/PKI/Base PKI_SUBSYSTEM_SHARED_PERL_MODULES=${PKI_SUBSYSTEM_SHARED_DATA}/lib/perl/PKI/TPS +PKI_SUBSYSTEM_SHARED_PERL_SERVICE=${PKI_SUBSYSTEM_SHARED_DATA}/lib/perl/PKI/Service PKI_SUBSYSTEM_SHARED_PERL_TEMPLATES=${PKI_SUBSYSTEM_SHARED_DATA}/lib/perl/Template # comply with standard FHS 2.3 start/stop script locations @@ -191,7 +193,9 @@ mkdir -p ${PKI_EXECUTABLES} mkdir -p ${PKI_SHARED_DATA} mkdir -p ${PKI_SUBSYSTEM_SHARED_DATA} mkdir -p ${PKI_SUBSYSTEM_SHARED_DOCROOT_DATA} +mkdir -p ${PKI_SUBSYSTEM_SHARED_PERL_BASE} mkdir -p ${PKI_SUBSYSTEM_SHARED_PERL_MODULES} +mkdir -p ${PKI_SUBSYSTEM_SHARED_PERL_SERVICE} mkdir -p ${PKI_SUBSYSTEM_SHARED_PERL_TEMPLATES} @@ -242,6 +246,7 @@ cp -rp ${PKI_STAGING_PATH}/alias* ${PKI_SUBSYSTEM_SHARED_DATA} cp -rp ${PKI_STAGING_PATH}/applets* ${PKI_SUBSYSTEM_SHARED_DATA} cp -rp ${PKI_STAGING_PATH}/cgi-bin* ${PKI_SUBSYSTEM_SHARED_DATA} cp -rp ${PKI_STAGING_PATH}/conf* ${PKI_SUBSYSTEM_SHARED_DATA} +cp -p ${PKI_STAGING_PATH}/docroot/index.cgi ${PKI_SUBSYSTEM_SHARED_DOCROOT_DATA} cp -p ${PKI_STAGING_PATH}/docroot/index.html ${PKI_SUBSYSTEM_SHARED_DOCROOT_DATA} cp -rp ${PKI_STAGING_PATH}/docroot/demo* ${PKI_SUBSYSTEM_SHARED_DOCROOT_DATA} cp -rp ${PKI_STAGING_PATH}/docroot/home* ${PKI_SUBSYSTEM_SHARED_DOCROOT_DATA} @@ -252,7 +257,9 @@ cp -rp ${PKI_STAGING_PATH}/docroot/tps* ${PKI_SUBSYSTEM_SHARED_DOCROOT_DA cp -rp ${PKI_STAGING_PATH}/etc* ${PKI_SUBSYSTEM_SHARED_DATA} cp -rp ${PKI_STAGING_PATH}/logs* ${PKI_SUBSYSTEM_SHARED_DATA} +cp -rp ${PKI_STAGING_PATH}/perl/base/* ${PKI_SUBSYSTEM_SHARED_PERL_BASE} cp -rp ${PKI_STAGING_PATH}/perl/modules/* ${PKI_SUBSYSTEM_SHARED_PERL_MODULES} +cp -rp ${PKI_STAGING_PATH}/perl/service/* ${PKI_SUBSYSTEM_SHARED_PERL_SERVICE} cp -rp ${PKI_STAGING_PATH}/perl/templates/* ${PKI_SUBSYSTEM_SHARED_PERL_TEMPLATES} cp -rp ${PKI_STAGING_PATH}/samples* ${PKI_SUBSYSTEM_SHARED_DATA} cp -rp ${PKI_STAGING_PATH}/scripts* ${PKI_SUBSYSTEM_SHARED_DATA} |