[Fedora-directory-commits] dsgw/pbconfig pb.tmpl.in,1.2,1.3
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsgw/pbconfig
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15541/dsgw/pbconfig
Modified Files:
pb.tmpl.in
Log Message:
Renamed setup to setup-ds-dsgw to be consistent with other setup scripts
setup-ds-dsgw will attempt to use settings from pre-configured admin server
and directory server
Config files will use an ldap url and http url - this is so that we can use
http or https and ldap or ldaps - previously, dsgw was configured during
regular DS setup, which did not allow TLS/SSL setup - we must be able to
configure the dsgw for TLS/SSL during setup now
Changed XP_GetClientStr back to just always return a malloc'd string - there
are cases where we cannot use a static
There were some places where we were using a form with POST + a query string
Use SERVER_NAME instead of HTTP_HOST because the latter has the port number
already in it
Index: pb.tmpl.in
===================================================================
RCS file: /cvs/dirsec/dsgw/pbconfig/pb.tmpl.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- pb.tmpl.in 28 Jan 2008 21:22:49 -0000 1.2
+++ pb.tmpl.in 30 Jan 2008 02:22:47 -0000 1.3
@@ -36,15 +36,15 @@
# All rights reserved.
# END COPYRIGHT BLOCK
-baseurl "ldap://@host@:@port@/@suffix@"
+baseurl "@ldapurl@/@suffix@"
dirmgr "@dirmgr@"
location-suffix @suffix@
-securitypath "@contextdir@"
+securitypath "@securitydir@"
-url-orgchart-base http://@host@:@httpport@@cgiuri@/org?context=pb&data=
+url-orgchart-base @httpurl@@cgiuri@/org?context=pb&data=
# The attribute the orgchart uses to search for entries.
# This value should correspond to the value of attrib-farleft-rdn
@@ -70,11 +70,6 @@
# are valid (in seconds).
authlifetime 7200
-# The libNLS data directory. This directory should contain a directory
-# named "locales", which contains the configuration files LANG.ctx and
-# LANG.txt for each supported language (locale).
-NLS ../../../lib/nls
-
# The default character set, for communication with HTTP clients.
# A client may override this default, using an HTTP Accept-Charset header.
# Or, this default may be overridden for a specific language, by creating
16 years, 2 months
[Fedora-directory-commits] dsgw/orghtml orgchart.tmpl.in,1.1,1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsgw/orghtml
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15541/dsgw/orghtml
Modified Files:
orgchart.tmpl.in
Log Message:
Renamed setup to setup-ds-dsgw to be consistent with other setup scripts
setup-ds-dsgw will attempt to use settings from pre-configured admin server
and directory server
Config files will use an ldap url and http url - this is so that we can use
http or https and ldap or ldaps - previously, dsgw was configured during
regular DS setup, which did not allow TLS/SSL setup - we must be able to
configure the dsgw for TLS/SSL during setup now
Changed XP_GetClientStr back to just always return a malloc'd string - there
are cases where we cannot use a static
There were some places where we were using a form with POST + a query string
Use SERVER_NAME instead of HTTP_HOST because the latter has the port number
already in it
Index: orgchart.tmpl.in
===================================================================
RCS file: /cvs/dirsec/dsgw/orghtml/orgchart.tmpl.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- orgchart.tmpl.in 28 Jan 2008 21:22:48 -0000 1.1
+++ orgchart.tmpl.in 30 Jan 2008 02:22:47 -0000 1.2
@@ -55,9 +55,11 @@
# Name/Value pairs below are (and need to be) separated with
# one or more tabs (or spaces)
#
-ldap-host @host@
-ldap-port @port@
+ldap-url @ldapurl@/@suffix@
+#ldap-host @host@
+#ldap-port @port@
ldap-search-base @suffix@
+securitydir @securitydir@
#
# If you would like to have the phonebook icon visible, you must
@@ -69,7 +71,7 @@
# url-phonebook-base http://hostname.domain.com/dsgw/bin/dosearch?context=default&hp=localhost...
#
-url-phonebook-base http://@host@:@httpport@@cgiuri@/dosearch?context=pb&hp=@host@:@port@&dn=
+url-phonebook-base @httpurl@@cgiuri@/dosearch?context=pb&hp=@host@:@port@&dn=
#
# A name that has no value after it equates to "" for the value,
16 years, 2 months
[Fedora-directory-commits] dsgw/orgbin org.in,1.2,1.3
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsgw/orgbin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15541/dsgw/orgbin
Modified Files:
org.in
Log Message:
Renamed setup to setup-ds-dsgw to be consistent with other setup scripts
setup-ds-dsgw will attempt to use settings from pre-configured admin server
and directory server
Config files will use an ldap url and http url - this is so that we can use
http or https and ldap or ldaps - previously, dsgw was configured during
regular DS setup, which did not allow TLS/SSL setup - we must be able to
configure the dsgw for TLS/SSL during setup now
Changed XP_GetClientStr back to just always return a malloc'd string - there
are cases where we cannot use a static
There were some places where we were using a form with POST + a query string
Use SERVER_NAME instead of HTTP_HOST because the latter has the port number
already in it
Index: org.in
===================================================================
RCS file: /cvs/dirsec/dsgw/orgbin/org.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- org.in 28 Jan 2008 21:22:48 -0000 1.2
+++ org.in 30 Jan 2008 02:22:46 -0000 1.3
@@ -56,6 +56,7 @@
use Mozilla::LDAP::Conn;
use Mozilla::LDAP::Utils qw(:all);
+use Mozilla::LDAP::API qw(:constant ldap_url_parse ldap_explode_dn);
use CGI;
$cg = new CGI;
@@ -407,13 +408,26 @@
local ($search) = "$config_tokens{'attrib-manager'}=$manager";
local ($entry);
local ($conn);
+ my $h = ldap_url_parse($config_tokens{"ldap-url"});
+ my $host = $h->{host};
+ my $port = $h->{port};
+ my $securitydir;
+ if ($h->{options} & LDAP_URL_OPT_SECURE) {
+ $securitydir = $config_tokens{"securitydir"};
+ if ($securitydir eq "none") {
+ &output_html_header("no-javascript");
+ print "<BR><BR>The orgchart config specifies to use TLS/SSL $config_tokens{\"ldap-url\"} but no securitydir has been configured <BR><BR>";
+ print "\n</BODY></HTML>";
+ exit (0);
+ }
+ }
- $conn = new Mozilla::LDAP::Conn($config_tokens{"ldap-host"}, $config_tokens{"ldap-port"}, $config_tokens{"ldap-bind-dn"}, $config_tokens{"ldap-bind-pass"});
- die "Could't connect to LDAP server $config_tokens{\"ldap-host\"}" unless $conn;
+ $conn = new Mozilla::LDAP::Conn($host, $port, $config_tokens{"ldap-bind-dn"}, $config_tokens{"ldap-bind-pass"}, $securitydir);
+ die "Could't connect to LDAP server $config_tokens{\"ldap-url\"}" unless $conn;
$entry = $conn->search($config_tokens{"ldap-search-base"}, "subtree", $search, 0, @return_attribs);
$display_indent += 1;
-
+
while ($entry)
{
if (not_terminated($entry) && not_own_manager($entry))
@@ -980,9 +994,11 @@
exit;
}
-%config_tokens = ( "ldap-host","none",
+%config_tokens = ( "ldap-url","none",
+ "ldap-host","none",
"ldap-port","none",
"ldap-search-base","none",
+ "securitydir","none",
"ldap-bind-dn","",
"ldap-bind-pass","",
"icons-aim-visible","no",
@@ -1012,21 +1028,37 @@
close (FILE);
+my $haveurl = 1;
+my $havehost = 1;
+my $haveport = 1;
+
+if ( $config_tokens{"ldap-url"} eq "none" )
+{
+ $haveurl = 0;
+}
if ( $config_tokens{"ldap-host"} eq "none" )
{
- &output_html_header("no-javascript");
- print "<BR><BR>The administrator of this application needs to configure an LDAP host to use.<BR><BR>";
- print "\n</BODY></HTML>";
- exit(0);
+ $havehost = 0;
}
+
if ( $config_tokens{"ldap-port"} eq "none" )
{
+ $haveport = 0;
+}
+
+if ( !$haveurl and (!$havehost or !$haveport) )
+{
&output_html_header("no-javascript");
- print "<BR><BR>The administrator of this application needs to configure an LDAP port number to use.<BR><BR>";
+ print "<BR><BR>The administrator of this application needs to configure an LDAP URL, or an LDAP host and port number to use.<BR><BR>";
print "\n</BODY></HTML>";
exit(0);
}
+
+if ( !$haveurl ) {
+ $config_tokens{"ldap-url"} = "ldap://" . $config_tokens{"ldap-host"} . ":" . $config_tokens{"ldap-port"};
+}
+
if ( $config_tokens{"ldap-search-base"} eq "none" )
{
&output_html_header("no-javascript");
@@ -1258,8 +1290,21 @@
$search = "$config_tokens{'attrib-farleft-rdn'}=" . $uid;
- $conn = new Mozilla::LDAP::Conn($config_tokens{"ldap-host"}, $config_tokens{"ldap-port"}, $config_tokens{"ldap-bind-dn"}, $config_tokens{"ldap-bind-pass"});
- die "Couldn't connect to LDAP server $config_tokens{\"ldap-host\"}" unless $conn;
+ my $h = ldap_url_parse($config_tokens{"ldap-url"});
+ my $host = $h->{host};
+ my $port = $h->{port};
+ my $securitydir;
+ if ($h->{options} & LDAP_URL_OPT_SECURE) {
+ $securitydir = $config_tokens{"securitydir"};
+ if ($securitydir eq "none") {
+ &output_html_header("no-javascript");
+ print "<BR><BR>The orgchart config specifies to use TLS/SSL $config_tokens{\"ldap-url\"} but no securitydir has been configured <BR><BR>";
+ print "\n</BODY></HTML>";
+ exit (0);
+ }
+ }
+ $conn = new Mozilla::LDAP::Conn($host, $port, $config_tokens{"ldap-bind-dn"}, $config_tokens{"ldap-bind-pass"}, $securitydir);
+ die "Couldn't connect to LDAP server $config_tokens{\"ldap-url\"}" unless $conn;
$entry = $conn->search($config_tokens{"ldap-search-base"}, "subtree", $search, 0 , @return_attribs);
#
@@ -1289,8 +1334,6 @@
$search = "(|(cn=*$uid*)(mail=*$uid*))";
- $conn = new Mozilla::LDAP::Conn($config_tokens{"ldap-host"}, $config_tokens{"ldap-port"}, $config_tokens{"ldap-bind-dn"}, $config_tokens{"ldap-bind-pass"});
- die "Couldn't connect to LDAP server $config_tokens{\"ldap-host\"}" unless $conn;
$entry = $conn->search($config_tokens{"ldap-search-base"}, "subtree", $search, 0, @return_attribs);
$anothertempnum = 0;
16 years, 2 months
[Fedora-directory-commits] dsgw/config dsgw.tmpl.in,1.2,1.3
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsgw/config
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15541/dsgw/config
Modified Files:
dsgw.tmpl.in
Log Message:
Renamed setup to setup-ds-dsgw to be consistent with other setup scripts
setup-ds-dsgw will attempt to use settings from pre-configured admin server
and directory server
Config files will use an ldap url and http url - this is so that we can use
http or https and ldap or ldaps - previously, dsgw was configured during
regular DS setup, which did not allow TLS/SSL setup - we must be able to
configure the dsgw for TLS/SSL during setup now
Changed XP_GetClientStr back to just always return a malloc'd string - there
are cases where we cannot use a static
There were some places where we were using a form with POST + a query string
Use SERVER_NAME instead of HTTP_HOST because the latter has the port number
already in it
Index: dsgw.tmpl.in
===================================================================
RCS file: /cvs/dirsec/dsgw/config/dsgw.tmpl.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dsgw.tmpl.in 28 Jan 2008 21:22:48 -0000 1.2
+++ dsgw.tmpl.in 30 Jan 2008 02:22:46 -0000 1.3
@@ -36,15 +36,15 @@
# All rights reserved.
# END COPYRIGHT BLOCK
-baseurl "ldap://@host@:@port@/@suffix@"
+baseurl "@ldapurl@/@suffix@"
dirmgr "@dirmgr@"
location-suffix @suffix@
-securitypath "@contextdir@"
+securitypath "@securitydir@"
-url-orgchart-base http://@host@:@httpport@@cgiuri@/org?context=dsgw&data=
+url-orgchart-base @httpurl@@cgiuri@/org?context=dsgw&data=
# The attribute the orgchart uses to search for entries.
# This value should correspond to the value of attrib-farleft-rdn
16 years, 2 months
[Fedora-directory-commits] dsgw setup-ds-dsgw.in, NONE, 1.1 Makefile.am, 1.8, 1.9 csearch.c, 1.3, 1.4 dsgwgetlang.c, 1.4, 1.5 dsgwutil.c, 1.6, 1.7 aclocal.m4, 1.5, 1.6 configure, 1.8, 1.9 missing, 1.4, 1.5 install-sh, 1.4, 1.5 Makefile.in, 1.8, 1.9 depcomp, 1.4, 1.5 config.sub, 1.4, 1.5 config.guess, 1.4, 1.5 compile, 1.4, 1.5 setup.in, 1.3, NONE
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsgw
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15541/dsgw
Modified Files:
Makefile.am csearch.c dsgwgetlang.c dsgwutil.c aclocal.m4
configure missing install-sh Makefile.in depcomp config.sub
config.guess compile
Added Files:
setup-ds-dsgw.in
Removed Files:
setup.in
Log Message:
Renamed setup to setup-ds-dsgw to be consistent with other setup scripts
setup-ds-dsgw will attempt to use settings from pre-configured admin server
and directory server
Config files will use an ldap url and http url - this is so that we can use
http or https and ldap or ldaps - previously, dsgw was configured during
regular DS setup, which did not allow TLS/SSL setup - we must be able to
configure the dsgw for TLS/SSL during setup now
Changed XP_GetClientStr back to just always return a malloc'd string - there
are cases where we cannot use a static
There were some places where we were using a form with POST + a query string
Use SERVER_NAME instead of HTTP_HOST because the latter has the port number
already in it
--- NEW FILE setup-ds-dsgw.in ---
#!/bin/sh
#
# 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., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA.
#
# Copyright (C) 2006 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
#
###########################
#
# This shell script provides a way to set up a new installation after
# the binaries have already been extracted. This is typically after
# using native packaging support to install the package e.g. RPM,
# pkgadd, depot, etc. This script will show the license, readme,
# dsktune, then run the usual setup pre and post installers. This
# script should be run from the server root directory since it uses
# pwd to get the server root directory.
#
##########################
getValFromInf() {
cattr=$1
cfile=$2
rval=`grep -i ^$cattr $cfile | head -1 | sed -e "s/^$cattr[ ]*=[ ]*//"`
echo $rval
}
getValFromConf() {
cattr=$1
cfile=$2
rval=`grep -i ^$cattr $cfile | head -1 | sed -e "s/^$cattr[ ]*//"`
echo $rval
}
getValFromLdif() {
cattr=$1
cfile=$2
num=${3:-1}
rval=`grep -i ^$cattr: $cfile | head -$num | sed -e "s/^$cattr:[ ]*//"`
echo $rval
}
# e.g. /etc/dirsrv/dsgw
dsgwconfigdir="@contextdir@"
basecfgdir=`dirname $dsgwconfigdir`
# default security dir
securitydir="@securitydir@"
defaultsecdir=1
httpdconf="@httpdconf@"
# see if there is a $dsgwconfigdir/../admin-serv
admservdir=$basecfgdir/admin-serv
if [ -f "$admservdir/local.conf" ] ; then
host=`getValFromLdif serverHostName "$admservdir/local.conf"`
port=`getValFromLdif configuration.nsServerPort "$admservdir/local.conf"`
sec=`getValFromLdif configuration.nsServerSecurity "$admservdir/local.conf"`
if [ "$sec" = "on" ] ; then
httpurl="https://$host:$port"
if [ -n "$defaultsecdir" ] ; then
securitydir="$admservdir"
defaultsecdir=
fi
else
httpurl="http://$host:$port"
fi
httpdconf=$admservdir/httpd.conf
fi
# see if there are any directory servers here
for dir in $basecfgdir/slapd-* ; do
case "$dir" in
*.deleted) continue ;;
esac
if [ -d "$dir" -a -f "$dir/dse.ldif" ] ; then
dirmgr=`getValFromLdif nsslapd-rootdn "$dir/dse.ldif"`
host=`getValFromLdif nsslapd-localhost "$dir/dse.ldif"`
sec=`getValFromLdif nsslapd-security "$dir/dse.ldif"`
if [ "$sec" = "on" ] ; then
port=`getValFromLdif nsslapd-secureport "$dir/dse.ldif"`
ldapurl="ldaps://$host:$port"
if [ -n "$defaultsecdir" ] ; then
securitydir="$dir"
defaultsecdir=
fi
else
port=`getValFromLdif nsslapd-port "$dir/dse.ldif"`
ldapurl="ldap://$host:$port"
fi
# get suffix
suffixlist="`getValFromLdif nsslapd-suffix $dir/dse.ldif 2`"
for suffix in $suffixlist ; do
case $suffix in
*netscaperoot) ;;
*NetscapeRoot) ;;
*) break ;; # find the first non-netscaperoot suffix
esac
done
fi
done
# get command line arguments
myargs=
silent=
inffile=
tmpinffile=
nextisinffile=
keepinffile=
for arg in "$@" ; do
if [ "$arg" = "-s" ]; then
silent=1
elif [ "$arg" = "-k" ]; then
keepinffile=1
elif [ "$arg" = "-f" ]; then
nextisinffile=1
elif [ $nextisinffile ]; then
inffile="$arg"
nextisinffile=
else
myargs="$myargs $arg"
fi
done
if [ -f "$inffile" ] ; then
hostname=`getValFromInf FullMachineName $inffile`
port=`getValFromInf ServerPort $inffile`
suffix=`getValFromInf Suffix $inffile`
dirmgr=`getValFromInf RootDN $inffile`
httpport=`getValFromInf Port $inffile`
httpurl="http://$host:$httpport"
ldapurl="ldap://$host:$port"
fi
# generate dsgw.conf and pb.conf and default.conf in the $dsgwconfigdir directory
sed -e "s#@host@#$hostname#g" \
-e "s#@port@#$port#g" \
-e "s#@httpport@#$httpport#g" \
-e "s#@suffix@#$suffix#g" \
-e "s#@dirmgr@#$dirmgr#g" \
-e "s#^securitypath.*\$#securitypath $securitydir#g" \
-e "s#@ldapurl@#$ldapurl#g" \
-e "s#@httpurl@#$httpurl#g" \
@configdir(a)/dsgw.tmpl > $dsgwconfigdir/dsgw.conf
sed -e "s#@host@#$hostname#g" \
-e "s#@port@#$port#g" \
-e "s#@httpport@#$httpport#g" \
-e "s#@suffix@#$suffix#g" \
-e "s#@dirmgr@#$dirmgr#g" \
-e "s#^securitypath.*\$#securitypath $securitydir#g" \
-e "s#@ldapurl@#$ldapurl#g" \
-e "s#@httpurl@#$httpurl#g" \
@pbconfigdir(a)/pb.tmpl > $dsgwconfigdir/pb.conf
sed -e "s#@host@#$hostname#g" \
-e "s#@port@#$port#g" \
-e "s#@httpport@#$httpport#g" \
-e "s#@suffix@#$suffix#g" \
-e "s#@dirmgr@#$dirmgr#g" \
-e "s#^securitydir.*\$#securitydir $securitydir#g" \
-e "s#@ldapurl@#$ldapurl#g" \
-e "s#@httpurl@#$httpurl#g" \
@orghtmldir(a)/orgchart.tmpl > $dsgwconfigdir/orgchart.conf
# the default.conf is just a copy of dsgw.conf
cp $dsgwconfigdir/dsgw.conf $dsgwconfigdir/default.conf
# tell Apache about the dsgw - must restart Apache
grep dsgw-httpd.conf "$httpdconf" > /dev/null 2>&1 || (echo "" ; echo "# DSGW configuration" ; echo "Include $dsgwconfigdir/dsgw-httpd.conf") >> $httpdconf
echo "The DSGW has been successfully configured."
if [ $isAdmServ ] ; then
echo "Please restart the Admin Server - /path/to/start-admin "
else
echo "Please restart Apache e.g."
echo " service httpd restart"
echo " OR"
echo " apachectl restart"
echo "or however you restart apache on this system."
fi
exit 0
Index: Makefile.am
===================================================================
RCS file: /cvs/dirsec/dsgw/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Makefile.am 28 Jan 2008 21:22:47 -0000 1.8
+++ Makefile.am 30 Jan 2008 02:22:46 -0000 1.9
@@ -194,7 +194,7 @@
dist_gwinfo_DATA = html/info/infonav.html
nodist_context_DATA = dsgw-httpd.conf
-#nodist_context_SCRIPTS = setup-dirsrv-gw
+nodist_bin_SCRIPTS = setup-ds-dsgw
# add more here for localized bundles
nodist_property_DATA = root.res en.res en_US.res
Index: csearch.c
===================================================================
RCS file: /cvs/dirsec/dsgw/csearch.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- csearch.c 28 Jan 2008 21:22:47 -0000 1.3
+++ csearch.c 30 Jan 2008 02:22:46 -0000 1.4
@@ -253,14 +253,17 @@
} else if ( dsgw_directive_is( line, "DS_CSEARCH_TYPE_FORM" )) {
dsgw_form_begin ("searchTypeForm",
- "action=\"%s?file=attr\" target=searchAttrFrame",
+ "action=\"%s\" target=searchAttrFrame",
dsgw_getvp( DSGW_CGINUM_CSEARCH));
- dsgw_emits("\n");
+ dsgw_emits ("\n"
+ "<INPUT TYPE=hidden NAME=file VALUE=\"attr\">\n");
} else if ( dsgw_directive_is( line, "DS_CSEARCH_ATTR_FORM" )) {
dsgw_form_begin ("searchAttrForm",
- "action=\"%s?file=match\" target=searchMatchFrame",
+ "action=\"%s\" target=searchMatchFrame",
dsgw_getvp( DSGW_CGINUM_CSEARCH));
+ dsgw_emits ("\n"
+ "<INPUT TYPE=hidden NAME=file VALUE=\"match\">\n");
dsgw_emits("\n");
{
auto char* searchType = dsgw_get_cgi_var ("searchType", DSGW_CGIVAR_OPTIONAL);
Index: dsgwgetlang.c
===================================================================
RCS file: /cvs/dirsec/dsgw/dsgwgetlang.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dsgwgetlang.c 28 Jan 2008 21:22:47 -0000 1.4
+++ dsgwgetlang.c 30 Jan 2008 02:22:46 -0000 1.5
@@ -319,30 +319,24 @@
}
/*
- Note: This reuses a single static buffer to avoid memory leakage.
- If the caller needs an actual unique copy, then we have two options
- 1) revert the code to just leak the string - probably ok as this is
- CGI code not long running server code
- 2) have the caller free the pointer after use
+ Note: This function returns allocated memory. Most of the callers in the
+ dsgw do not free this memory - they prefer to use exit() for free() - which
+ is usually fine for short lived CGI programs - so if you use valgrind you
+ will see a lot of memory leakage around this function
*/
PR_IMPLEMENT( char * )
XP_GetClientStr(int key)
{
- static char staticbuf[256] = {0};
- static char *resstring = staticbuf;
- static size_t bufsize = sizeof(staticbuf);
int rc = 0;
char keybuf[256];
char *lang = GetClientLanguage();
+ char *resstring = NULL;
PR_snprintf(keybuf, sizeof(keybuf), "%s%d", database_name, key);
resstring = res_getstring(i18nResource, keybuf, lang,
- resstring, bufsize, &rc);
- if (rc == 1) { /* need more room */
- /* NULL means res_getstring will calculate and return needed memory */
- resstring = res_getstring(i18nResource, keybuf, lang,
- NULL, bufsize, &rc);
- bufsize = strlen(resstring);
+ NULL, 0, &rc);
+ if (rc) {
+ dsgw_emitf("The message keyword id [%d] was not found\n", key);
}
return resstring;
}
Index: dsgwutil.c
===================================================================
RCS file: /cvs/dirsec/dsgw/dsgwutil.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- dsgwutil.c 28 Jan 2008 21:22:47 -0000 1.6
+++ dsgwutil.c 30 Jan 2008 02:22:46 -0000 1.7
@@ -1319,7 +1319,7 @@
httpsstr = "s";
}
server_url = PR_smprintf("http%s://%s:%s", httpsstr,
- getenv("HTTP_HOST"), getenv("SERVER_PORT"));
+ getenv("SERVER_NAME"), getenv("SERVER_PORT"));
}
}
Index: Makefile.in
===================================================================
RCS file: /cvs/dirsec/dsgw/Makefile.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Makefile.in 28 Jan 2008 21:22:47 -0000 1.8
+++ Makefile.in 30 Jan 2008 02:22:46 -0000 1.9
@@ -88,11 +88,11 @@
am__EXEEXT_1 = unauth$(EXEEXT) search$(EXEEXT) csearch$(EXEEXT) \
newentry$(EXEEXT) tutor$(EXEEXT) lang$(EXEEXT)
am__installdirs = "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cgibindir)" \
- "$(DESTDIR)$(configdir)" "$(DESTDIR)$(gwinfodir)" \
- "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(maninstdir)" \
- "$(DESTDIR)$(orghtmldir)" "$(DESTDIR)$(pbconfigdir)" \
- "$(DESTDIR)$(pbhtmldir)" "$(DESTDIR)$(contextdir)" \
- "$(DESTDIR)$(propertydir)"
+ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configdir)" \
+ "$(DESTDIR)$(gwinfodir)" "$(DESTDIR)$(htmldir)" \
+ "$(DESTDIR)$(maninstdir)" "$(DESTDIR)$(orghtmldir)" \
+ "$(DESTDIR)$(pbconfigdir)" "$(DESTDIR)$(pbhtmldir)" \
+ "$(DESTDIR)$(contextdir)" "$(DESTDIR)$(propertydir)"
cgibinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(cgibin_PROGRAMS) $(noinst_PROGRAMS)
am__objects_1 = htmlout.$(OBJEXT) htmlparse.$(OBJEXT) error.$(OBJEXT) \
@@ -145,7 +145,8 @@
unauth_OBJECTS = $(am_unauth_OBJECTS)
unauth_LDADD = $(LDADD)
cgibinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-SCRIPTS = $(cgibin_SCRIPTS)
+nodist_binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(cgibin_SCRIPTS) $(nodist_bin_SCRIPTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -498,7 +499,7 @@
dist_gwinfo_DATA = html/info/infonav.html
nodist_context_DATA = dsgw-httpd.conf
-#nodist_context_SCRIPTS = setup-dirsrv-gw
+nodist_bin_SCRIPTS = setup-ds-dsgw
# add more here for localized bundles
nodist_property_DATA = root.res en.res en_US.res
@@ -705,6 +706,25 @@
echo " rm -f '$(DESTDIR)$(cgibindir)/$$f'"; \
rm -f "$(DESTDIR)$(cgibindir)/$$f"; \
done
+install-nodist_binSCRIPTS: $(nodist_bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(nodist_bin_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 " $(nodist_binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(nodist_binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-nodist_binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nodist_bin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -1109,7 +1129,7 @@
check: check-am
all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) config.h
installdirs:
- for dir in "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cgibindir)" "$(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)$(bindir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(gwinfodir)" "$(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
@@ -1166,7 +1186,7 @@
install-dist_pbhtmlDATA install-nodist_contextDATA \
install-nodist_propertyDATA
-install-exec-am:
+install-exec-am: install-nodist_binSCRIPTS
install-info: install-info-am
@@ -1199,7 +1219,8 @@
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_binSCRIPTS uninstall-nodist_contextDATA \
+ uninstall-nodist_propertyDATA
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-cgibinPROGRAMS clean-generic clean-libtool \
@@ -1215,16 +1236,17 @@
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-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile 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 \
+ install-nodist_binSCRIPTS install-nodist_contextDATA \
+ install-nodist_propertyDATA install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ 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_binSCRIPTS \
uninstall-nodist_contextDATA uninstall-nodist_propertyDATA
--- setup.in DELETED ---
16 years, 2 months
[Fedora-directory-commits] dsgw/orghtml orgchart.tmpl.in, NONE, 1.1 botframe.html, 1.1, 1.2 topframe.html.in, 1.1, 1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsgw/orghtml
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24762/dsgw/orghtml
Modified Files:
botframe.html topframe.html.in
Added Files:
orgchart.tmpl.in
Log Message:
get phonebook and orgchart working; use memmove instead of overlapping strcpy; fix memory error in dsgw_dn_parent
--- NEW FILE orgchart.tmpl.in ---
#
# 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., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA.
#
# In addition, as a special exception, Red Hat, Inc. gives You the additional
# right to link the code of this Program with code not covered under the GNU
# General Public License ("Non-GPL Code") and to distribute linked combinations
# including the two, subject to the limitations in this paragraph. Non-GPL Code
# permitted under this exception must only link to the code of this Program
# through those well defined interfaces identified in the file named EXCEPTION
# found in the source code files (the "Approved Interfaces"). The files of
# Non-GPL Code may instantiate templates or use macros or inline functions from
# the Approved Interfaces without causing the resulting work to be covered by
# the GNU General Public License. Only Red Hat, Inc. may make changes or
# additions to the list of Approved Interfaces. You must obey the GNU General
# Public License in all respects for all of the Program code and other code used
# in conjunction with the Program except the Non-GPL Code covered by this
# exception. If you modify this file, you may extend this exception to your
# version of the file, but you are not obligated to do so. If you do not wish to
# provide this exception without modification, you must delete this exception
# statement from your version and license this file solely under the GPL without
# exception.
#
#
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
#
#############
#
#
# Configuration file for Directory Server Org Chart
# ----------------------------------------------------------
#
#
#############
#
# Blank lines in this file, as well as lines that
# start with at least one "#" character, are both ignored.
#
#
# Name/Value pairs below are (and need to be) separated with
# one or more tabs (or spaces)
#
ldap-host @host@
ldap-port @port@
ldap-search-base @suffix@
#
# If you would like to have the phonebook icon visible, you must
# supply the partial phonebook URL below, which will have each
# given user's DN attribute value concatenated to the end.
#
# For example, you could specify below something close to:
#
# url-phonebook-base http://hostname.domain.com/dsgw/bin/dosearch?context=default&hp=localhost...
#
url-phonebook-base http://@host@:@httpport@@cgiuri@/dosearch?context=pb&hp=@host@:@port@&dn=
#
# A name that has no value after it equates to "" for the value,
# like the two below settings.
#
# Not listing an entire name/value pair at all in this file
# sets its value to "" as well.
#
# So the below two names therefore don't even need to be in this file
# (but are here to show them as possible options that can be changed).
#
# Having no value below for "ldap-bind-dn" and "ldap-bind-pass"
# indicates that you want anonymous binding to the LDAP server.
#
ldap-bind-dn
ldap-bind-pass
#
# Allowed values for below icon-related setting:
#
# forefront means show this icon next to the person's name
# layer means show this icon inside the person's floating layer
# no means never show this icon anywhere, but MyOrgChart settings can override this setting.
# disabled means never show this icon. Period. So MyOrgChart will not even show this icon as a setting.
#
icons-aim-visible disabled
icons-email-visible layer
icons-phonebook-visible forefront
icons-locator-visible disabled
#
# There is also the same concept below for a person-locator
# type application, to show graphically where a given employee's office is located.
# You also specify the partial URL, up until where the user's URL-
# encoded cn value will be concatenated.
#
# url-locator-base http://hostname.domain.com/submit.cgi?empfullname=
#
url-locator-base http://maps.example.com/submit2.cgi?r_loc=
#
# This is where you specify which specific LDAP attributes
# from your LDAP server that you would like used for both org chart
# generation as well as final display values.
#
# The value of the attribute specified for "attrib-job-title" will
# be listed below anybody's name that is listed in their own box.
# If you don't specify this setting in this file, the default used
# will be "title".
#
# For "attrib-farleft-rdn", this specifies which attribute you are
# using as the leftmost RDN for the DN's of your user entries.
#
attrib-job-title title
attrib-manager manager
attrib-farleft-rdn uid
#
# This is where you specify the maximum levels that are allowed
# to be generated for any given org chart, and the MyOrgChart version
# of this setting will never be allowed to be higher than the below.
#
# A "level" is defined as a reporting level, meaning that if you
# generate an org chart for a given director, all direct reports to him
# (whether they have people below them or not) are level 1, people below
# any of them are level 2, etc.
#
# So a setting of 1 would list the full name of the user entered, and
# then just people that directly report to that person only.
#
# The purpose of having this configuration setting is to give you
# control over users that may try to generate an org chart on the
# CEO of a company, and heavily tax the LDAP server to generate
# an org chart that may be thousands of people deep.
#
# If this setting is not listed below, the default is 3.
#
# The valid range of values for this setting would be a minimum of 1,
# with no hard-coded maximum.
#
max-levels-drawn 3
#
# The below setting relates to whether a specific assumption should be made
# on all values that you currently have stored for your manager LDAP attribute.
#
# The assumption: That all user entries are stored in LDAP on the
# same flat level location, at least for a given
# group of people that org charts will be generated for.
#
# So when you enter:
#
# Steve Jones
#
# to generate an org chart on, which let's say equates to this DN:
#
# uid=sjones, ou=People, dc=acme, dc=com
#
# then should this application assume that the manager attrib value
# of this entry is in this same location as Steve Jones:
#
# manager = "uid=XXXXXX, ou=People, dc=acme, dc=com"
#
# or is it possible that the manager's LDAP entry is at another level?
#
#
# The below two options for this setting specifies one of two scenarios,
# based on how you have configured your directory information tree:
#
#
# Either the value:
#
# same This means assume the same location (such as
# "ou=People, dc=acme, dc=com" above) that the inital
# user entry is found at for all subsequent entries
# involved in drawing that given org chart.
#
# In other words, this setting assumes a totally
# flat namespace, at least for all users that will
# be in a given generated org chart.
#
# search This means there is no guarantee that other entries
# that need to be discovered to draw the org chart
# are in the same area of the directory tree, so when
# searching the manager attribute DN values for a given
# exact uid, search like this instead:
#
# manager = "uid=sjones,*"
#
# This will be much more expensive of a search, so
# if you fit this scenario, at least make sure on your LDAP
# server that you have the substring index created for your
# manager attribute, to make drawing the org chart as fast
# as possible.
#
# Default value (if this setting is not listed in this file): same
#
manager-DN-location same
#
# This setting helps you configure against users entering LDAP
# queries for "A" or "MI" and then taxing the LDAP server by asking
# for thousands of search results back.
#
# The value you specify below for "min-chars-searchstring" means
# that the user must enter AT LEAST this many characters for
# their request to even make it to the LDAP server. If they type
# less characters than this setting, they will get a message that
# they need to enter at least X characters to search, where X will
# be the below value.
#
# NOTE: This setting purposely does not apply to allowing a user
# to search for an exact UID (to avoid search results). The logic
# is that:
#
# [1] Search LDAP for an equality search of (uid=XXXX), regardless
# of both this below setting / how many characters were entered.
#
# [2] If this single LDAP entry was not found, then make sure the
# number of characters entered for the search are at least the below
# number of characters, before sending a broader search to LDAP.
#
# If this setting is not configured below (the line is absent),
# the default value used is 4.
min-chars-searchstring 4
# Allowed characters in search filters. If the user enters a search that
# contains a character not in the allowed-filter-chars list, the user
# will be notified the search needs to be modified.
allowed-filter-chars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 _-
Index: botframe.html
===================================================================
RCS file: /cvs/dirsec/dsgw/orghtml/botframe.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- botframe.html 11 Jan 2008 21:58:10 -0000 1.1
+++ botframe.html 28 Jan 2008 21:22:48 -0000 1.2
@@ -57,6 +57,6 @@
</tr>
</table>
<br><br>
-<tr align="center"><img src="images/starthelp.gif" border="0" alt=""></tr>
+<tr align="center"><img src="starthelp.gif" border="0" alt=""></tr>
</body>
</html>
Index: topframe.html.in
===================================================================
RCS file: /cvs/dirsec/dsgw/orghtml/topframe.html.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- topframe.html.in 11 Jan 2008 21:58:10 -0000 1.1
+++ topframe.html.in 28 Jan 2008 21:22:48 -0000 1.2
@@ -100,12 +100,12 @@
<span class="apptext">
<FORM name="form2" Method=POST action="@cgiuri@/org" target="output_window" onsubmit="return doSearch(document.form2.data.value)">
<font face=\"verdana, Arial, Helvetica, sans-serif\" style=\"font-size: 12px\">
- <INPUT TYPE="TEXT" NAME="data" SIZE=20 MAXLENGTH=20>
- <input type="submit" name="Submit" value="Go">
+ <INPUT TYPE="TEXT" NAME="data" SIZE=20 MAXLENGTH=20>
+ <input type="submit" name="Submit" value="Go">
</font>
- </span>
- </TD>
</FORM>
+ </span>
+ </TD>
</TR></TABLE>
</TD>
<TD ALIGN=RIGHT>
16 years, 2 months
[Fedora-directory-commits] dsgw/pbconfig pb.tmpl.in,1.1,1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsgw/pbconfig
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24762/dsgw/pbconfig
Modified Files:
pb.tmpl.in
Log Message:
get phonebook and orgchart working; use memmove instead of overlapping strcpy; fix memory error in dsgw_dn_parent
Index: pb.tmpl.in
===================================================================
RCS file: /cvs/dirsec/dsgw/pbconfig/pb.tmpl.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pb.tmpl.in 14 Jan 2008 22:31:23 -0000 1.1
+++ pb.tmpl.in 28 Jan 2008 21:22:49 -0000 1.2
@@ -44,7 +44,7 @@
securitypath "@contextdir@"
-url-orgchart-base http://@host@:@port@/clients/orgchart/bin/org?context=pb&data=
+url-orgchart-base http://@host@:@httpport@@cgiuri@/org?context=pb&data=
# The attribute the orgchart uses to search for entries.
# This value should correspond to the value of attrib-farleft-rdn
16 years, 2 months
[Fedora-directory-commits] dsgw/orgbin myorg.in, 1.1, 1.2 org.in, 1.1, 1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsgw/orgbin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24762/dsgw/orgbin
Modified Files:
myorg.in org.in
Log Message:
get phonebook and orgchart working; use memmove instead of overlapping strcpy; fix memory error in dsgw_dn_parent
Index: myorg.in
===================================================================
RCS file: /cvs/dirsec/dsgw/orgbin/myorg.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- myorg.in 11 Jan 2008 21:58:10 -0000 1.1
+++ myorg.in 28 Jan 2008 21:22:48 -0000 1.2
@@ -42,8 +42,7 @@
#set ts=4
$|=1;
-print "Content-type: te@orguri@;charset=UTF-8\n\n";
-#print "Content-type: te@orguri@\n\n";
+print "Content-type: text/html;charset=UTF-8\n\n";
#
# Read orgchart.conf settings for MyOrgChart-specific items
@@ -66,7 +65,7 @@
&print_body();
-print @orguri@>";
+print "</html>";
exit(0);
Index: org.in
===================================================================
RCS file: /cvs/dirsec/dsgw/orgbin/org.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- org.in 11 Jan 2008 21:58:10 -0000 1.1
+++ org.in 28 Jan 2008 21:22:48 -0000 1.2
@@ -2027,7 +2027,7 @@
if ( $js_output ne "with-javascript" )
{
- print " <LINK REL=stylesheet TYPE=\"text/css\" HREF=\"../html/styles.css\">\n";
+ print " <LINK REL=stylesheet TYPE=\"text/css\" HREF=\"@orguri(a)/styles.css\">\n";
}
if ( $js_output eq "with-javascript" )
{
16 years, 2 months
[Fedora-directory-commits] dsgw Makefile.am, 1.7, 1.8 auth.c, 1.2, 1.3 config.c, 1.4, 1.5 configure.ac, 1.6, 1.7 csearch.c, 1.2, 1.3 doauth.c, 1.2, 1.3 domodify.c, 1.1.1.1, 1.2 dsgw-httpd.conf.in, 1.4, 1.5 dsgwgetlang.c, 1.3, 1.4 dsgwutil.c, 1.5, 1.6 edit.c, 1.2, 1.3 emitauth.c, 1.1.1.1, 1.2 entrydisplay.c, 1.2, 1.3 ldaputil.c, 1.1.1.1, 1.2 setup.in, 1.2, 1.3 aclocal.m4, 1.4, 1.5 configure, 1.7, 1.8 missing, 1.3, 1.4 install-sh, 1.3, 1.4 Makefile.in, 1.7, 1.8 depcomp, 1.3, 1.4 config.sub, 1.3, 1.4 config.gu
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsgw
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24762/dsgw
Modified Files:
Makefile.am auth.c config.c configure.ac csearch.c doauth.c
domodify.c dsgw-httpd.conf.in dsgwgetlang.c dsgwutil.c edit.c
emitauth.c entrydisplay.c ldaputil.c setup.in aclocal.m4
configure missing install-sh Makefile.in depcomp config.sub
config.guess compile
Log Message:
get phonebook and orgchart working; use memmove instead of overlapping strcpy; fix memory error in dsgw_dn_parent
Index: Makefile.am
===================================================================
RCS file: /cvs/dirsec/dsgw/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Makefile.am 16 Jan 2008 22:56:02 -0000 1.7
+++ Makefile.am 28 Jan 2008 21:22:47 -0000 1.8
@@ -150,7 +150,7 @@
orghtml/branch-cc1.gif orghtml/index.html orghtml/ldap-person.gif \
orghtml/mag.gif orghtml/mail.gif orghtml/new-branch-blank.gif \
orghtml/new-branch-first.gif orghtml/new-branch-straight.gif orghtml/orgicon.gif \
- orghtml/styles.css orghtml/topframe.html
+ orghtml/styles.css orghtml/topframe.html orghtml/starthelp.gif orghtml/orgchart.tmpl
dist_config_DATA = \
@@ -253,9 +253,9 @@
-e 's,@localstatedir\@,$(localstatedir),g' \
-e 's,@cgibindir\@,$(cgibindir),g' \
-e 's,@cgiuri\@,$(cgiuri),g' \
- -e 's,@orguri\@,$(orguri),g' \
- -e 's,@dsgwuri\@,$(dsgwuri),g' \
- -e 's,@pburi\@,$(pburi),g' \
+ -e 's,@orguri\@,@orguri@,g' \
+ -e 's,@dsgwuri\@,@dsgwuri@,g' \
+ -e 's,@pburi\@,@pburi@,g' \
-e 's,@cmdbindir\@,$(cmdbindir),g' \
-e 's,@propertydir\@,$(propertydir),g' \
-e 's,@htmldir\@,$(htmldir),g' \
Index: auth.c
===================================================================
RCS file: /cvs/dirsec/dsgw/auth.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- auth.c 14 Jan 2008 22:58:30 -0000 1.2
+++ auth.c 28 Jan 2008 21:22:47 -0000 1.3
@@ -122,3 +122,11 @@
dsgw_emit_auth_form( binddn );
}
+
+/*
+ emacs settings
+ Local Variables:
+ indent-tabs-mode: t
+ tab-width: 8
+ End:
+*/
Index: config.c
===================================================================
RCS file: /cvs/dirsec/dsgw/config.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- config.c 14 Jan 2008 22:58:30 -0000 1.4
+++ config.c 28 Jan 2008 21:22:47 -0000 1.5
@@ -192,6 +192,11 @@
gc->gc_ClientLanguage = p;
}
+ /* set languages for string database */
+ SetLanguage(CLIENT_LANGUAGE,gc->gc_ClientLanguage);
+ SetLanguage(ADMIN_LANGUAGE,gc->gc_AdminLanguage);
+ SetLanguage(DEFAULT_LANGUAGE,gc->gc_DefaultLanguage);
+
/* Set rest of config. by reading the appropriate config files */
path = dsgw_ch_malloc( MAXPATHLEN );
@@ -1064,6 +1069,7 @@
tmp = next;
for ( inquote = 0; *next; ) {
+ size_t nextlen;
switch ( *next ) {
case '"':
if ( inquote ) {
@@ -1071,12 +1077,14 @@
} else {
inquote = 1;
}
- strcpy( next, next + 1 );
+ nextlen = strlen(next); /* to include trailing null */
+ memmove( next, next + 1, nextlen );
break;
#ifndef _WIN32
case '\\':
- strcpy( next, next + 1 );
+ nextlen = strlen(next); /* to include trailing null */
+ memmove( next, next + 1, nextlen );
break;
#endif
Index: configure.ac
===================================================================
RCS file: /cvs/dirsec/dsgw/configure.ac,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- configure.ac 16 Jan 2008 22:56:02 -0000 1.6
+++ configure.ac 28 Jan 2008 21:22:47 -0000 1.7
@@ -287,8 +287,8 @@
# URIs
cgiuri=/cgi-bin
dsgwuri=/dsgw
-orguri=/orgchart
-pburi=/dsgw/pbhtml
+orguri=/org
+pburi=/pb
# Check for library dependencies
m4_include(m4/nspr.m4)
Index: csearch.c
===================================================================
RCS file: /cvs/dirsec/dsgw/csearch.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- csearch.c 14 Jan 2008 22:58:30 -0000 1.2
+++ csearch.c 28 Jan 2008 21:22:47 -0000 1.3
@@ -330,3 +330,11 @@
}
fclose (html);
}
+
+/*
+ emacs settings
+ Local Variables:
+ indent-tabs-mode: t
+ tab-width: 8
+ End:
+*/
Index: doauth.c
===================================================================
RCS file: /cvs/dirsec/dsgw/doauth.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- doauth.c 15 Jan 2008 18:23:43 -0000 1.2
+++ doauth.c 28 Jan 2008 21:22:47 -0000 1.3
@@ -420,6 +420,6 @@
emacs settings
Local Variables:
indent-tabs-mode: t
- tab-width: 4
+ tab-width: 8
End:
*/
Index: domodify.c
===================================================================
RCS file: /cvs/dirsec/dsgw/domodify.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- domodify.c 1 Jun 2006 19:43:47 -0000 1.1.1.1
+++ domodify.c 28 Jan 2008 21:22:47 -0000 1.2
@@ -1041,3 +1041,11 @@
return( rc );
}
+
+/*
+ emacs settings
+ Local Variables:
+ indent-tabs-mode: t
+ tab-width: 8
+ End:
+*/
Index: dsgw-httpd.conf.in
===================================================================
RCS file: /cvs/dirsec/dsgw/dsgw-httpd.conf.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dsgw-httpd.conf.in 14 Jan 2008 22:58:30 -0000 1.4
+++ dsgw-httpd.conf.in 28 Jan 2008 21:22:47 -0000 1.5
@@ -32,6 +32,7 @@
# URI aliases for html content
Alias @dsgwuri@ @htmldir@
+Alias @pburi@ @pbhtmldir@
Alias @orguri@ @orghtmldir@
# legacy mappings
@@ -39,6 +40,7 @@
Alias /clients/dsgw/pbhtml @pbhtmldir@
Alias /clients/dsgw/config @configdir@
Alias /clients/dsgw/pbconfig @pbconfigdir@
+Alias /clients/orgchart/html @orghtmldir@
# Allow access to the dsgw html files
<Directory "@htmldir@">
Index: dsgwgetlang.c
===================================================================
RCS file: /cvs/dirsec/dsgw/dsgwgetlang.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- dsgwgetlang.c 14 Jan 2008 22:58:30 -0000 1.3
+++ dsgwgetlang.c 28 Jan 2008 21:22:47 -0000 1.4
@@ -111,11 +111,11 @@
the current language setting.
*********************************************************************/
-static char emptyString[] = "";
+static char *emptyString = "";
-static char client_language[128] = "en";
-static char admin_language[128] = "en";
-static char default_language[128] = "en";
+static char *client_language;
+static char *admin_language;
+static char *default_language;
PR_IMPLEMENT( void )
SetLanguage(int type, char *language)
@@ -123,15 +123,15 @@
switch(type) {
case CLIENT_LANGUAGE:
if (language)
- strcpy(client_language, language);
+ client_language = PL_strdup(language);
break;
case ADMIN_LANGUAGE:
if (language)
- strcpy(admin_language, language);
+ admin_language = PL_strdup(language);
break;
case DEFAULT_LANGUAGE:
if (language)
- strcpy(default_language, language);
+ default_language = PL_strdup(language);
break;
}
return ;
@@ -328,19 +328,19 @@
PR_IMPLEMENT( char * )
XP_GetClientStr(int key)
{
- static char staticbuf[256];
+ static char staticbuf[256] = {0};
static char *resstring = staticbuf;
static size_t bufsize = sizeof(staticbuf);
int rc = 0;
char keybuf[256];
+ char *lang = GetClientLanguage();
PR_snprintf(keybuf, sizeof(keybuf), "%s%d", database_name, key);
-
- resstring = res_getstring(i18nResource, keybuf, GetClientLanguage(),
+ resstring = res_getstring(i18nResource, keybuf, lang,
resstring, bufsize, &rc);
if (rc == 1) { /* need more room */
/* NULL means res_getstring will calculate and return needed memory */
- resstring = res_getstring(i18nResource, keybuf, GetClientLanguage(),
+ resstring = res_getstring(i18nResource, keybuf, lang,
NULL, bufsize, &rc);
bufsize = strlen(resstring);
}
@@ -352,4 +352,8 @@
{
database_name = strdup(dbname);
i18nResource = res_init_resource(path, NULL);
+ /* set default languages for string database */
+ SetLanguage(CLIENT_LANGUAGE, "");
+ SetLanguage(ADMIN_LANGUAGE, "");
+ SetLanguage(DEFAULT_LANGUAGE, "");
}
Index: dsgwutil.c
===================================================================
RCS file: /cvs/dirsec/dsgw/dsgwutil.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- dsgwutil.c 15 Jan 2008 18:23:43 -0000 1.5
+++ dsgwutil.c 28 Jan 2008 21:22:47 -0000 1.6
@@ -95,10 +95,6 @@
/* initialize the string database */
XP_InitStringDatabase(PROPERTYDIR, "dsgw");
- /* set default default languages for string database */
- SetLanguage(CLIENT_LANGUAGE, "");
- SetLanguage(ADMIN_LANGUAGE, "");
- SetLanguage(DEFAULT_LANGUAGE, "");
if (( progname = strchr( argv[0], '/' )) == NULL ) {
progname = dsgw_ch_strdup( argv[0] );
@@ -178,11 +174,6 @@
}
}
- /* set languages for string database */
- SetLanguage(CLIENT_LANGUAGE,gc->gc_ClientLanguage);
- SetLanguage(ADMIN_LANGUAGE,gc->gc_AdminLanguage);
- SetLanguage(DEFAULT_LANGUAGE,gc->gc_DefaultLanguage);
-
/* Figure out the language that libsi18n is using */
figure_out_langwich();
Index: edit.c
===================================================================
RCS file: /cvs/dirsec/dsgw/edit.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- edit.c 14 Jan 2008 22:58:30 -0000 1.2
+++ edit.c 28 Jan 2008 21:22:47 -0000 1.3
@@ -240,12 +240,10 @@
ldap_unbind( ld );
}
-
-
-
-
-
-
-
-
-
+/*
+ emacs settings
+ Local Variables:
+ indent-tabs-mode: t
+ tab-width: 8
+ End:
+*/
Index: emitauth.c
===================================================================
RCS file: /cvs/dirsec/dsgw/emitauth.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- emitauth.c 1 Jun 2006 19:43:44 -0000 1.1.1.1
+++ emitauth.c 28 Jan 2008 21:22:47 -0000 1.2
@@ -326,9 +326,10 @@
}
}
-
-
-
-
-
-
+/*
+ emacs settings
+ Local Variables:
+ indent-tabs-mode: t
+ tab-width: 8
+ End:
+*/
Index: entrydisplay.c
===================================================================
RCS file: /cvs/dirsec/dsgw/entrydisplay.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- entrydisplay.c 15 Jan 2008 18:23:43 -0000 1.2
+++ entrydisplay.c 28 Jan 2008 21:22:47 -0000 1.3
@@ -3199,3 +3199,11 @@
return( (char *) obuf);
}
+
+/*
+ emacs settings
+ Local Variables:
+ indent-tabs-mode: t
+ tab-width: 8
+ End:
+*/
Index: ldaputil.c
===================================================================
RCS file: /cvs/dirsec/dsgw/ldaputil.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ldaputil.c 1 Jun 2006 19:43:43 -0000 1.1.1.1
+++ ldaputil.c 28 Jan 2008 21:22:47 -0000 1.2
@@ -1153,22 +1153,28 @@
char *dnp;
int i;
char **rdns;
+ size_t len;
- if ( dn == NULL ) {
+ if ( dn == NULL || !*dn ) {
return( NULL );
}
- dnp = dsgw_ch_malloc( strlen( dn ));
+ len = strlen(dn);
+ dnp = dsgw_ch_malloc( len );
dnp[ 0 ] = '\0';
if (( rdns = ldap_explode_dn( dn, 0 )) == NULL ) {
+ free(dnp);
return NULL;
}
- for ( i = 1; rdns[ i ] != NULL; i++ ) {
+ for ( i = 1; (rdns[0] != NULL) && (rdns[ i ] != NULL); i++ ) {
strcat( dnp, rdns[ i ] );
strcat( dnp, "," );
}
/* Get rid of the trailing "," we just appended */
- dnp[ strlen( dnp ) - 1 ] = '\0';
+ len = strlen(dnp);
+ if (len > 0) {
+ dnp[ len - 1 ] = '\0';
+ }
ldap_value_free( rdns );
return( dnp );
}
@@ -1566,3 +1572,11 @@
}
}
}
+
+/*
+ emacs settings
+ Local Variables:
+ indent-tabs-mode: t
+ tab-width: 8
+ End:
+*/
Index: setup.in
===================================================================
RCS file: /cvs/dirsec/dsgw/setup.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- setup.in 2 Jun 2006 22:57:17 -0000 1.2
+++ setup.in 28 Jan 2008 21:22:47 -0000 1.3
@@ -182,6 +182,7 @@
port=`getValFromInf ServerPort $inffile`
suffix=`getValFromInf Suffix $inffile`
dirmgr=`getValFromInf RootDN $inffile`
+ httpport=`getValFromInf Port $inffile`
fi
# if silent mode, do not run the pre-installer programs
@@ -242,6 +243,7 @@
# generate dsgw.conf and pb.conf and default.conf in the @contextdir@ directory
sed -e "s#@host@#$hostname#g" \
-e "s#@port@#$port#g" \
+ -e "s#@httpport@#$httpport#g" \
-e "s#@suffix@#$suffix#g" \
-e "s#@dirmgr@#$dirmgr#g" \
-e "s#\@contextdir\@#@contextdir@#g" \
@@ -249,11 +251,20 @@
sed -e "s#@host@#$hostname#g" \
-e "s#@port@#$port#g" \
+ -e "s#@httpport@#$httpport#g" \
-e "s#@suffix@#$suffix#g" \
-e "s#@dirmgr@#$dirmgr#g" \
-e "s#\@contextdir\@#@contextdir@#g" \
@pbconfigdir(a)/pb.tmpl > @contextdir(a)/pb.conf
+sed -e "s#@host@#$hostname#g" \
+ -e "s#@port@#$port#g" \
+ -e "s#@httpport@#$httpport#g" \
+ -e "s#@suffix@#$suffix#g" \
+ -e "s#@dirmgr@#$dirmgr#g" \
+ -e "s#\@contextdir\@#@contextdir@#g" \
+ @orghtmldir(a)/orgchart.tmpl > @contextdir(a)/orgchart.conf
+
# the default.conf is just a copy of dsgw.conf
cp @contextdir(a)/dsgw.conf @contextdir(a)/default.conf
Index: configure
===================================================================
RCS file: /cvs/dirsec/dsgw/configure,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- configure 16 Jan 2008 22:56:02 -0000 1.7
+++ configure 28 Jan 2008 21:22:47 -0000 1.8
@@ -21569,8 +21569,8 @@
# URIs
cgiuri=/cgi-bin
dsgwuri=/dsgw
-orguri=/orgchart
-pburi=/dsgw/pbhtml
+orguri=/org
+pburi=/pb
# Check for library dependencies
# BEGIN COPYRIGHT BLOCK
Index: Makefile.in
===================================================================
RCS file: /cvs/dirsec/dsgw/Makefile.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Makefile.in 16 Jan 2008 22:56:02 -0000 1.7
+++ Makefile.in 28 Jan 2008 21:22:47 -0000 1.8
@@ -456,7 +456,7 @@
orghtml/branch-cc1.gif orghtml/index.html orghtml/ldap-person.gif \
orghtml/mag.gif orghtml/mail.gif orghtml/new-branch-blank.gif \
orghtml/new-branch-first.gif orghtml/new-branch-straight.gif orghtml/orgicon.gif \
- orghtml/styles.css orghtml/topframe.html
+ orghtml/styles.css orghtml/topframe.html orghtml/starthelp.gif orghtml/orgchart.tmpl
dist_config_DATA = \
config/authPassword.html config/dsgw-l10n.conf \
@@ -531,9 +531,9 @@
-e 's,@localstatedir\@,$(localstatedir),g' \
-e 's,@cgibindir\@,$(cgibindir),g' \
-e 's,@cgiuri\@,$(cgiuri),g' \
- -e 's,@orguri\@,$(orguri),g' \
- -e 's,@dsgwuri\@,$(dsgwuri),g' \
- -e 's,@pburi\@,$(pburi),g' \
+ -e 's,@orguri\@,@orguri@,g' \
+ -e 's,@dsgwuri\@,@dsgwuri@,g' \
+ -e 's,@pburi\@,@pburi@,g' \
-e 's,@cmdbindir\@,$(cmdbindir),g' \
-e 's,@propertydir\@,$(propertydir),g' \
-e 's,@htmldir\@,$(htmldir),g' \
16 years, 2 months
[Fedora-directory-commits] dsgw/config dsgw.tmpl.in,1.1,1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsgw/config
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24762/dsgw/config
Modified Files:
dsgw.tmpl.in
Log Message:
get phonebook and orgchart working; use memmove instead of overlapping strcpy; fix memory error in dsgw_dn_parent
Index: dsgw.tmpl.in
===================================================================
RCS file: /cvs/dirsec/dsgw/config/dsgw.tmpl.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dsgw.tmpl.in 14 Jan 2008 22:45:23 -0000 1.1
+++ dsgw.tmpl.in 28 Jan 2008 21:22:48 -0000 1.2
@@ -44,7 +44,7 @@
securitypath "@contextdir@"
-url-orgchart-base http://@host@:@port@/clients/orgchart/bin/org?context=dsgw&data=
+url-orgchart-base http://@host@:@httpport@@cgiuri@/org?context=dsgw&data=
# The attribute the orgchart uses to search for entries.
# This value should correspond to the value of attrib-farleft-rdn
16 years, 2 months