Author: rmeggins
Update of /cvs/dirsec/dsgw
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16950/dsgw
Modified Files:
Makefile.am config.c csearch.c dbtdsgw.h dnedit.c doauth.c
domodify.c dsgw.h dsgwutil.c emitauth.c entrydisplay.c error.c
htmlout.c htmlparse.c ldaputil.c newentry.c search.c
setup-ds-dsgw.in tutor.c unauth.c cgidbgwrapper.sh.in lang.c
aclocal.m4 configure missing install-sh Makefile.in depcomp
config.sub config.guess compile
Log Message:
Resolves: bug 435230
Description: Clean up all HTML pages (Gateway, Org Tool, Phonebook, etc)
Fix Description: This is just the first pass. I focused mainly on the
phonebook pages, but the C code fixes will apply to dsgw too.
The goal is to make the pages clean with HTML Tidy running in Firefox 2.
Most of the template pages had to change because they had comments like
this:
<!-- ----- comment -----
HTML 4.01 does not like this - no sequence of -- or more dashes in a comment.
The other major change was the use of & instead of just a single & in
URLs for href and img src links. However, javascript does not like the
encoded entities, so I had to add some code to make sure we use the
unencoded form in javascript, so I added another option called "entities"
to the html template code, and added a function that will convert
encoded entities to their raw form in place.
I'm also adding some debugging shell scripts that can be used to debug
CGI programs.
Platforms tested: RHEL5 x86_64
Flag day: Yes - autotool file changes.
Doc: none yet
Index: Makefile.am
===================================================================
RCS file: /cvs/dirsec/dsgw/Makefile.am,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Makefile.am 1 Feb 2008 16:50:12 -0000 1.17
+++ Makefile.am 6 Mar 2008 22:00:09 -0000 1.18
@@ -39,7 +39,6 @@
cookiedir=$(localstatedir)@cookiedir@
manualdir = $(datadir)@manualdir@
manualsubdir = @manualsubdir@
-gwinfodir = $(manualdir)/en/$(manualsubdir)/info
# this is the directory where the manuals will actually be installed
maninstdir = $(manualdir)/en/$(manualsubdir)
perldir = $(libdir)@perldir@
@@ -66,8 +65,7 @@
-DCONFIGDIR=\"$(configdir)\" -DSECURITYDIR=\"$(securitydir)\" \
-DCGIBINDIR=\"$(cgibindir)\" -DCONTEXTDIR=\"$(contextdir)\" \
-DINSTCONFIGDIR=\"$(instconfigdir)\" -DMANUALDIR=\"$(manualdir)\" \
- -DCGIURIBASE=\"$(cgiuri)\" -DMANUALSUBDIR=\"$(manualsubdir)\" \
- -DINFODIR=\"$(gwinfodir)\"
+ -DCGIURIBASE=\"$(cgiuri)\" -DMANUALSUBDIR=\"$(manualsubdir)\"
LIBS = @adminutil_lib@ -ladmsslutil@adminutil_ver@ -ladminutil@adminutil_ver@ \
@icu_lib@ -licui18n -licuuc -licudata \
@@ -232,9 +230,8 @@
dist_maninst_DATA = \
html/manual/a.gif html/manual/add.htm html/manual/attribua.gif html/manual/attribut.htm
html/manual/auth.htm \
html/manual/contents.html html/manual/intro.htm html/manual/mod.htm html/manual/n.gif \
- html/manual/objclass.htm html/manual/search.htm html/manual/t.gif html/manual/y.gif
html/manual/index.map
-
-dist_gwinfo_DATA = html/info/infonav.html
+ html/manual/objclass.htm html/manual/search.htm html/manual/t.gif html/manual/y.gif
html/manual/index.map \
+ html/info/infonav.html
nodist_context_DATA = dsgw-httpd.conf
nodist_sbin_SCRIPTS = setup-ds-dsgw
@@ -311,6 +308,7 @@
-e 's,@contextdir\@,$(contextdir),g' \
-e 's,@securitydir\@,$(securitydir),g' \
-e 's,@instconfigdir\@,$(instconfigdir),g' \
+ -e 's,@cookiedir\@,$(cookiedir),g' \
-e 's,@perlpath\@,$(perlpath),g' \
-e 's,@perlexec\@,@perlexec@,g' \
-e 's,@manualdir\@,$(manualdir),g' \
@@ -322,12 +320,13 @@
-e 's,@PACKAGE_BASE_VERSION\@,$(PACKAGE_BASE_VERSION),g' \
-e 's,@brand\@,$(brand),g' \
-e 's,@capbrand\@,$(capbrand),g' \
- -e 's,@vendor\@,$(vendor),g'
+ -e 's,@vendor\@,$(vendor),g' \
+ -e "s,@progname\@,$$progname,g"
if DEBUG
$(DBGSCRIPTS) : cgidbgwrapper.sh.in
if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi
- $(fixupcmd) $< > $@
+ progname=`basename $@ .sh` ; $(fixupcmd) $< > $@
endif
% : %.in
Index: config.c
===================================================================
RCS file: /cvs/dirsec/dsgw/config.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- config.c 28 Jan 2008 21:22:47 -0000 1.5
+++ config.c 6 Mar 2008 22:00:09 -0000 1.6
@@ -231,7 +231,7 @@
free( path );
if (context != NULL) {
- gc->gc_urlpfxmain = PR_smprintf("%s?context=%s&file=",
dsgw_getvp(DSGW_CGINUM_LANG), context);
+ gc->gc_urlpfxmain = PR_smprintf("%s?context=%s&file=",
dsgw_getvp(DSGW_CGINUM_LANG), context);
}
read_dsgwconfig( fname, NULL, gc->gc_admserv, 0 );
Index: csearch.c
===================================================================
RCS file: /cvs/dirsec/dsgw/csearch.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- csearch.c 27 Feb 2008 03:36:50 -0000 1.5
+++ csearch.c 6 Mar 2008 22:00:09 -0000 1.6
@@ -164,7 +164,7 @@
dsgw_emits ("\n");
} else if ( dsgw_directive_is( line, "DS_CSEARCH_SCRIPT" )) {
- dsgw_emits("<SCRIPT LANGUAGE=\"JavaScript\">\n"
+ dsgw_emits("<SCRIPT type=\"text/javascript\">\n"
"<!-- Hide from non-JavaScript-capable browsers\n"
"var searchType = '';\n"
"var searchAttr = '';\n"
Index: dbtdsgw.h
===================================================================
RCS file: /cvs/dirsec/dsgw/dbtdsgw.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dbtdsgw.h 29 Feb 2008 20:38:10 -0000 1.4
+++ dbtdsgw.h 6 Mar 2008 22:00:09 -0000 1.5
@@ -99,8 +99,8 @@
ResDef( DBT_youMayNotChangeEntriesBesidesYou_, 47, "You may not change entries
besides your own." )/*extracted from error.c*/
ResDef( DBT_problem_, 48, "Problem" )/*extracted from error.c*/
ResDef( DBT_authenticationProblem_, 49, "Authentication Problem" )/*extracted
from error.c*/
- ResDef( DBT_NPYouMustReAuthenticateBeforeCon_, 50, ".\n<P>You must
re-authenticate before continuing.\n" )/*extracted from error.c*/
- ResDef( DBT_NPYouMustReAuthenticateBeforeCon_1, 51, ".\n<P>You must
re-authenticate before continuing.\n" )/*extracted from error.c*/
+ ResDef( DBT_NPYouMustReAuthenticateBeforeCon_, 50, ".\n<BR>You must
re-authenticate before continuing.\n" )/*extracted from error.c*/
+ ResDef( DBT_NPYouMustReAuthenticateBeforeCon_1, 51, ".\n<BR>You must
re-authenticate before continuing.\n" )/*extracted from error.c*/
ResDef( DBT_unknownError_, 52, "unknown error" )/*extracted from error.c*/
ResDef( DBT_theOperationWasSuccessful_, 53, "The operation was successful."
)/*extracted from error.c*/
ResDef( DBT_anInternalErrorOccurredInTheServ_, 54, "An internal error occurred in
the server. This usually\nindicates a serious malfunction in the server and should
be\nbrought to the attention of your server administrator." )/*extracted from
error.c*/
@@ -140,19 +140,19 @@
ResDef( DBT_entryAlreadyExists_, 88, "Entry Already Exists" )/*extracted from
edit.c*/
ResDef( DBT_anEntryNamed_, 89, "An entry named " )/*extracted from edit.c*/
ResDef( DBT_onmouseoverWindowStatusClickHere_, 90,
"onMouseOver=\"window.status='Click here to view this entry'; return
true\"" )/*extracted from edit.c*/
- ResDef( DBT_alreadyExistsPPleaseChooseAnothe_, 91, " already exists.<P>Please
choose another name and/or location.\n<P>\n" )/*extracted from edit.c*/
+ ResDef( DBT_alreadyExistsPPleaseChooseAnothe_, 91, " already
exists.<BR>Please choose another name and/or location.\n<BR>\n"
)/*extracted from edit.c*/
ResDef( DBT_parentEntryDoesNotExist_, 92, "Parent entry does not exist"
)/*extracted from edit.c*/
- ResDef( DBT_youCannotAddAnEntryByTheNamePBSB_, 93, "You cannot add an entry by the
name:<P><B>%s</B>,<P>\nbecause the parent of that entry does not
exist.<P>\nBefore you can add this entry, you must first add\n" )/*extracted
from edit.c*/
+ ResDef( DBT_youCannotAddAnEntryByTheNamePBSB_, 93, "You cannot add an entry by the
name:<BR><B>%s</B>,<br>\nbecause the parent of that entry does not
exist.<br>\nBefore you can add this entry, you must first add\n" )/*extracted
from edit.c*/
ResDef( DBT_itsParentN_, 94, "its parent.\n" )/*extracted from edit.c*/
- ResDef( DBT_anEntryNamedPBSBN_, 95, "an entry
named:<P><B>%s</B>.\n" )/*extracted from edit.c*/
+ ResDef( DBT_anEntryNamedPBSBN_, 95, "an entry
named:<br><B>%s</B>.\n" )/*extracted from edit.c*/
ResDef( DBT_warningNoAuthenticationContinuin_, 96, "Warning: no authentication
(continuing)...\n" )/*extracted from domodify.c*/
ResDef( DBT_SDirectoryEntry_, 97, "%s Directory Entry" )/*extracted from
domodify.c*/
- ResDef( DBT_PreEntryDnSPrePN_, 98, "<PRE>Entry DN:
%s</PRE><P>\n" )/*extracted from domodify.c*/
+ ResDef( DBT_PreEntryDnSPrePN_, 98, "<PRE>Entry DN:
%s</PRE><br>\n" )/*extracted from domodify.c*/
ResDef( DBT_changesToBSBHaveBeenSaved_, 99, "Changes to <B>%s</B> have
been saved." )/*extracted from domodify.c*/
ResDef( DBT_BSBHasBeenAdded_, 100, "<B>%s</B> has been added."
)/*extracted from domodify.c*/
ResDef( DBT_BSBHasBeenDeleted_, 101, "<B>%s</B> has been deleted."
)/*extracted from domodify.c*/
ResDef( DBT_renamedBSBToBSB_, 102, "Renamed <B>%s</B> to
<B>%s</B>." )/*extracted from domodify.c*/
- ResDef( DBT_PBNoteBBecauseYouSTheEntryYouWer_, 103,
"<P><B>Note:</B> because you %s the entry you were \nauthenticated
as, it was necessary to discard your \nauthentication credentials. You will need to
authenticate \nagain to make additional changes.\n" )/*extracted from domodify.c*/
+ ResDef( DBT_PBNoteBBecauseYouSTheEntryYouWer_, 103,
"<br><B>Note:</B> because you %s the entry you were
\nauthenticated as, it was necessary to discard your \nauthentication credentials. You
will need to authenticate \nagain to make additional changes.\n" )/*extracted from
domodify.c*/
ResDef( DBT_deleted_, 104, "deleted" )/*extracted from domodify.c*/
ResDef( DBT_renamed_, 105, "renamed" )/*extracted from domodify.c*/
ResDef( DBT_changedThePasswordOf_, 106, "changed the password of" )/*extracted
from domodify.c*/
@@ -160,14 +160,14 @@
ResDef( DBT_TnotAsciiLdBytesN_, 108, "\tNOT ASCII (%ld bytes)\n" )/*extracted
from domodify.c*/
ResDef( DBT_noValuesWereEnteredPleaseTryAgai_, 109, "No values were entered.
Please try again.\n" )/*extracted from domodify.c*/
ResDef( DBT_noChangesWereMadeN_, 110, "No changes were made.\n" )/*extracted
from domodify.c; XXXmcs: no longer used*/
- ResDef( DBT_PSendingSToTheDirectoryServerN_, 111, "<P>Sending %s to the
directory server...\n" )/*extracted from domodify.c*/
+ ResDef( DBT_PSendingSToTheDirectoryServerN_, 111, "<br>Sending %s to the
directory server...\n" )/*extracted from domodify.c*/
ResDef( DBT_information_, 112, "information" )/*extracted from domodify.c*/
ResDef( DBT_changes_, 113, "changes" )/*extracted from domodify.c*/
- ResDef( DBT_PSuccessfullyAddedEntryN_, 114, "<P>Successfully added
entry.\n" )/*extracted from domodify.c*/
- ResDef( DBT_PSuccessfullyEditedEntryYourChan_, 115, "<P>Successfully edited
entry. Your changes have been saved.\n" )/*extracted from domodify.c*/
- ResDef( DBT_PSuccessfullyDeletedEntryN_, 116, "<P>Successfully deleted
entry.\n" )/*extracted from domodify.c*/
+ ResDef( DBT_PSuccessfullyAddedEntryN_, 114, "<br>Successfully added
entry.\n" )/*extracted from domodify.c*/
+ ResDef( DBT_PSuccessfullyEditedEntryYourChan_, 115, "<br>Successfully edited
entry. Your changes have been saved.\n" )/*extracted from domodify.c*/
+ ResDef( DBT_PSuccessfullyDeletedEntryN_, 116, "<br>Successfully deleted
entry.\n" )/*extracted from domodify.c*/
ResDef( DBT_PreTheNewNameForTheEntryIsSNPreH_, 117, "<PRE>The new name for
the entry is: %s\n</PRE><HR>\n" )/*extracted from domodify.c*/
- ResDef( DBT_PSuccessfullyRenamedEntryN_, 118, "<P>Successfully renamed
entry.\n" )/*extracted from domodify.c*/
+ ResDef( DBT_PSuccessfullyRenamedEntryN_, 118, "<br>Successfully renamed
entry.\n" )/*extracted from domodify.c*/
ResDef( DBT_youMustProvideTheOldPassword_, 119, "You must provide the old
password." )/*extracted from domodify.c*/
ResDef( DBT_youMustProvideANewPasswordPlease_, 120, "You must provide a new
password. Please try again" )/*extracted from domodify.c*/
ResDef( DBT_theNewAndConfirmingPasswordsDoNo_, 121, "The new and confirming
passwords do not match. Please try again" )/*extracted from domodify.c*/
@@ -204,8 +204,8 @@
ResDef( DBT_missingFilenameForIncludeDirecti_, 152, "Missing filename for
\"include\" directive\n" )/*extracted from config.c*/
ResDef( DBT_unknownDirectiveInConfigFileN_, 153, "Unknown directive in config
file\n" )/*extracted from config.c*/
ResDef( DBT_EraseDbCouldNotOpenLcacheConfFil_, 154, "<= erase_db could not open
lcache.conf file \"%s\"\n" )/*extracted from config.c*/
- ResDef( DBT_FontSize1NPTheDatabaseHasBeenDel_, 155, "<FONT
SIZE=\"+1\">\n<P>The database has been deleted. Creating new
database... \n</FONT>\n " )/*extracted from config.c*/
- ResDef( DBT_FontSize1NPTheDatabaseCouldNotBe_, 156, "<FONT
SIZE=\"+1\">\n<P>The database could not be deleted \n</FONT>\n
" )/*extracted from config.c*/
+ ResDef( DBT_FontSize1NPTheDatabaseHasBeenDel_, 155, "<FONT
SIZE=\"+1\">\n<br>The database has been deleted. Creating new
database... \n</FONT>\n " )/*extracted from config.c*/
+ ResDef( DBT_FontSize1NPTheDatabaseCouldNotBe_, 156, "<FONT
SIZE=\"+1\">\n<br>The database could not be deleted \n</FONT>\n
" )/*extracted from config.c*/
ResDef( DBT_AppSuffixCouldNotOpenLdifFileSN_, 157, "<= app_suffix could not open
ldif file \"%s\"\n" )/*extracted from config.c*/
ResDef( DBT_AppSuffixCouldNotOpenTmpFileSN_, 158, "<= app_suffix could not open
tmp file \"%s\"\n" )/*extracted from config.c*/
ResDef( DBT_unableToRenameSToS_, 159, "Unable to rename %s to %s" )/*extracted
from config.c*/
@@ -362,7 +362,7 @@
ResDef( DBT_YouAreNowAuthenticated_, 315, "You are now authenticated to the
directory as <B>%s</B>." )/*extracted from doauth.c*/
ResDef( DBT_YourAuthenticationCredentialsWill_, 316, "Your authentication
credentials will expire in %d minutes.\n" )/*extracted from doauth.c*/
ResDef( DBT_AfterYourCredentialsExpire_, 317, "After your credentials expire, you
will need to \nre-authenticate to the directory.\n" )/*extracted from doauth.c*/
- ResDef( DBT_ThePasswordForThisEntryWillExpire_, 318, "<P>The password for
this entry will expire <B>%s</B>.\n" )/*extracted from doauth.c*/
+ ResDef( DBT_ThePasswordForThisEntryWillExpire_, 318, "<br>The password for
this entry will expire <B>%s</B>.\n" )/*extracted from doauth.c*/
ResDef( DBT_AuthenticationFailedBecause_, 319, "Authentication failed because"
)/*extracted from doauth.c*/
ResDef( DBT_AuthEntryNotExist_, 320, "Authentication failed because the entry you
attempted to authenticate as does\nnot exist in the directory.\nYou may only authenticate
as an existing directory\nentry.\n")/*extracted from doauth.c*/
ResDef( DBT_AuthEntryHasNoPassword_, 321, "Authentication failed because the entry
you attempted to authenticate as does\nnot have a password. Before you can
authenticate\nas this entry, a password must be set by a\ndirectory
administrator\n")/*extracted from doauth.c*/
Index: dnedit.c
===================================================================
RCS file: /cvs/dirsec/dsgw/dnedit.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- dnedit.c 27 Feb 2008 03:36:50 -0000 1.5
+++ dnedit.c 6 Mar 2008 22:00:09 -0000 1.6
@@ -96,7 +96,7 @@
/* Send the top-level document HTML */
dsgw_emits( "<HTML>\n"
- "<SCRIPT LANGUAGE=\"JavaScript\">\n" );
+ "<SCRIPT type=\"text/javascript\">\n" );
dsgw_emitf( "var emptyFrame = '';\n" );
dsgw_emitf( "var attrname = '%s';\n", attrname );
/*
@@ -393,7 +393,7 @@
"<FRAMESET BORDER=1 FRAMEBORDER=1 ROWS=230,*,0,0 "
"SCROLLING=\"NO\" NORESIZE onLoad=\"genOutputFrame"
"(this.outputFrame, this.dnlist);\">\n" );
- dsgw_emitf( " <FRAME
SRC=\"%s?tmplname=%s&dn=%s&context=%s&DNATTR=%s&"
+ dsgw_emitf( " <FRAME
SRC=\"%s?tmplname=%s&dn=%s&context=%s&DNATTR=%s&"
"DNDESC=%s\" NAME=\"controlFrame\"
SCROLLING=\"no\">\n",
dsgw_getvp( DSGW_CGINUM_EDIT ), tmplname, edn, context, attrname,
attrdesc );
Index: doauth.c
===================================================================
RCS file: /cvs/dirsec/dsgw/doauth.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- doauth.c 27 Feb 2008 03:36:50 -0000 1.4
+++ doauth.c 6 Mar 2008 22:00:09 -0000 1.5
@@ -187,11 +187,13 @@
/* Construct a success message */
dsgw_send_header();
+ dsgw_emits( "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML
4.01//EN\"\n" );
+ dsgw_emits( " \"http://www.w3.org/TR/html4/strict.dtd\">\n"
);
dsgw_emits( "<HTML>" );
dsgw_head_begin();
dsgw_emits( "\n"
"<TITLE>Authentication Successful</TITLE>\n"
- "<SCRIPT LANGUAGE=\"JavaScript\">\n"
+ "<SCRIPT type=\"text/javascript\">\n"
"<!-- Hide from non-JavaScript browsers\n" );
if ( authdesturl != NULL && strlen( authdesturl ) > 0 ) {
@@ -256,8 +258,11 @@
XP_GetClientStr( DBT_continue_4 ));
}
dsgw_emit_helpbutton( "AUTHSUCCESS" );
- dsgw_emits(
- "\n</TABLE></FORM>");
+ dsgw_emits( "\n<" );
+ dsgw_fputn(stdout, "\\", 1); /* only way to emit a single \ in a javascript
quote */
+ dsgw_emits("/TABLE><");
+ dsgw_fputn(stdout, "\\", 1); /* only way to emit a single \ in a javascript
quote */
+ dsgw_emits("/FORM>\n");
dsgw_quotation_end(); dsgw_emits(";\n");
dsgw_emits(
@@ -271,8 +276,11 @@
dsgw_emit_homebutton();
dsgw_emits( "\n<TD ALIGN=CENTER WIDTH=50%%>" );
dsgw_emit_helpbutton( "AUTHSUCCESS" );
- dsgw_emits(
- "\n</TABLE></FORM>\n");
+ dsgw_emits( "\n<" );
+ dsgw_fputn(stdout, "\\", 1); /* only way to emit a single \ in a javascript
quote */
+ dsgw_emits("/TABLE><");
+ dsgw_fputn(stdout, "\\", 1); /* only way to emit a single \ in a javascript
quote */
+ dsgw_emits("/FORM>\n");
dsgw_quotation_end(); dsgw_emits(";\n");
dsgw_emitf(
@@ -294,7 +302,7 @@
#else
dsgw_emitf( XP_GetClientStr( DBT_YouAreNowAuthenticated_ ), binddn );
#endif
- dsgw_emits( "<P>\n" );
+ dsgw_emits( "<BR>\n" );
#ifdef NOTFORNOW
free( ufn );
#endif
@@ -313,13 +321,12 @@
dsgw_emitf(
XP_GetClientStr( DBT_ThePasswordForThisEntryWillExpire_ ),
asctime( pw_exp_time_tm ));
- dsgw_emits( "<P>\n" );
+ dsgw_emits( "<BR>\n" );
}
dsgw_emits(
- "<P>\n"
- "<TR>\n"
- "<SCRIPT LANGUAGE=\"JavaScript\">\n"
+ "<BR>\n"
+ "<SCRIPT type=\"text/javascript\">\n"
"<!-- Hide from non-JavaScript browsers\n"
"if ( authdesturl != null ) {\n"
" document.write( contButtons );\n"
@@ -342,6 +349,8 @@
do_autherror( int rc, char *msg, char *lderrtxt, int omitclosebutton )
{
dsgw_send_header();
+ dsgw_emits( "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML
4.01//EN\"\n" );
+ dsgw_emits( " \"http://www.w3.org/TR/html4/strict.dtd\">\n"
);
dsgw_emits( "<HTML>" );
dsgw_head_begin();
dsgw_emitf( "\n"
@@ -354,7 +363,7 @@
dsgw_emits(
"</FONT>\n"
"</CENTER>\n"
- "<P>\n");
+ "<BR>\n");
if ( msg != NULL ) {
dsgw_emitf( "%s %s\n",
XP_GetClientStr( DBT_AuthenticationFailedBecause_ ),
@@ -387,8 +396,8 @@
if ( lderrtxt != NULL ) {
dsgw_emitf( "<BR>(%s)", lderrtxt );
}
- dsgw_emits( "<P>\n" );
- dsgw_form_begin( NULL, NULL );
+ dsgw_emits( "<BR>\n" );
+ dsgw_form_begin( NULL, "action=\"javascript:void();\"" );
dsgw_emits(
"\n"
"<TABLE BORDER=2 WIDTH=100%%>\n"
Index: domodify.c
===================================================================
RCS file: /cvs/dirsec/dsgw/domodify.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- domodify.c 19 Feb 2008 15:20:21 -0000 1.3
+++ domodify.c 6 Mar 2008 22:00:09 -0000 1.4
@@ -317,7 +317,7 @@
}
/* output JavaScript to clear the cookie in the user's browser */
- dsgw_emits( "<SCRIPT LANGUAGE=\"JavaScript\">\n" );
+ dsgw_emits( "<SCRIPT type=\"text/javascript\">\n" );
dsgw_emits( "<!-- Hide from non-JavaScript browsers\n" );
dsgw_emitf( "document.cookie = '%s=%s; path=/'\n",
DSGW_AUTHCKNAME, DSGW_UNAUTHSTR );
@@ -341,7 +341,7 @@
entry_name_js = dsgw_escape_quotes( entry_name );
new_name_js = dsgw_escape_quotes( new_name );
- dsgw_emits( "<SCRIPT LANGUAGE=\"JavaScript\">\n" );
+ dsgw_emits( "<SCRIPT type=\"text/javascript\">\n" );
dsgw_emits( "dsmodify_info = '" );
dsgw_emitf( success_msg, entry_name_js, new_name_js );
dsgw_emits( "';\n" );
@@ -359,7 +359,7 @@
if (( jscomp == NULL || changetype == DSGW_CHANGETYPE_DELETE )
&& !gc->gc_admserv ) {
- dsgw_form_begin( NULL, NULL );
+ dsgw_form_begin( NULL, "action=\"javascript:void();\"" );
dsgw_emits( "\n<CENTER><TABLE border=2
width=\"100%\"><TR>\n" );
/*
* Show framed button. If the modify succeeded, it is "Close".
Index: dsgw.h
===================================================================
RCS file: /cvs/dirsec/dsgw/dsgw.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- dsgw.h 27 Feb 2008 03:36:50 -0000 1.8
+++ dsgw.h 6 Mar 2008 22:00:09 -0000 1.9
@@ -121,7 +121,7 @@
#define DSGW_CONTEXTDIR_HTTP (getenv("DSGW_CONTEXT_DIR") ?
getenv("DSGW_CONTEXT_DIR") : CONTEXTDIR)
#define DSGW_HTMLDIR HTMLDIR
#define DSGW_MANROOT MANUALDIR "/"
-#define DSGW_MANSUBDIR MANUALSUBDIR "/"
+#define DSGW_MANSUBDIR MANUALSUBDIR
#define DSGW_MANUALSHORTCUT ".MANUAL"
#define DSGW_MANUALSHORTCUT_LEN 7
@@ -803,6 +803,7 @@
void dsgw_emit_confirm_script();
char *dsgw_build_urlprefix();
+char *dsgw_build_urlprefix_ext(int unescaped);
void dsgw_init_searchprefs( struct ldap_searchobj **solistp );
void dsgw_addtemplate( dsgwtmpl **tlpp, char *template, int count,
char **ocvals );
@@ -874,6 +875,7 @@
;
#endif
char *dsgw_strdup_with_entities( char *s, int *madecopyp );
+void dsgw_convert_entities( char *s );
void dsgw_HTML_emits( char * );
void dsgw_emit_cgi_var( int argc, char **argv );
void dsgw_emit_button( int argc, char **argv, const char* format, ... )
Index: dsgwutil.c
===================================================================
RCS file: /cvs/dirsec/dsgw/dsgwutil.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- dsgwutil.c 27 Feb 2008 03:36:50 -0000 1.10
+++ dsgwutil.c 6 Mar 2008 22:00:09 -0000 1.11
@@ -636,9 +636,9 @@
dsgw_emitf( "<INPUT TYPE=\"button\" VALUE=\"%s\"
onClick=\""
"if ( top.helpwin ) {"
" top.helpwin.focus();"
- "
top.helpwin.infotopic.location='%s?tutor=!%s&context=%s';"
+ "
top.helpwin.infotopic.location='%s?tutor=!%s&context=%s';"
"} else {"
- " window.open('%s?tutor=%s&context=%s',
'infowin_dsgw', "
+ " window.open('%s?tutor=%s&context=%s',
'infowin_dsgw', "
" 'resizable=1,width=400,height=500');"
"}\">\n",
XP_GetClientStr(DBT_help_1), tutorvp, topic, context,
@@ -654,14 +654,34 @@
char *
dsgw_build_urlprefix()
{
+ return dsgw_build_urlprefix_ext(0);
+}
+
+/*
+ * Return malloc'd URL prefix that consists of:
+ * prefix + '/' + HOST:PORT + '/' (not anymore - RJP)
+ * prefix + ? + context=CONTEXT&hp=HOST:PORT&dn=
+ * By default, the URL will be HTML escaped for use as regular
+ * href or src values in plain old HTML. The optional argument
+ * is used if the url will be used in javascript - in which
+ * case, the html will not be escaped e.g.
+ * escaped - url=search?context=pb&dn=foo
+ * unescaped for js - url=search?context=pb&dn=foo
+ */
+char *
+dsgw_build_urlprefix_ext(int unescaped)
+{
char *prefix = dsgw_getvp( DSGW_CGINUM_DOSEARCH );
char *urlprefix;
- urlprefix = PR_smprintf("%s?context=%s&dn=", prefix, context);
+ if (unescaped) {
+ urlprefix = PR_smprintf("%s?context=%s&dn=", prefix, context);
+ } else {
+ urlprefix = PR_smprintf("%s?context=%s&dn=", prefix, context);
+ }
return( urlprefix );
}
-
void
dsgw_addtemplate( dsgwtmpl **tlpp, char *template, int count, char **ocvals )
{
@@ -995,7 +1015,7 @@
dsgw_emits( "\n"
"<TITLE>Password Expired</TITLE>\n"
- "<SCRIPT LANGUAGE=\"JavaScript\">\n"
+ "<SCRIPT type=\"text/javascript\">\n"
"<!-- Hide from non-JavaScript browsers\n" );
if ( encodeddn != NULL && strlen( encodeddn ) > 0 ) {
@@ -1064,7 +1084,7 @@
dsgw_emits( XP_GetClientStr( DBT_YouMustChangeYourPasswd_ ));
dsgw_emits( "<P>\n"
"<TR>\n"
- "<SCRIPT LANGUAGE=\"JavaScript\">\n"
+ "<SCRIPT type=\"text/javascript\">\n"
"<!-- Hide from non-JavaScript browsers\n"
"if ( editdesturl != null ) {\n"
" document.write( contButtons );\n"
Index: emitauth.c
===================================================================
RCS file: /cvs/dirsec/dsgw/emitauth.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- emitauth.c 27 Feb 2008 03:36:50 -0000 1.3
+++ emitauth.c 6 Mar 2008 22:00:09 -0000 1.4
@@ -158,7 +158,7 @@
dsgw_emits ("\n");
} else if ( dsgw_directive_is( line, "DS_AUTH_SEARCH_SCRIPT" )) {
- dsgw_emits ("<SCRIPT NAME=\"JavaScript\">\n"
+ dsgw_emits ("<SCRIPT type=\"text/javascript\">\n"
"<!-- Hide from non-JavaScript browsers\n"
"function doUnauth()\n"
"{\n");
@@ -242,7 +242,7 @@
}
} else if ( dsgw_directive_is( line, "DS_AUTH_PASSWORD_SCRIPT" )) {
- dsgw_emits ("<SCRIPT NAME=\"JavaScript\">\n"
+ dsgw_emits ("<SCRIPT type=\"text/javascript\">\n"
"<!-- Hide from non-JavaScript browsers\n");
/* doUnauth function - invoke CGI which tosses cookies. */
dsgw_emitf ("function doUnauth()\n"
Index: entrydisplay.c
===================================================================
RCS file: /cvs/dirsec/dsgw/entrydisplay.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- entrydisplay.c 28 Feb 2008 22:17:26 -0000 1.8
+++ entrydisplay.c 6 Mar 2008 22:00:09 -0000 1.9
@@ -88,6 +88,7 @@
#define DSGW_ATTROPT_HEX 0x00000400 /* display as hex value */
#define DSGW_ATTROPT_DECIMAL 0x00000800 /* display as decimal value */
#define DSGW_ATTROPT_QUOTED 0x00001000 /* quote the result */
+#define DSGW_ATTROPT_ENTITIES 0x00002000 /* force the use of entities e.g. urls in
javascript */
#define DSGW_ATTROPT_EDITABLE 0x10000000 /* not exposed in HTML */
#define DSGW_ATTROPT_ADDING 0x20000000 /* not exposed in HTML */
#define DSGW_ATTROPT_LINK2EDIT 0x40000000 /* not exposed in HTML */
@@ -105,6 +106,7 @@
"hex",
"decimal",
"quoted",
+ "entities",
NULL
};
@@ -122,6 +124,7 @@
DSGW_ATTROPT_HEX,
DSGW_ATTROPT_DECIMAL,
DSGW_ATTROPT_QUOTED,
+ DSGW_ATTROPT_ENTITIES,
};
@@ -720,25 +723,14 @@
free( tip );
}
-
static void
-output_prelude( dsgwtmplinfo *tip )
+output_prelude_script( dsgwtmplinfo *tip )
{
int editable, adding;
- char *line, *encodeddn;
-
- if ( tip->dsti_preludelines != NULL ) { /* output the prelude */
- dsgw_savelines_rewind( tip->dsti_preludelines );
- while (( line = dsgw_savelines_next( tip->dsti_preludelines ))
- != NULL ) {
- output_nonentry_line( tip, line );
- }
- dsgw_savelines_free( tip->dsti_preludelines );
- tip->dsti_preludelines = NULL;
- }
+ char *encodeddn;
/* output any JavaScript functions we want to include before the entry */
- dsgw_emits( "<SCRIPT LANGUAGE=\"JavaScript\">\n" );
+ dsgw_emits( "<SCRIPT type=\"text/javascript\">\n" );
dsgw_emits( "<!-- Hide from non-JavaScript-capable browsers\n" );
dsgw_emits( "var emptyFrame = '';\n" );
editable = ( tip->dsti_options & DSGW_DISPLAY_OPT_EDITABLE ) != 0;
@@ -746,8 +738,8 @@
if ( !editable ) {
char *urlprefix = dsgw_ch_malloc( strlen(gc->gc_urlpfxmain) + 128);
-
sprintf(urlprefix, "%semptyFrame.html", gc->gc_urlpfxmain);
+ dsgw_convert_entities(urlprefix);
/* include the functions used to support "Edit" buttons */
/* function haveAuthCookie() */
@@ -877,6 +869,35 @@
dsgw_emits( "// End hiding -->\n</SCRIPT>\n" );
}
+/*
+ Try to output our prelude javascript with any other javascript defined
+ in the template prelude section - if there is none, just output
+ the javascript prelude at the end of the prelude section
+*/
+static void
+output_prelude( dsgwtmplinfo *tip )
+{
+ char *line;
+
+ if ( tip->dsti_preludelines != NULL ) { /* output the prelude */
+ int did_output_prelude_script = 0;
+ dsgw_savelines_rewind( tip->dsti_preludelines );
+ while (( line = dsgw_savelines_next( tip->dsti_preludelines ))
+ != NULL ) {
+ if (!did_output_prelude_script && PL_strcasestr(line,
"<script")) {
+ output_prelude_script( tip );
+ did_output_prelude_script = 1;
+ }
+ output_nonentry_line( tip, line );
+ }
+ dsgw_savelines_free( tip->dsti_preludelines );
+ tip->dsti_preludelines = NULL;
+ if (!did_output_prelude_script) {
+ output_prelude_script( tip );
+ }
+ }
+}
+
static void
output_nonentry_line( dsgwtmplinfo *tip, char *line )
@@ -1027,8 +1048,9 @@
* instead of passing the host:port to use
*/
char *urlprefix, *escapeddn, *mimetype, *prefix, *suffix;
+ const char *amp = (options & DSGW_ATTROPT_ENTITIES) ? "&" :
"&";
- urlprefix = dsgw_build_urlprefix();
+ urlprefix = dsgw_build_urlprefix_ext(options & DSGW_ATTROPT_ENTITIES);
escapeddn = dsgw_strdup_escaped( dn );
mimetype = get_arg_by_name( DSGW_ATTRARG_MIMETYPE, argc, argv );
if (( prefix = get_arg_by_name( "prefix", argc, argv )) == NULL ) {
@@ -1041,8 +1063,10 @@
/* XXXmcs
* always reference first value for now ( "&0" ) unless returning
* link to a vCard (in which case we leave the &0 off)
+ * have to encode & in ldq as %26
*/
- dsgw_emitf("%s\"%s%s&ldq=%s%%26%s%s\"%s\n", prefix, urlprefix,
escapeddn, attr,
+ dsgw_emitf("%s\"%s%s%sldq=%s%%26%s%s\"%s\n", prefix, urlprefix,
escapeddn, amp,
+ attr,
( mimetype == NULL ) ? "" : mimetype,
( strcasecmp( "_vcard", attr ) == 0 ) ? "" : "%260",
suffix );
free( urlprefix );
@@ -2013,7 +2037,7 @@
}
if (( adip->adi_opts & DSGW_ATTROPT_LINK2EDIT ) != 0 ) {
- urlprefix = PR_smprintf("%s?context=%s&dn=",
+ urlprefix = PR_smprintf("%s?context=%s&dn=",
dsgw_getvp( DSGW_CGINUM_EDIT ), context);
} else {
urlprefix = dsgw_build_urlprefix();
@@ -2108,7 +2132,7 @@
/* Output a javascript array of values for this attribute */
if (( adip->adi_opts & DSGW_ATTROPT_DNPICKER ) != 0 ) {
- dsgw_emits( "<SCRIPT LANGUAGE=\"JavaScript\">\n" );
+ dsgw_emits( "<SCRIPT type=\"text/javascript\">\n" );
dsgw_emits( "<!-- Hide from non-JavaScript-capable browsers\n" );
dsgw_emitf( "var %s_values = new Object;\n", adip->adi_attr );
for ( i = 0; adip->adi_vals != NULL && adip->adi_vals[ i ] != NULL; ++i )
{
Index: error.c
===================================================================
RCS file: /cvs/dirsec/dsgw/error.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- error.c 9 Feb 2008 18:23:38 -0000 1.3
+++ error.c 6 Mar 2008 22:00:09 -0000 1.4
@@ -257,7 +257,7 @@
if (ckrc != DSGW_CKDB_KEY_NOT_PRESENT && !skipauthwarning) {
dsgw_send_header();
dsgw_emit_alertForm();
- dsgw_emits( "<SCRIPT LANGUAGE=JavaScript><!--\n" );
+ dsgw_emits( "<SCRIPT type=\"text/javascript\"><!--\n"
);
dsgw_emit_alert (NULL, NULL, dsgw_err2string( ckrc ),
0L, "", "", "");
dsgw_emits( "// -->\n</SCRIPT>\n");
@@ -268,7 +268,7 @@
dsgw_html_begin( XP_GetClientStr(DBT_authenticationProblem_), 1 );
- dsgw_emits( "<SCRIPT LANGUAGE=\"JavaScript\">\n<!--
hide\n\n" );
+ dsgw_emits( "<SCRIPT type=\"text/javascript\">\n<!--
hide\n\n" );
dsgw_emitf( "document.cookie = '%s=%s; path=/';\n\n",
DSGW_AUTHCKNAME,
DSGW_UNAUTHSTR );
Index: htmlout.c
===================================================================
RCS file: /cvs/dirsec/dsgw/htmlout.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- htmlout.c 27 Feb 2008 03:36:50 -0000 1.4
+++ htmlout.c 6 Mar 2008 22:00:09 -0000 1.5
@@ -94,11 +94,15 @@
static int header_done = 0;
if ( !header_done ) {
+ dsgw_emits( "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML
4.01//EN\"\n" );
+ dsgw_emits( " \"http://www.w3.org/TR/html4/strict.dtd\">\n"
);
dsgw_emits( "<HTML>" );
dsgw_head_begin();
dsgw_emits( "\n" );
if ( title != NULL ) {
dsgw_emitf( "<TITLE>%s</TITLE>\n", title );
+ } else { /* html title element is required */
+ dsgw_emitf( "<TITLE>TITLE</TITLE>\n" );
}
dsgw_emitf( "</HEAD>\n<BODY %s>\n", dsgw_html_body_colors );
} else {
@@ -146,10 +150,10 @@
int freenewlabel;
if ( urlprefix == NULL ) {
- dsgw_emits( "<A HREF=" );
+ dsgw_emits( "<A HREF=\"" );
escaped_url = NULL;
} else {
- dsgw_emitf( "<A HREF=%s", urlprefix );
+ dsgw_emitf( "<A HREF=\"%s", urlprefix );
escaped_url = dsgw_ch_malloc( 3 * strlen( url ) + 1 );
*escaped_url = '\0';
dsgw_strcat_escaped( escaped_url, url );
@@ -161,6 +165,7 @@
} else {
dsgw_emits( url );
}
+ dsgw_emits("\""); /* close quote in a href above */
if ( extra != NULL ) {
dsgw_emits( " " );
@@ -265,6 +270,7 @@
static char *specials = "&\"<>";
static char *entities[] = { "&", """,
"<", ">" };
static int entitylen[] = { 5, 6, 4, 4 };
+static int entitynum = sizeof(entities)/sizeof(entities[0]);
char *
dsgw_strdup_with_entities( char *s, int *madecopyp )
@@ -310,6 +316,47 @@
return( d );
}
+/* this will convert a string with escaped entities ("&")
+ back to the original unescaped string ("&")
+ This is necessary for converting URLs which would normally
+ have entities in them (e.g. search?context=foo&dn=bar)
+ for use in javascript (e.g. window.href = 'search?context=foo&dn=bar')
+ since javascript must use the unescaped version
+ This converts the string in place since the entities "&"
+ take up much more room than the single character represented
+ If you need to work on a copy then make a copy with strdup first.
+*/
+void
+dsgw_convert_entities(char *s)
+{
+ int spcount, idx;
+ char *p, *q, *r, *d;
+
+ if (!s || !*s) {
+ return;
+ }
+
+ d = r = s;
+ for ( p = s; *p != '\0'; LDAP_UTF8INC( p )) {
+ if ( ((*p) & 0x80) == 0 && ( (*p) == '&') ) {
+ for( idx = 0; idx < entitynum; ++idx ) {
+ if (!strncmp(p, entities[ idx ], entitylen[ idx ])) {
+ break;
+ }
+ }
+ if (idx < entitynum) {
+ *r = specials[idx];
+ ++r;
+ p += entitylen[ idx ]-1; /* the 1 will be added in the for loop */
+ } else {
+ r += LDAP_UTF8COPY( r, p );
+ }
+ } else {
+ r += LDAP_UTF8COPY( r, p );
+ }
+ }
+ *r = '\0';
+}
void
dsgw_form_begin( const char* name, const char* format, ... )
@@ -488,7 +535,7 @@
msg = XP_GetClientStr(key);
- dsgw_emits( "<SCRIPT LANGUAGE=\"JavaScript\">\n" );
+ dsgw_emits( "<SCRIPT type=\"text/javascript\">\n" );
switch (key) {
case DBT_completionJavascriptAdd:
dsgw_emits(msg);
@@ -539,7 +586,7 @@
yes = XP_GetClientStr(yes_key);
- dsgw_emitf ("<SCRIPT LANGUAGE=JavaScript><!--\n"
+ dsgw_emitf ("<SCRIPT type=\"text/javascript\"><!--\n"
"function OK() {\n");
if (yes) dsgw_emitf (" %s\n", yes);
dsgw_emits (" top.close();\n"
Index: htmlparse.c
===================================================================
RCS file: /cvs/dirsec/dsgw/htmlparse.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- htmlparse.c 27 Feb 2008 03:36:50 -0000 1.3
+++ htmlparse.c 6 Mar 2008 22:00:09 -0000 1.4
@@ -436,7 +436,7 @@
dsgw_submit(int verify, char **vars)
{
if(verify) {
- dsgw_emits ("<SCRIPT language=JavaScript><!--\n"
+ dsgw_emits ("<SCRIPT
type=\"text/javascript\"><!--\n"
"function verify(form)\n{\n"
" window.confirmedForm = form;\n");
dsgw_emit_confirm (NULL, "CONFIRMVALUE5", NULL /* no */,
@@ -476,9 +476,6 @@
dsgw_emits("</tr></table></center>\n");
dsgw_emits("</form>\n");
-
- dsgw_emits("<SCRIPT language=JavaScript>\n");
- dsgw_emits("</SCRIPT>\n");
}
@@ -503,9 +500,6 @@
dsgw_emits("</tr></table></center>\n");
dsgw_emits("</form>\n");
-
- dsgw_emits("<SCRIPT language=JavaScript>\n");
- dsgw_emits("</SCRIPT>\n");
}
@@ -605,7 +599,7 @@
emit_alert_noentries()
{
dsgw_emit_alertForm();
- dsgw_emits( "<SCRIPT LANGUAGE=JavaScript><!--\n" );
+ dsgw_emits( "<SCRIPT
LANGUAGE=\"text/javascript\"><!--\n" );
dsgw_emit_alert (NULL, NULL, XP_GetClientStr(DBT_SearchFound0Entries_),
0L, "", "", "");
dsgw_emits( "// -->\n</SCRIPT>\n");
Index: ldaputil.c
===================================================================
RCS file: /cvs/dirsec/dsgw/ldaputil.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ldaputil.c 27 Feb 2008 03:36:50 -0000 1.4
+++ ldaputil.c 6 Mar 2008 22:00:09 -0000 1.5
@@ -737,7 +737,7 @@
char **xdn;
char **sn;
- dsgw_emits( "<SCRIPT LANGUAGE=\"JavaScript\">\n" );
+ dsgw_emits( "<SCRIPT type=\"text/javascript\">\n" );
dsgw_emits( "var dnlist = new Array;\n" );
for ( i = 0, entry = ldap_first_entry( ld, msgp ); entry != NULL;
i++, entry = ldap_next_entry( ld, entry )) {
@@ -779,7 +779,7 @@
} else {
/* Count <= 0 */
if ( options & DSGW_DISPLAY_OPT_DNLIST_JS ) {
- dsgw_emitf( "<SCRIPT LANGUAGE=\"JavaScript\">\n" );
+ dsgw_emitf( "<SCRIPT type=\"text/javascript\">\n" );
dsgw_emitf( "var dnlist = new Array;\n" );
dsgw_emitf( "dnlist.count = 0;\n" );
dsgw_emitf( "</SCRIPT>\n" );
Index: newentry.c
===================================================================
RCS file: /cvs/dirsec/dsgw/newentry.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- newentry.c 27 Feb 2008 03:36:50 -0000 1.3
+++ newentry.c 6 Mar 2008 22:00:09 -0000 1.4
@@ -59,7 +59,7 @@
dsgw_emits ("\n");
} else if ( dsgw_directive_is( line, "DS_NEWENTRY_SCRIPT" )) {
- dsgw_emits ("<SCRIPT LANGUAGE=\"JavaScript\">\n"
+ dsgw_emits ("<SCRIPT type=\"text/javascript\">\n"
"<!-- Hide from non-JavaScript-capable browsers\n"
"var selectedType = -1;\n"
"\n"
@@ -270,7 +270,7 @@
edn = dsgw_strdup_escaped (dn);
free(dn);
- newurl = PR_smprintf(DSGW_URLPREFIX_CGI_HTTP
"%s?tmplname=%s&context=%s&ADD=1&dn=%s",
+ newurl = PR_smprintf(DSGW_URLPREFIX_CGI_HTTP
"%s?tmplname=%s&context=%s&ADD=1&dn=%s",
dsgw_getvp( DSGW_CGINUM_EDIT ), entryType, context, edn);
free(edn);
Index: search.c
===================================================================
RCS file: /cvs/dirsec/dsgw/search.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- search.c 27 Feb 2008 03:36:50 -0000 1.3
+++ search.c 6 Mar 2008 22:00:09 -0000 1.4
@@ -109,7 +109,7 @@
dsgw_head_begin();
dsgw_emits ("\n");
} else if ( dsgw_directive_is( line, "DS_SEARCH_SCRIPT" )) {
- dsgw_emits ("<SCRIPT LANGUAGE=\"JavaScript\">\n"
+ dsgw_emits ("<SCRIPT type=\"text/javascript\">\n"
"<!-- Hide from non-JavaScript-capable browsers\n"
"\n"
"function validate(sform)\n"
Index: setup-ds-dsgw.in
===================================================================
RCS file: /cvs/dirsec/dsgw/setup-ds-dsgw.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- setup-ds-dsgw.in 1 Feb 2008 16:50:12 -0000 1.5
+++ setup-ds-dsgw.in 6 Mar 2008 22:00:09 -0000 1.6
@@ -65,6 +65,7 @@
securitydir="@securitydir@"
defaultsecdir=1
httpdconf="@httpdconf@"
+cookiedir="@cookiedir@"
# see if there is a $dsgwconfigdir/../admin-serv
admservdir=$basecfgdir/admin-serv
@@ -86,6 +87,14 @@
dsgwuser=`ls -l $admservdir/local.conf | awk '{print $3}'`
dsgwgroup=`ls -l $admservdir/local.conf | awk '{print $4}'`
echo Using Administration Server URL $httpurl . . .
+else
+ echo
+ echo
'########################################################################'
+ echo Error: It appears the Administration Server has not yet been configured.
+ echo There are configuration files missing from $admservdir
+ echo Please run setup-ds-admin.pl to create your Administration Server
+ echo then run this script again.
+ exit 1
fi
# see if there are any directory servers here
@@ -235,6 +244,13 @@
chown $dsgwuser:$dsgwgroup $dsgwconfigdir/default.conf
chmod 0400 $dsgwconfigdir/default.conf
+echo Generating the credential database directory . . .
+if [ ! -d "$cookiedir" ] ; then
+ mkdir -p "$cookiedir"
+fi
+chown $dsgwuser:$dsgwgroup "$cookiedir"
+chmod 0700 "$cookiedir"
+
# tell Apache about the dsgw - must restart Apache
echo Adding configuration to httpd config file $httpdconf . . .
grep dsgw-httpd.conf "$httpdconf" > /dev/null 2>&1 || (echo
"" ; echo "# DSGW configuration" ; echo "Include
$dsgwconfigdir/dsgw-httpd.conf") >> $httpdconf
Index: tutor.c
===================================================================
RCS file: /cvs/dirsec/dsgw/tutor.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- tutor.c 16 Jan 2008 22:56:02 -0000 1.3
+++ tutor.c 6 Mar 2008 22:00:09 -0000 1.4
@@ -46,45 +46,7 @@
#include "dsgw.h"
#define BASE_MAN_DIRECTORY "manual/"
-#define BASE_INFO_DIRECTORY "info/"
#define HELP_INDEX_HTML "index.html"
-/*#define MANUAL_HPATH "bin/lang?file=" DSGW_MANUALSHORTCUT "/"*/
-
-/* Copied from ldapserver/lib/base/util.c */
-static int
-my_util_uri_is_evil(char *t)
-{
- register int x;
-
- for(x = 0; t[x]; ++x) {
- if(t[x] == '/') {
- if(t[x+1] == '/')
- return 1;
- if(t[x+1] == '.') {
- switch(t[x+2]) {
- case '.':
- if((!t[x+3]) || (t[x+3] == '/'))
- return 1;
- case '/':
- case '\0':
- return 1;
- }
- }
- }
-#ifdef XP_WIN32
- /* On NT, the directory "abc...." is the same as "abc"
- * The only cheap way to catch this globally is to disallow
- * names with the trailing "."s. Hopefully this is not over
- * restrictive
- */
- if ((t[x] == '.') && ( (t[x+1] == '/') || (t[x+1] ==
'\0') )) {
- return 1;
- }
-#endif
- }
- return 0;
-}
-
FILE *
_open_html_file( char *filename )
@@ -94,9 +56,7 @@
char *p;
p = dsgw_file2path( DSGW_MANROOT, DSGW_MANSUBDIR );
- mypath = (char *)dsgw_ch_malloc( strlen( p ) +
- strlen( filename ) + 1 );
- sprintf( mypath, "%s%s", p, filename );
+ mypath = PR_smprintf("%s/%s", p, filename);
if (!(f = fopen( mypath, "r" ))) {
dsgw_error( DSGW_ERR_OPENHTMLFILE, filename, DSGW_ERROPT_EXIT,
@@ -104,7 +64,7 @@
}
free( p );
- free( mypath );
+ PR_smprintf_free( mypath );
return f;
}
@@ -142,6 +102,7 @@
char *param = NULL;
char *html=NULL;
char *base=NULL;
+ int isgood = 0;
#ifdef DSGW_DEBUG
dsgw_logstringarray( "env", env );
@@ -156,111 +117,102 @@
exit(0);
}
- html = (char *) dsgw_ch_malloc(strlen(param)+10+10);
- sprintf(html, "%s.html", param);
- if (my_util_uri_is_evil(html)) {
- dsgw_send_header();
- dsgw_emits(
"<CENTER><H2>Error</H2></CENTER>\n"
- "<P>\n"
- "URL contains dangerous characters. Cannot display\n"
- "help text." );
- exit( 0 );
+ if (param[0] == '!') {
+ isgood = dsgw_valid_docname((param+1));
+ } else {
+ isgood = dsgw_valid_docname(param);
+ }
+
+ if (!isgood) {
+ dsgw_error( DSGW_ERR_OPENHTMLFILE, param, DSGW_ERROPT_EXIT,
+ 0, NULL );
+ exit( 1 );
}
if(param[0]=='!') {
param++;
- if(!strncmp(param, BASE_INFO_DIRECTORY, strlen(BASE_INFO_DIRECTORY))) {
- sprintf(html, "%s.html", param);
- } else if(!strncmp(param, BASE_MAN_DIRECTORY, strlen(BASE_MAN_DIRECTORY))) {
- if(!strstr(param, ".html")) {
- sprintf(html, "%s.htm", param);
- } else {
- sprintf(html, "%s", param);
- }
- base=param;
- }
- else {
- char line[BIG_LINE];
- FILE *map=NULL;
- char *man_index=NULL;
-
- man_index = dsgw_file2path ( DSGW_MANROOT, DSGW_MANSUBDIR
"index.map" );
-
- html[0]='\0';
-
- map=fopen(man_index, "r");
- if(!map)
- goto ohwell;
- while(fgets(line, sizeof(line), map)) {
- if(line[0]==';')
- continue;
- else if(ldap_utf8isspace(line))
- continue;
- else {
- /* parse out the line */
- register char *head=NULL, *tail=NULL;
- int found;
-
- head=&(line[0]);
- tail=head;
- found=0;
- while(*tail) {
- if(ldap_utf8isspace(tail) || *tail=='=') {
- *tail='\0';
- found=1;
- /* get rid of extra stuff at the end */
- tail++;
- while(1) {
- if (*tail == 0) {
- ++tail; /* This looks wrong. */
- break;
- }
- LDAP_UTF8INC(tail);
- if((!ldap_utf8isspace(tail)) &&
(*tail!='='))
- break;
+ char *man_path = dsgw_file2path ( DSGW_MANROOT, DSGW_MANSUBDIR );
+ char line[BIG_LINE];
+ FILE *map=NULL;
+ char *man_index=NULL;
+
+ man_index = PR_smprintf("%s/%s", man_path, "index.map" );
+
+ map=fopen(man_index, "r");
+ if(!map)
+ goto ohwell;
+ while(fgets(line, sizeof(line), map)) {
+ if(line[0]==';')
+ continue;
+ else if(ldap_utf8isspace(line))
+ continue;
+ else {
+ /* parse out the line */
+ register char *head=NULL, *tail=NULL;
+ int found;
+
+ head=&(line[0]);
+ tail=head;
+ found=0;
+ while(*tail) {
+ if(ldap_utf8isspace(tail) || *tail=='=') {
+ *tail='\0';
+ found=1;
+ /* get rid of extra stuff at the end */
+ tail++;
+ while(1) {
+ if (*tail == 0) {
+ ++tail; /* This looks wrong. */
+ break;
}
- break;
- }
- LDAP_UTF8INC(tail);
- }
- if(!found) continue;
-
- /* script name is in head */
- if(strncasecmp(head, param, strlen(param))) {
- continue;
- }
- /* match found. get the actual file name */
- head=tail;
+ LDAP_UTF8INC(tail);
+ if((!ldap_utf8isspace(tail)) && (*tail!='='))
+ break;
+ }
+ break;
+ }
+ LDAP_UTF8INC(tail);
+ }
+ if(!found) continue;
+
+ /* script name is in head */
+ if(strncasecmp(head, param, strlen(param))) {
+ continue;
+ }
+ /* match found. get the actual file name */
+ head=tail;
/* Step on CRs and LFs. */
- while(*tail) {
- if((*tail=='\r') || (*tail=='\n') ||
(*tail==';')) {
- *tail='\0';
- break;
- }
- LDAP_UTF8INC(tail);
- }
- /* assumedly, head should now have the proper HTML file
- * from the manual inside. redirect the client 'cause
- * there's no other way to get them to jump to the
- * right place.
- * Looks like:
- *
http://host:port/dsgw/bin/lang?context=CONTEXT&file=.MANUAL/FILE.HTM
- * Where MANUAL is literal
- */
- dsgw_emitf("Location: %s%s/%s\n\n",
- gc->gc_urlpfxmain, DSGW_MANUALSHORTCUT, head);
-
- fclose(map);
- exit(0);
- }
- }
- fclose(map);
- free( man_index );
-
-ohwell:
- if(!html[0])
- sprintf(html, "%s%s.html", BASE_MAN_DIRECTORY, param);
- }
+ while(*tail) {
+ if((*tail=='\r') || (*tail=='\n') || (*tail==';')) {
+ *tail='\0';
+ break;
+ }
+ LDAP_UTF8INC(tail);
+ }
+ /* assumedly, head should now have the proper HTML file
+ * from the manual inside. redirect the client 'cause
+ * there's no other way to get them to jump to the
+ * right place.
+ * Looks like:
+ *
http://host:port/dsgw/bin/lang?context=CONTEXT&file=.MANUAL/FILE.HTM
+ * Where MANUAL is literal
+ */
+ html = PL_strdup(gc->gc_urlpfxmain);
+ dsgw_convert_entities(html);
+ dsgw_emitf("Location: %s%s/%s\n\n",
+ html, DSGW_MANUALSHORTCUT, head);
+ free(html);
+ fclose(map);
+ exit(0);
+ }
+ }
+ fclose(map);
+ free( man_index );
+
+ ohwell:
+ if(!html || !html[0])
+ html = PR_smprintf( "%s%s.html", BASE_MAN_DIRECTORY, param);
+ free(man_path);
dsgw_send_header();
_my_return_html_file(html, base);
} else {
@@ -270,12 +222,21 @@
dsgw_emits("<frameset BORDER=0 FRAMEBORDER=NO rows=\"57,*\"
"
"onLoad=\"top.master=top.opener.top;top.master.helpwin=self;\" "
"onUnload=\"if (top.master) { top.master.helpwin=0; }\">\n" );
- dsgw_emitf("<frame
src=\"%s?tutor=!info/infonav&context=%s\" scrolling=no "
+ dsgw_emitf("<frame
src=\"%s?file=%s/infonav.html&context=%s\" scrolling=no "
"marginwidth=0 marginheight=0 "
- "name=\"infobuttons\">\n", dsgw_getvp(DSGW_CGINUM_TUTOR),
context);
- dsgw_emitf("<frame src=\"%s?tutor=!%s&context=%s\" "
+ "name=\"infobuttons\">\n", dsgw_getvp(DSGW_CGINUM_LANG),
DSGW_MANUALSHORTCUT,
+ context);
+ dsgw_emitf("<frame src=\"%s?tutor=!%s&context=%s\"
"
"name=\"infotopic\">\n", dsgw_getvp(DSGW_CGINUM_TUTOR),
param, context);
dsgw_emits("</frameset>\n");
}
- return 1;
+ return 0;
}
+
+/*
+ emacs settings
+ Local Variables:
+ indent-tabs-mode: t
+ tab-width: 8
+ End:
+*/
Index: unauth.c
===================================================================
RCS file: /cvs/dirsec/dsgw/unauth.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- unauth.c 14 Jan 2008 22:58:30 -0000 1.2
+++ unauth.c 6 Mar 2008 22:00:09 -0000 1.3
@@ -108,7 +108,7 @@
* Something went wrong, so generate some JavaScript to
* discard the cookie.
*/
- dsgw_emits( "<SCRIPT LANGUAGE=\"JavaScript\">\n" );
+ dsgw_emits( "<SCRIPT type=\"text/javascript\">\n" );
dsgw_emitf( "document.cookie = '%s=%s; path=/';\n", DSGW_AUTHCKNAME,
DSGW_UNAUTHSTR );
dsgw_emits( "</SCRIPT>\n" );
Index: cgidbgwrapper.sh.in
===================================================================
RCS file: /cvs/dirsec/dsgw/cgidbgwrapper.sh.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cgidbgwrapper.sh.in 16 Jan 2008 22:56:02 -0000 1.1
+++ cgidbgwrapper.sh.in 6 Mar 2008 22:00:09 -0000 1.2
@@ -4,18 +4,32 @@
inf=/tmp/$PROG.in.$$
outf=/tmp/$PROG.out.$$
+#USEGDB=1
+VALGRINDSUPP=/path/to/valgrind.supp
+VALGRIND="valgrind --tool=memcheck --leak-check=yes --suppressions=$VALGRINDSUPP
--num-callers=40 --log-file=/tmp/$PROG.vg"
env > /tmp/env
-echo "set env LD_LIBRARY_PATH @prefix@/lib:@libdir@:/usr/lib64:/usr/lib" >
.gdbinit
-echo "break main" >> .gdbinit
if [ "$REQUEST_METHOD" = POST ] ; then
cat - > $inf
- echo "run < $inf > $outf" >> .gdbinit
else
rm -f $inf
- echo "run > $outf" >> .gdbinit
fi
-DISPLAY=:0.0 LD_LIBRARY_PATH=@prefix@/lib xterm -bg white -fn 10x20 -title gdb -e gdb -x
.gdbinit $PROG
+if [ -n "$USEGDB" ] ; then
+ echo "set env LD_LIBRARY_PATH @prefix@/lib:@libdir@:/usr/lib64:/usr/lib"
> .gdbinit
+ echo "break main" >> .gdbinit
+ if [ "$REQUEST_METHOD" = POST ] ; then
+ echo "run < $inf > $outf" >> .gdbinit
+ else
+ echo "run > $outf" >> .gdbinit
+ fi
+ DISPLAY=:0.0 LD_LIBRARY_PATH=@prefix@/lib xterm -bg white -fn 10x20 -title gdb -e gdb
-x .gdbinit $PROG
+else
+ if [ -f $inf ] ; then
+ $VALGRIND ./$PROG < $inf > $outf
+ else
+ $VALGRIND ./$PROG > $outf
+ fi
+fi
cat $outf
rm -f $inf $outf
Index: lang.c
===================================================================
RCS file: /cvs/dirsec/dsgw/lang.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- lang.c 27 Feb 2008 03:36:50 -0000 1.4
+++ lang.c 6 Mar 2008 22:00:09 -0000 1.5
@@ -125,7 +125,7 @@
static char* docdir = NULL;
static char* helpdir = NULL;
char* docname = NULL;
- char* tfname;
+ char* tfname = NULL;
int result = 0;
int manual_file = 0; /* Flag: is the file a documentation file? */
@@ -191,11 +191,7 @@
}
helpdir = dsgw_file2path ( DSGW_MANROOT, DSGW_MANSUBDIR );
- tfname = (char *)dsgw_ch_malloc( strlen( helpdir ) +
- strlen( mandocname ) +
- 1 );
- sprintf( tfname, "%s%s",
- helpdir, mandocname);
+ tfname = PR_smprintf("%s/%s", helpdir, mandocname);
free( helpdir );
free( mandocname );
@@ -228,6 +224,7 @@
/*
* XXXmcs: the following free() causes a crash on NT... so don't do it!
*/
+ free(tfname);
return result;
}
Index: Makefile.in
===================================================================
RCS file: /cvs/dirsec/dsgw/Makefile.in,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Makefile.in 1 Feb 2008 16:50:12 -0000 1.18
+++ Makefile.in 6 Mar 2008 22:00:09 -0000 1.19
@@ -70,8 +70,8 @@
$(am__EXEEXT_1)
@DEBUG_TRUE@am__append_4 = $(DBGSCRIPTS)
DIST_COMMON = README $(am__configure_deps) $(dist_config_DATA) \
- $(dist_gwinfo_DATA) $(dist_html_DATA) $(dist_maninst_DATA) \
- $(dist_orghtml_DATA) $(dist_pbconfig_DATA) $(dist_pbhtml_DATA) \
+ $(dist_html_DATA) $(dist_maninst_DATA) $(dist_orghtml_DATA) \
+ $(dist_pbconfig_DATA) $(dist_pbhtml_DATA) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS \
ChangeLog NEWS compile config.guess config.sub depcomp \
@@ -93,10 +93,10 @@
newentry$(EXEEXT) tutor$(EXEEXT) lang$(EXEEXT)
am__installdirs = "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cgibindir)"
\
"$(DESTDIR)$(sbindir)" "$(DESTDIR)$(configdir)" \
- "$(DESTDIR)$(gwinfodir)" "$(DESTDIR)$(htmldir)" \
- "$(DESTDIR)$(maninstdir)" "$(DESTDIR)$(orghtmldir)" \
- "$(DESTDIR)$(pbconfigdir)" "$(DESTDIR)$(pbhtmldir)" \
- "$(DESTDIR)$(contextdir)" "$(DESTDIR)$(propertydir)"
+ "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(maninstdir)" \
+ "$(DESTDIR)$(orghtmldir)" "$(DESTDIR)$(pbconfigdir)" \
+ "$(DESTDIR)$(pbhtmldir)" "$(DESTDIR)$(contextdir)" \
+ "$(DESTDIR)$(propertydir)"
cgibinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
@CXXLINK_REQUIRED_TRUE@am__EXEEXT_2 = dummy$(EXEEXT)
PROGRAMS = $(cgibin_PROGRAMS) $(noinst_PROGRAMS)
@@ -192,7 +192,6 @@
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
dist_configDATA_INSTALL = $(INSTALL_DATA)
-dist_gwinfoDATA_INSTALL = $(INSTALL_DATA)
dist_htmlDATA_INSTALL = $(INSTALL_DATA)
dist_maninstDATA_INSTALL = $(INSTALL_DATA)
dist_orghtmlDATA_INSTALL = $(INSTALL_DATA)
@@ -200,9 +199,8 @@
dist_pbhtmlDATA_INSTALL = $(INSTALL_DATA)
nodist_contextDATA_INSTALL = $(INSTALL_DATA)
nodist_propertyDATA_INSTALL = $(INSTALL_DATA)
-DATA = $(dist_config_DATA) $(dist_gwinfo_DATA) $(dist_html_DATA) \
- $(dist_maninst_DATA) $(dist_orghtml_DATA) \
- $(dist_pbconfig_DATA) $(dist_pbhtml_DATA) \
+DATA = $(dist_config_DATA) $(dist_html_DATA) $(dist_maninst_DATA) \
+ $(dist_orghtml_DATA) $(dist_pbconfig_DATA) $(dist_pbhtml_DATA) \
$(nodist_context_DATA) $(nodist_property_DATA)
ETAGS = etags
CTAGS = ctags
@@ -392,7 +390,6 @@
# look for included m4 files in the ./m4/ directory
ACLOCAL_AMFLAGS = -I m4
-gwinfodir = $(manualdir)/en/$(manualsubdir)/info
# this is the directory where the manuals will actually be installed
maninstdir = $(manualdir)/en/$(manualsubdir)
@BUNDLE_FALSE@perlpath = $(perldir)
@@ -409,7 +406,7 @@
-DCGIBINDIR=\"$(cgibindir)\" -DCONTEXTDIR=\"$(contextdir)\" \
-DINSTCONFIGDIR=\"$(instconfigdir)\" \
-DMANUALDIR=\"$(manualdir)\" -DCGIURIBASE=\"$(cgiuri)\" \
- -DMANUALSUBDIR=\"$(manualsubdir)\" -DINFODIR=\"$(gwinfodir)\"
+ -DMANUALSUBDIR=\"$(manualsubdir)\"
# We need to make sure that libpthread is linked before libc on HP-UX.
@HPUX_TRUE@AM_LDFLAGS = -lpthread
@@ -540,9 +537,9 @@
dist_maninst_DATA = \
html/manual/a.gif html/manual/add.htm html/manual/attribua.gif html/manual/attribut.htm
html/manual/auth.htm \
html/manual/contents.html html/manual/intro.htm html/manual/mod.htm html/manual/n.gif \
- html/manual/objclass.htm html/manual/search.htm html/manual/t.gif html/manual/y.gif
html/manual/index.map
+ html/manual/objclass.htm html/manual/search.htm html/manual/t.gif html/manual/y.gif
html/manual/index.map \
+ html/info/infonav.html
-dist_gwinfo_DATA = html/info/infonav.html
nodist_context_DATA = dsgw-httpd.conf
nodist_sbin_SCRIPTS = setup-ds-dsgw
@@ -592,6 +589,7 @@
-e 's,@contextdir\@,$(contextdir),g' \
-e 's,@securitydir\@,$(securitydir),g' \
-e 's,@instconfigdir\@,$(instconfigdir),g' \
+ -e 's,@cookiedir\@,$(cookiedir),g' \
-e 's,@perlpath\@,$(perlpath),g' \
-e 's,@perlexec\@,@perlexec@,g' \
-e 's,@manualdir\@,$(manualdir),g' \
@@ -603,7 +601,8 @@
-e 's,@PACKAGE_BASE_VERSION\@,$(PACKAGE_BASE_VERSION),g' \
-e 's,@brand\@,$(brand),g' \
-e 's,@capbrand\@,$(capbrand),g' \
- -e 's,@vendor\@,$(vendor),g'
+ -e 's,@vendor\@,$(vendor),g' \
+ -e "s,@progname\@,$$progname,g"
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -888,23 +887,6 @@
echo " rm -f '$(DESTDIR)$(configdir)/$$f'"; \
rm -f "$(DESTDIR)$(configdir)/$$f"; \
done
-install-dist_gwinfoDATA: $(dist_gwinfo_DATA)
- @$(NORMAL_INSTALL)
- test -z "$(gwinfodir)" || $(mkdir_p) "$(DESTDIR)$(gwinfodir)"
- @list='$(dist_gwinfo_DATA)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(dist_gwinfoDATA_INSTALL) '$$d$$p'
'$(DESTDIR)$(gwinfodir)/$$f'"; \
- $(dist_gwinfoDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(gwinfodir)/$$f";
\
- done
-
-uninstall-dist_gwinfoDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(dist_gwinfo_DATA)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(gwinfodir)/$$f'"; \
- rm -f "$(DESTDIR)$(gwinfodir)/$$f"; \
- done
install-dist_htmlDATA: $(dist_html_DATA)
@$(NORMAL_INSTALL)
test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
@@ -1204,7 +1186,7 @@
check: check-am
all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) config.h
installdirs:
- for dir in "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cgibindir)"
"$(DESTDIR)$(sbindir)" "$(DESTDIR)$(configdir)"
"$(DESTDIR)$(gwinfodir)" "$(DESTDIR)$(htmldir)"
"$(DESTDIR)$(maninstdir)" "$(DESTDIR)$(orghtmldir)"
"$(DESTDIR)$(pbconfigdir)" "$(DESTDIR)$(pbhtmldir)"
"$(DESTDIR)$(contextdir)" "$(DESTDIR)$(propertydir)"; do \
+ for dir in "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cgibindir)"
"$(DESTDIR)$(sbindir)" "$(DESTDIR)$(configdir)"
"$(DESTDIR)$(htmldir)" "$(DESTDIR)$(maninstdir)"
"$(DESTDIR)$(orghtmldir)" "$(DESTDIR)$(pbconfigdir)"
"$(DESTDIR)$(pbhtmldir)" "$(DESTDIR)$(contextdir)"
"$(DESTDIR)$(propertydir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
@@ -1255,11 +1237,10 @@
info-am:
install-data-am: install-cgibinPROGRAMS install-cgibinSCRIPTS \
- install-dist_configDATA install-dist_gwinfoDATA \
- install-dist_htmlDATA install-dist_maninstDATA \
- install-dist_orghtmlDATA install-dist_pbconfigDATA \
- install-dist_pbhtmlDATA install-nodist_contextDATA \
- install-nodist_propertyDATA
+ install-dist_configDATA install-dist_htmlDATA \
+ install-dist_maninstDATA install-dist_orghtmlDATA \
+ install-dist_pbconfigDATA install-dist_pbhtmlDATA \
+ install-nodist_contextDATA install-nodist_propertyDATA
install-exec-am: install-nodist_sbinSCRIPTS
@@ -1290,12 +1271,11 @@
ps-am:
uninstall-am: uninstall-cgibinPROGRAMS uninstall-cgibinSCRIPTS \
- uninstall-dist_configDATA uninstall-dist_gwinfoDATA \
- uninstall-dist_htmlDATA uninstall-dist_maninstDATA \
- uninstall-dist_orghtmlDATA uninstall-dist_pbconfigDATA \
- uninstall-dist_pbhtmlDATA uninstall-info-am \
- uninstall-nodist_contextDATA uninstall-nodist_propertyDATA \
- uninstall-nodist_sbinSCRIPTS
+ uninstall-dist_configDATA uninstall-dist_htmlDATA \
+ uninstall-dist_maninstDATA uninstall-dist_orghtmlDATA \
+ uninstall-dist_pbconfigDATA uninstall-dist_pbhtmlDATA \
+ uninstall-info-am uninstall-nodist_contextDATA \
+ uninstall-nodist_propertyDATA uninstall-nodist_sbinSCRIPTS
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-cgibinPROGRAMS clean-generic clean-libtool \
@@ -1306,11 +1286,10 @@
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-cgibinPROGRAMS \
install-cgibinSCRIPTS install-data install-data-am \
- install-dist_configDATA install-dist_gwinfoDATA \
- install-dist_htmlDATA install-dist_maninstDATA \
- install-dist_orghtmlDATA install-dist_pbconfigDATA \
- install-dist_pbhtmlDATA install-exec install-exec-am \
- install-info install-info-am install-man \
+ install-dist_configDATA install-dist_htmlDATA \
+ install-dist_maninstDATA install-dist_orghtmlDATA \
+ install-dist_pbconfigDATA install-dist_pbhtmlDATA install-exec \
+ install-exec-am install-info install-info-am install-man \
install-nodist_contextDATA install-nodist_propertyDATA \
install-nodist_sbinSCRIPTS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
@@ -1318,11 +1297,11 @@
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-cgibinPROGRAMS \
uninstall-cgibinSCRIPTS uninstall-dist_configDATA \
- uninstall-dist_gwinfoDATA uninstall-dist_htmlDATA \
- uninstall-dist_maninstDATA uninstall-dist_orghtmlDATA \
- uninstall-dist_pbconfigDATA uninstall-dist_pbhtmlDATA \
- uninstall-info-am uninstall-nodist_contextDATA \
- uninstall-nodist_propertyDATA uninstall-nodist_sbinSCRIPTS
+ uninstall-dist_htmlDATA uninstall-dist_maninstDATA \
+ uninstall-dist_orghtmlDATA uninstall-dist_pbconfigDATA \
+ uninstall-dist_pbhtmlDATA uninstall-info-am \
+ uninstall-nodist_contextDATA uninstall-nodist_propertyDATA \
+ uninstall-nodist_sbinSCRIPTS
# By default create only the default root bundle (english).
@@ -1349,7 +1328,7 @@
@DEBUG_TRUE@$(DBGSCRIPTS) : cgidbgwrapper.sh.in
@DEBUG_TRUE@ if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi
-@DEBUG_TRUE@ $(fixupcmd) $< > $@
+@DEBUG_TRUE@ progname=`basename $@ .sh` ; $(fixupcmd) $< > $@
% : %.in
if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi