[Fedora-directory-commits] admservconsole fedora-admserv-console.spec, NONE, 1.1 build.properties, 1.3, 1.4 build.xml, 1.1.1.1, 1.2
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/admservconsole
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6902
Modified Files:
build.properties build.xml
Added Files:
fedora-admserv-console.spec
Log Message:
Resolves: 247525
Summary: Fixed parameters passed to ReadLog CGI. Also some packaging/build changes for building RPMs as well as a version bump.
--- NEW FILE fedora-admserv-console.spec ---
%define major_version 1.1
%define minor_version 0
Name: fedora-admserv-console
Version: %{major_version}.%{minor_version}
Release: 1
Group: Applications
Vendor: Fedora Project
URL: http://directory.fedora.redhat.com
License: LGPL
Packager: Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary: Fedora Directory Server Management Console
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch
Source: %{name}-%{version}.tar.gz
Autoreq: 0
AutoReqProv: no
BuildPreReq: ant >= 1.6.2, ldapjdk >= 4.18, fedora-console-framework >= 1.1
%description
A Java based remote management console used for Managing Fedora
Administration Server.
# prep and setup expect there to be a Source file
# in the /usr/src/redhat/SOURCES directory - it will be unpacked
# in the _builddir (not BuildRoot)
%prep
%setup -q
%build
cd admservconsole
ant -Dconsole.location=/usr/share/java
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/usr/share/java
install -m777 built/package/fedora-admserv* $RPM_BUILD_ROOT/usr/share/java
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/usr/share/java/fedora-admserv-%{version}.jar
/usr/share/java/fedora-admserv-%{version}_en.jar
%post
cd /usr/share/java
ln -s fedora-admserv-%{version}.jar fedora-admserv-%{major_version}.jar
ln -s fedora-admserv-%{version}.jar fedora-admserv.jar
ln -s fedora-admserv-%{version}_en.jar fedora-admserv-%{major_version}_en.jar
ln -s fedora-admserv-%{version}_en.jar fedora-admserv_en.jar
%preun
rm -rf /usr/share/java/fedora-admserv-%{major_version}.jar
rm -rf /usr/share/java/fedora-admserv.jar
rm -rf /usr/share/java/fedora-admserv-%{major_version}_en.jar
rm -rf /usr/share/java/fedora-admserv_en.jar
%changelog
* Tue Jul 03 2007 Nathan Kinder <nkinder(a)redhat.com> 1.1.0-1
- Initial creation
Index: build.properties
===================================================================
RCS file: /cvs/dirsec/admservconsole/build.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- build.properties 29 Sep 2006 17:17:27 -0000 1.3
+++ build.properties 9 Jul 2007 20:10:09 -0000 1.4
@@ -21,8 +21,8 @@
lang=en
admservconsole.root=..
-admservconsole.version=1.0.3
-admservconsole.gen.version=1.0
+admservconsole.version=1.1.0
+admservconsole.gen.version=1.1
brand=fedora
admservconsole.name=${brand}-admserv-${admservconsole.version}
admservconsole.gen.name=${brand}-admserv-${admservconsole.gen.version}
Index: build.xml
===================================================================
RCS file: /cvs/dirsec/admservconsole/build.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- build.xml 22 May 2006 18:14:31 -0000 1.1.1.1
+++ build.xml 9 Jul 2007 20:10:09 -0000 1.2
@@ -82,10 +82,10 @@
<!-- Construct classpath -->
<path id="admservconsole.classpath">
<fileset dir="${console.location}">
- <include name="**/java/${brand}-base-*.jar"/>
- <include name="**/java/${brand}-mcc-*.jar"/>
- <include name="**/java/${brand}-nmclf-*.jar"/>
- <include name="**/java/ldapjdk.jar"/>
+ <include name="**/${brand}-base-*.jar"/>
+ <include name="**/${brand}-mcc-*.jar"/>
+ <include name="**/${brand}-nmclf-*.jar"/>
+ <include name="**/ldapjdk.jar"/>
</fileset>
<pathelement path="${built.classdir}"/>
</path>
@@ -115,12 +115,6 @@
<include name="com/netscape/management/admserv/**/*.jpg" />
</fileset>
</jar>
- <exec executable="ln" dir="${package.dir}" vmlauncher="true">
- <arg line="-s ${admservconsole.name}.jar ${admservconsole.gen.name}.jar"/>
- </exec>
- <exec executable="ln" dir="${package.dir}" vmlauncher="true">
- <arg line="-s ${admservconsole.name}_${lang}.jar ${admservconsole.gen.name}_${lang}.jar"/>
- </exec>
</target>
<!-- Javadoc -->
16 years, 9 months
[Fedora-directory-commits] console/src/com/netscape/management/client/topology AbstractServerObject.java, 1.3, 1.4 ServerNode.java, 1.3, 1.4
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/console/src/com/netscape/management/client/topology
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14044/src/com/netscape/management/client/topology
Modified Files:
AbstractServerObject.java ServerNode.java
Log Message:
Resolves: 247517
Summary: Removed clone server config menu option.
Index: AbstractServerObject.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/topology/AbstractServerObject.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractServerObject.java 3 Jul 2007 17:27:03 -0000 1.3
+++ AbstractServerObject.java 9 Jul 2007 19:01:01 -0000 1.4
@@ -645,7 +645,7 @@
* @return true if server allows cloning operations
*/
public boolean isCloningEnabled() {
- return true;
+ return false;
}
/**
Index: ServerNode.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/topology/ServerNode.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ServerNode.java 3 Jul 2007 17:27:03 -0000 1.3
+++ ServerNode.java 9 Jul 2007 19:01:01 -0000 1.4
@@ -384,7 +384,7 @@
if (selection != null && selection.length == 1)
{
enableSetACLMenuItem = true;
- enableCloneMenuItem = true;
+ enableCloneMenuItem = false;
if (serverObject instanceof AbstractServerObject)
{
AbstractServerObject aso = (AbstractServerObject)serverObject;
@@ -546,9 +546,11 @@
return new IMenuItem[]{ new MenuItemText(MENU_OPEN_SERVER,
resource.getString("menu", "open"), "",
enableOpenMenuItem),
+ /*
new MenuItemText(MENU_CLONE_SERVER,
resource.getString("menu", "CloneServer"), "",
enableCloneMenuItem),
+ */
new MenuItemText(MENU_REMOVE_SERVER,
resource.getString("menu", "RemoveServer"), "",
enableRemoveMenuItem), new MenuItemSeparator(),
16 years, 9 months
[Fedora-directory-commits] mod_admserv mod_admserv.c,1.31,1.32
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/mod_admserv
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13246/mod_admserv
Modified Files:
mod_admserv.c
Log Message:
Resolves: 247283
Summary: Fixed multiple problems with CGIs used by Admin Server Console.
Index: mod_admserv.c
===================================================================
RCS file: /cvs/dirsec/mod_admserv/mod_admserv.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- mod_admserv.c 22 Jun 2007 22:37:46 -0000 1.31
+++ mod_admserv.c 6 Jul 2007 18:06:19 -0000 1.32
@@ -772,15 +772,17 @@
}
static int
-buildUGInfo(char** errorInfo, const server_rec *s) {
+buildUGInfo(char** errorInfo, const request_rec *r) {
AdmldapInfo info = NULL;
+ server_rec *s = r->server;
int error = 0;
char path[PATH_MAX];
char *userGroupLdapURL = NULL;
char *userGroupBindDN = NULL;
char *userGroupBindPW = NULL;
char *dirInfoRef = NULL;
- int retval = FALSE;
+ int retval = FALSE;
+ char *siedn = NULL;
*errorInfo = (char*)"";
@@ -792,26 +794,40 @@
goto done;
}
- if (!(info = admldapBuildInfo(configdir, &error))) {
+ if (!(info = admldapBuildInfoOnly(configdir, &error))) {
ap_log_error(APLOG_MARK, APLOG_CRIT, 0 /* status */, s,
"buildUGInfo(): unable to create AdmldapInfo (error code = %d)",
error);
goto done;
}
+ /* Temporarily override the siedn. This needs to be
+ * done to get a valid LDAP handle.
+ */
+ siedn = admldapGetSIEDN(info);
+
+ admldapSetSIEDN(info, apr_table_get(r->notes, RQ_NOTES_USERDN));
+ admSetCachedSIEPWD(apr_table_get(r->notes, RQ_NOTES_USERPW));
+
+
if (admldapGetSecurity(info)) {
sslinit(info, configdir);
- if (admldapBuildInfoSSL(info, &error)) {
- } else {
- char *host = admldapGetHost(info);
- ap_log_error(APLOG_MARK, APLOG_CRIT, 0 /* status */, s,
- "buildUGInfo(): unable to initialize TLS connection to LDAP host %s port %d: %d",
- host, admldapGetPort(info), error);
- PL_strfree(host);
- goto done;
- }
}
+ if (!admldapBuildInfoSSL(info, &error)) {
+ char *host = admldapGetHost(info);
+ ap_log_error(APLOG_MARK, APLOG_CRIT, 0 /* status */, s,
+ "buildUGInfo(): unable to initialize TLS connection to LDAP host %s port %d: %d",
+ host, admldapGetPort(info), error);
+ PL_strfree(host);
+ goto done;
+ }
+
+ /* We need to reset the siedn before we call
+ * admldapGetLocalUserDirectory below.
+ */
+ admldapSetSIEDN(info, siedn);
+
userGroupServer.host = NULL;
userGroupServer.port = 0;
userGroupServer.secure = 0;
@@ -839,7 +855,7 @@
goto done;
}
}
-
+
if (!extractLdapServerData(&userGroupServer, userGroupLdapURL, s)) {
*errorInfo = (char*)"unable to extract User/Group LDAP info";
goto done;
@@ -849,6 +865,7 @@
retval = TRUE; /* made it here, so success */
done:
+ PL_strfree(siedn);
PL_strfree(userGroupLdapURL);
PL_strfree(userGroupBindDN);
PL_strfree(userGroupBindPW);
@@ -2211,19 +2228,12 @@
destroyAdmldap(info);
info = NULL;
- /* DT 5/18/98 Change for new User/Group stuff */
-
- /* Populate U/G Info */
+ /* Initialize the UG host to NULL. This will cause the
+ * UG info to be loaded the first time a user authenticates.
+ */
userGroupServer.host = NULL;
- if (buildUGInfo(&errorInfo, base_server) != TRUE) {
- ap_log_error(APLOG_MARK, APLOG_CRIT, 0, base_server,
- "mod_admserv_post_config(): unable to build user/group LDAP server info: %s",
- errorInfo);
- return DONE;
- }
-
/* Register the admin server tasks */
task_register_server(ADMIN_SERVER_ID, registryServer.admservSieDN);
@@ -2418,6 +2428,8 @@
static int userauth(request_rec *r)
{
+ char *dummy = NULL;
+
if (strcmp(r->handler, "user-auth"))
return DECLINED;
@@ -2425,6 +2437,11 @@
if (r->method_number != M_GET)
return DECLINED;
+ /* If U/G Info is not available, try to get it */
+ if (!(userGroupServer.host)) {
+ buildUGInfo(&dummy, r);
+ }
+
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, "userauth, bind %s",
apr_table_get(r->notes, RQ_NOTES_USERDN));
@@ -2614,7 +2631,7 @@
/* If U/G Info is not available, try to get it */
if (!(userGroupServer.host)) {
- buildUGInfo(&dummy, r->server);
+ buildUGInfo(&dummy, r);
}
if (userGroupServer.host) {
16 years, 9 months
[Fedora-directory-commits] adminserver/admserv/cgi-src40 ReadLog.c, 1.7, 1.8 config.c, 1.11, 1.12 sec-activate.c, 1.9, 1.10
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/adminserver/admserv/cgi-src40
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13246/admserv/cgi-src40
Modified Files:
ReadLog.c config.c sec-activate.c
Log Message:
Resolves: 247283
Summary: Fixed multiple problems with CGIs used by Admin Server Console.
Index: ReadLog.c
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/ReadLog.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ReadLog.c 11 May 2007 19:44:05 -0000 1.7
+++ ReadLog.c 6 Jul 2007 18:06:19 -0000 1.8
@@ -87,15 +87,10 @@
int getLogNames()
{
- char line[BIG_LINE];
- const char *logdir = util_get_log_dir();
+ char line[BIG_LINE];
const char *configdir = util_get_conf_dir();
- char filename[BIG_LINE];
- FILE *f;
-
- if (!logdir) {
- return 0;
- }
+ char filename[BIG_LINE];
+ FILE *f;
if (!util_find_file_in_paths(filename, sizeof(filename), "local.conf",
configdir, "", "admin-serv/config")) {
@@ -112,12 +107,12 @@
if(PL_strcasestr(line, "nserrorlog"))
{
- PR_snprintf(errorlog, sizeof(errorlog), "%s/%s", logdir, getLogName(line));
+ PR_snprintf(errorlog, sizeof(errorlog), "%s", getLogName(line));
}
else
if(PL_strcasestr(line, "nsaccesslog"))
{
- PR_snprintf(accesslog, sizeof(accesslog), "%s/%s", logdir, getLogName(line));
+ PR_snprintf(accesslog, sizeof(accesslog), "%s", getLogName(line));
}
}
fclose(f);
Index: config.c
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/config.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- config.c 22 Jun 2007 01:34:19 -0000 1.11
+++ config.c 6 Jul 2007 18:06:19 -0000 1.12
@@ -225,10 +225,6 @@
if (binddn) rv = ADM_GetCurrentPassword(&err, &bindpw);
adminfo = admldapBuildInfo(configdir, &rv);
- if (adminfo) {
- binddn = admldapGetSIEDN(adminfo);
- bindpw = admldapGetSIEPWD(adminfo);
- }
errorCode = ADMSSL_InitSimple(configdir, secdir, 0);
if (errorCode) {
Index: sec-activate.c
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/sec-activate.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- sec-activate.c 11 May 2007 19:44:05 -0000 1.9
+++ sec-activate.c 6 Jul 2007 18:06:19 -0000 1.10
@@ -607,16 +607,6 @@
ssl3_act = get_cgi_var("ssl3-activated", "", "");
clientauth = get_cgi_var("clientauth", "", "");
- /* Parse out complete family list */
- get_family_input(&family_head);
-
- /* SET SSL VARIABLES via pset */
-
- /* first, cipher family info */
- SetSSLFamilyAttributes(pset, family_head, ssl2, ssl3, ssl2_act, ssl3_act);
-
- set_attribute(pset, "configuration.encryption.nsSSLClientAuth", clientauth);
-
/* change "security" in LDAP and adm.conf to "on"/"off" */
set_security(pset, configdir, security);
@@ -632,6 +622,14 @@
char protocols[BIG_LINE];
char ciphers[BIG_LINE];
+ /* Parse out complete family list */
+ get_family_input(&family_head);
+
+ /* set cipher family info */
+ SetSSLFamilyAttributes(pset, family_head, ssl2, ssl3, ssl2_act, ssl3_act);
+
+ set_attribute(pset, "configuration.encryption.nsSSLClientAuth", clientauth);
+
if (get_cert_nickname(certnickname, sizeof(certnickname)) < 0) {
char * scratch = PR_smprintf(getResourceString(DBT_CGI_MISSING_ARGS), certnickname);
rpt_err(ELEM_MISSING, NULL, scratch, NULL);
16 years, 9 months
[Fedora-directory-commits] adminserver/admserv/newinst/src adminserver.map.in, 1.4, 1.5 register_param.map.in, 1.5, 1.6
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/adminserver/admserv/newinst/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13246/admserv/newinst/src
Modified Files:
adminserver.map.in register_param.map.in
Log Message:
Resolves: 247283
Summary: Fixed multiple problems with CGIs used by Admin Server Console.
Index: adminserver.map.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/adminserver.map.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- adminserver.map.in 25 Jun 2007 18:23:53 -0000 1.4
+++ adminserver.map.in 6 Jul 2007 18:06:19 -0000 1.5
@@ -64,7 +64,7 @@
asid = `use Net::Domain qw(hostname); $returnvalue = hostname();`
as_port = Port
admpw = "@configdir@/admpw"
-as_error = "@logdir@/errors"
+as_error = "@logdir@/error"
as_access = "@logdir@/access"
as_pid = "@pidfile@"
as_console_jar = "%normbrand%-admserv-%as_baseversion%.jar"
Index: register_param.map.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/register_param.map.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- register_param.map.in 28 Jun 2007 16:24:41 -0000 1.5
+++ register_param.map.in 6 Jul 2007 18:06:19 -0000 1.6
@@ -68,7 +68,7 @@
asid = `use Net::Domain qw(hostname); $returnvalue = hostname();`
as_port = Port
admpw = "@configdir@/admpw"
-as_error = "@logdir@/errors"
+as_error = "@logdir@/error"
as_access = "@logdir@/access"
as_pid = "@pidfile@"
as_console_jar = "%normbrand%-admserv-%as_baseversion%.jar"
16 years, 9 months
[Fedora-directory-commits] adminserver/admserv/schema/ldif 10rm_dsdata.ldif.tmpl, NONE, 1.1
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/adminserver/admserv/schema/ldif
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1070
Added Files:
10rm_dsdata.ldif.tmpl
Log Message:
Resolves: #247215
Summary: Reimplement ds_remove without setuputil code (comment #2)
Description: This is a tmpl file to clean up the Configuration entries
belonging to the removed Directory Server instance.
--- NEW FILE 10rm_dsdata.ldif.tmpl ---
# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2007 Red Hat, Inc.
# All rights reserved.
#
# 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; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# END COPYRIGHT BLOCK
dn: o=NetscapeRoot
changetype: modify
delete: aci
aci: (targetattr = "*")(version 3.0; acl "SIE Group"; allow (all) groupdn = "ldap:///cn=slapd-%dsid%, cn=%brand% Directory Server, cn=Server Group, cn=%fqdn%, ou=%domain%, o=NetscapeRoot";)
dn: cn=%brand% Directory Server, cn=Server Group, cn=%fqdn%, ou=%domain%, o=NetscapeRoot
changetype: modify
delete: uniqueMember
uniqueMember: cn=slapd-%dsid%, cn=%brand% Directory Server, cn=Server Group, cn=%fqdn%, ou=%domain%, o=NetscapeRoot
dn: cn=slapd-%dsid%, cn=%brand% Directory Server, cn=Server Group, cn=%fqdn%, ou=%domain%, o=NetscapeRoot
changetype: delete
dn: cn=configuration,cn=slapd-%dsid%, cn=%brand% Directory Server, cn=Server Group, cn=%fqdn%, ou=%domain%, o=NetscapeRoot
changetype: delete
dn: ou="cn=slapd-%dsid%, cn=%brand% Directory Server, cn=Server Group, cn=%fqdn%, ou=%domain%, o=NetscapeRoot",ou=UserPreferences, ou=%domain%, o=NetscapeRoot
changetype: delete
16 years, 9 months
[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts Util.pm.in, 1.5, 1.6
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv794
Modified Files:
Util.pm.in
Log Message:
Resolves: #247215
Summary: Reimplement ds_remove without setuputil code (comment #1)
Description: 1) introduced delete entry operation.
2) cleaned up check_and_add code
Index: Util.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/Util.pm.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Util.pm.in 4 Jul 2007 01:28:17 -0000 1.5
+++ Util.pm.in 6 Jul 2007 17:39:36 -0000 1.6
@@ -233,21 +233,18 @@
}
do
{
- my $needtoadd;
my @addtypes; # list of attr types for mod add
my @reptypes; # list of attr types for mod replace
my @deltypes; # list of attr types for mod delete
- my $MOD_NONE = 0;
- my $MOD_ADD = 1;
- my $MOD_REPLACE = 2;
- my $MOD_SPECIAL = 3;
- # $needtomod stores either of the above $MOD_ values
- # note: delete is not supported
- my $needtomod;
+ my $OP_NONE = 0;
+ my $OP_ADD = 1;
+ my $OP_MOD = 2;
+ my $OP_DEL = 3;
+ # $op stores either of the above $OP_ values
+ my $op = $OP_NONE;
if ( 0 > $#ctypes ) # aentry: complete entry
{
- $needtoadd = 1;
- $needtomod = 0; #$MOD_NONE
+ $op = $OP_ADD;
my $rc = -1;
if ( $sentry && !$fresh )
@@ -258,13 +255,12 @@
{
# the identical entry exists on the configuration DS.
# no need to add the entry.
- $needtoadd = 0;
+ $op = $OP_NONE;
goto out;
}
elsif ( (1 == $rc) && !$fresh )
{
- $needtoadd = 0;
- $needtomod = $MOD_ADD;
+ $op = $OP_MOD;
@addtypes = keys %{$aentry}; # add all attrs
}
elsif ( $sentry && $sentry->{dn} )
@@ -284,21 +280,27 @@
}
else # aentry: modify format
{
- $needtoadd = 0;
if ( $sentry )
{
- @addtypes = $aentry->getValues("add");
- @reptypes = $aentry->getValues("replace");
- @deltypes = $aentry->getValues("delete");
- $needtomod = $MOD_REPLACE;
+ if ( "delete" eq lc($ctypes[0]) )
+ {
+ $op = $OP_DEL;
+ }
+ else
+ {
+ @addtypes = $aentry->getValues("add");
+ @reptypes = $aentry->getValues("replace");
+ @deltypes = $aentry->getValues("delete");
+ $op = $OP_MOD;
+ }
}
else
{
- $needtomod = $MOD_NONE;
+ $op = $OP_NONE;
}
}
- if ( 1 == $needtoadd )
+ if ( $OP_ADD == $op )
{
$conn->add($aentry);
my $rc = $conn->getErrorCode();
@@ -313,20 +315,20 @@
}
debug(1, "Entry $aentry->{dn} is added\n");
}
- elsif ( 0 < $needtomod ) # $sentry exists
+ elsif ( $OP_DEL == $op )
{
- my $attr;
- if ( $needtomod == $MOD_SPECIAL )
+ my $rc = delete_all($conn, $sentry);
+ if ( 0 != $rc )
{
- debug(3, "Doing MOD_SPECIAL for entry $aentry->{dn}\n");
- foreach $attr ( keys %speciallist )
- {
- foreach my $nval ( @{$aentry->{$attr}} )
- {
- $sentry->addValue( $attr, $nval );
- }
- }
+ push @{$errs}, 'error_deleteall_entries', $sentry->{dn}, $conn->getErrorString();
+ debug(1, "Error deleting $sentry->{dn}\n");
+ return 0;
}
+ debug(1, "Entry $aentry->{dn} is deleted\n");
+ }
+ elsif ( 0 < $op ) # $sentry exists
+ {
+ my $attr;
foreach $attr ( @addtypes )
{
debug(3, "Adding attr=$attr values=" . $aentry->getValues($attr) . " to entry $aentry->{dn}\n");
@@ -670,6 +672,8 @@
else
{
# get the value from one of the Inf passed in
+ # they $value could be pure Key or Key:"default_value"
+ my ($key_value, $default_value) = split(/:/, $value, 2);
my $infsection;
foreach my $thisinf (@infdata)
{
@@ -677,17 +681,25 @@
{
$infsection = $thisinf->{$section0};
next if (!ref($infsection));
- if (defined($infsection->{$value}))
+ if (defined($infsection->{$key_value}))
{
- $mapper->{$key} = $infsection->{$value};
+ $mapper->{$key} = $infsection->{$key_value};
next KEY;
}
}
}
if (!defined($infsection->{$value}))
{
- push @{$errs}, 'no_mapvalue_for_key', $value, $key;
- return {};
+ if ($default_value ne "")
+ {
+ $default_value =~ tr/\"//d; # default_value is a regular double quoted string - remove quotes
+ $mapper->{$key} = $default_value;
+ }
+ else
+ {
+ push @{$errs}, 'no_mapvalue_for_key', $value, $key;
+ return {};
+ }
}
}
}
16 years, 9 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/tools/ldclt ldapfct.c, 1.3, 1.4 ldclt.c, 1.4, 1.5 ldclt.h, 1.3, 1.4 ldcltU.c, 1.3, 1.4 threadMain.c, 1.2, 1.3
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17002
Modified Files:
ldapfct.c ldclt.c ldclt.h ldcltU.c threadMain.c
Log Message:
Resolves: #246690
Summary: feature request for ldclt: add randomauthid for testing
Description: Adding randomauthid options: -e "randomauthid" -e "randomauthidlow=<low>" -e "randomauthidhigh=<high>"
Index: ldapfct.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/ldapfct.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ldapfct.c 8 Jun 2007 23:19:19 -0000 1.3
+++ ldapfct.c 5 Jul 2007 23:53:41 -0000 1.4
@@ -807,6 +807,7 @@
(mctx.mode & BIND_EACH_OPER))) {
void *defaults;
LDAPControl **rctrls = NULL;
+ char *my_saslauthid = NULL;
if ( mctx.sasl_mech == NULL) {
fprintf( stderr, "Please specify the SASL mechanism name when "
@@ -825,13 +826,32 @@
}
}
+ /*
+ * Generate the random authid if set up so
+ */
+ if (mctx.mod2 & M2_RANDOM_SASLAUTHID)
+ {
+ rnd (tttctx->buf2, mctx.sasl_authid_low, mctx.sasl_authid_high,
+ mctx.sasl_authid_nbdigit);
+ strncpy (&(tttctx->bufSaslAuthid[tttctx->startSaslAuthid]),
+ tttctx->buf2, mctx.sasl_authid_nbdigit);
+ my_saslauthid = tttctx->bufSaslAuthid;
+ if (mctx.mode & VERY_VERBOSE)
+ printf ("ldclt[%d]: T%03d: Sasl Authid=\"%s\"\n",
+ mctx.pid, tttctx->thrdNum, tttctx->bufSaslAuthid);
+ }
+ else
+ {
+ my_saslauthid = mctx.sasl_authid;
+ }
+
defaults = ldaptool_set_sasl_defaults( tttctx->ldapCtx, mctx.sasl_flags, mctx.sasl_mech,
- mctx.sasl_authid, mctx.sasl_username, mctx.passwd, mctx.sasl_realm );
+ my_saslauthid, mctx.sasl_username, mctx.passwd, mctx.sasl_realm );
if (defaults == NULL) {
perror ("malloc");
exit (LDAP_NO_MEMORY);
}
-
+
ret = ldap_sasl_interactive_bind_ext_s( tttctx->ldapCtx, mctx.bindDN, mctx.sasl_mech,
NULL, NULL, mctx.sasl_flags,
ldaptool_sasl_interact, defaults, NULL );
Index: ldclt.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/ldclt.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ldclt.c 8 Jun 2007 23:19:20 -0000 1.4
+++ ldclt.c 5 Jul 2007 23:53:41 -0000 1.5
@@ -1496,7 +1496,7 @@
} /*JLS 19-03-01*/
/*
- * Maybe random filter to prepear ?
+ * Maybe random filter to prepare ?
*/
if ((mctx.mode & (RANDOM | INCREMENTAL)) &&
(!(mctx.mod2 & M2_RDN_VALUE))) /*JLS 23-03-01*/
@@ -1510,7 +1510,7 @@
}
/*
- * Maybe random base DN to prepear ?
+ * Maybe random base DN to prepare ?
*/
if (mctx.mode & RANDOM_BASE)
{
@@ -1523,7 +1523,7 @@
}
/*
- * Maybe random bind DN to prepear ?
+ * Maybe random bind DN to prepare ?
*/
if (mctx.mode & RANDOM_BINDDN) /*JLS 05-01-01*/
{ /*JLS 05-01-01*/
@@ -1542,7 +1542,20 @@
} /*JLS 05-01-01*/
/*
- * Maybe an attribute replacement to prepear ?
+ * Maybe random authid to prepare ?
+ */
+ if (mctx.mod2 & M2_RANDOM_SASLAUTHID)
+ {
+ if (parseFilter (mctx.sasl_authid, &(mctx.sasl_authid_head),
+ &(mctx.sasl_authid_tail), &(mctx.sasl_authid_nbdigit)) < 0)
+ {
+ printf ("Error: cannot parse bind DN...\n");
+ return (-1);
+ }
+ }
+
+ /*
+ * Maybe an attribute replacement to prepare ?
*/
if (mctx.mode & ATTR_REPLACE) /*JLS 21-11-00*/
{ /*JLS 21-11-00*/
@@ -1753,6 +1766,8 @@
printf (" ssl_with_client_authentication"); /* BK 23-11-00*/
if (mctx.mod2 & M2_SASLAUTH)
printf (" saslauth");
+ if (mctx.mod2 & M2_RANDOM_SASLAUTHID)
+ printf (" randomauthid");
if (mctx.mode & SMOOTHSHUTDOWN) /*JLS 17-11-00*/
printf (" smoothshutdown"); /*JLS 17-11-00*/
if (mctx.mode & DONT_SLEEP_DOWN) /*JLS 14-03-01*/
@@ -2206,6 +2221,12 @@
"randombinddnfromfile", /*JLS 03-05-01*/
#define EP_BINDONLY 45 /*JLS 04-05-01*/
"bindonly", /*JLS 04-05-01*/
+#define EP_RANDOMSASLAUTHID 46
+ "randomauthid",
+#define EP_RANDOMSASLAUTHIDHIGH 47
+ "randomauthidhigh",
+#define EP_RANDOMSASLAUTHIDLOW 48
+ "randomauthidlow",
NULL
};
@@ -2416,6 +2437,27 @@
} /*JLS 12-01-01*/
mctx.bindDNLow = atoi (subvalue); /*JLS 05-01-01*/
break; /*JLS 05-01-01*/
+ case EP_RANDOMSASLAUTHID:
+ mctx.mod2 |= M2_RANDOM_SASLAUTHID;
+ break;
+ case EP_RANDOMSASLAUTHIDHIGH:
+ mctx.mod2 |= M2_RANDOM_SASLAUTHID;
+ if (subvalue == NULL)
+ {
+ fprintf(stderr,"Error: missing arg randomauthidhigh\n");
+ return (-1);
+ }
+ mctx.sasl_authid_high = atoi (subvalue);
+ break;
+ case EP_RANDOMSASLAUTHIDLOW:
+ mctx.mod2 |= M2_RANDOM_SASLAUTHID;
+ if (subvalue == NULL)
+ {
+ fprintf(stderr, "Error: missing arg randomauthidlow\n");
+ return (-1);
+ }
+ mctx.sasl_authid_low = atoi (subvalue);
+ break;
case EP_RDN: /*JLS 23-03-01*/
if (decodeRdnParam (subvalue) < 0) /*JLS 23-03-01*/
return (-1); /*JLS 23-03-01*/
@@ -2931,6 +2973,14 @@
fprintf(stderr,"Error: use option -e randombinddnhigh=\n"); /*JLS 05-01-01*/
ldcltExit (EXIT_PARAMS); /*JLS 05-01-01*/
} /*JLS 05-01-01*/
+ if ((mctx.mod2 & M2_RANDOM_SASLAUTHID) &&
+ ((mctx.sasl_authid_low < 0) || (mctx.sasl_authid_high < 0)))
+ {
+ fprintf(stderr,"Error: missing ranges for randomauthid.\n");
+ fprintf(stderr,"Error: use option -e randomauthidlow=\n");
+ fprintf(stderr,"Error: use option -e randomauthidhigh=\n");
+ ldcltExit (EXIT_PARAMS); /*JLS 05-01-01*/
+ } /*JLS 05-01-01*/
if (mctx.mode & CLTAUTH) /* BK 23-11-00*/
{ /* BK 23-11-00*/
if (!(mctx.mode & SSL)) /* BK 23-11-00*/
@@ -3136,6 +3186,13 @@
printf ("Bind passwd's head = \"%s\"\n", mctx.passwdHead);/*JLS 05-01-01*/
printf ("Bind passwd's tail = \"%s\"\n", mctx.passwdTail);/*JLS 05-01-01*/
} /*JLS 05-01-01*/
+ if (mctx.mod2 & M2_RANDOM_SASLAUTHID)
+ { /*JLS 05-01-01*/
+ printf ("Bind Authid's head = \"%s\"\n", mctx.sasl_authid_head);
+ printf ("Bind Authid's tail = \"%s\"\n", mctx.sasl_authid_tail);
+ printf ("Bind Authid's range = [%d , %d]\n",
+ mctx.sasl_authid_low, mctx.sasl_authid_high);
+ } /*JLS 05-01-01*/
if (mctx.mode & ATTR_REPLACE) /*JLS 21-11-00*/
{ /*JLS 21-11-00*/
printf ("Attribute's head = \"%s\"\n", mctx.attrplHead);/*JLS 21-11-00*/
Index: ldclt.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/ldclt.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ldclt.h 8 Jun 2007 23:19:20 -0000 1.3
+++ ldclt.h 5 Jul 2007 23:53:41 -0000 1.4
@@ -283,6 +283,7 @@
#define M2_RNDBINDFILE 0x00000010 /* -e randombinddnfromfile *//*JLS 03-05-01*/
#define M2_BINDONLY 0x00000020 /* -e bindonly */ /*JLS 04-05-01*/
#define M2_SASLAUTH 0x00000040 /* -o : SASL authentication */
+#define M2_RANDOM_SASLAUTHID 0x00000080 /* -e randomauthid */
/*
* Combinatory defines
@@ -563,6 +564,11 @@
int referral; /* Referral followed */ /*JLS 08-03-01*/
int sampling; /* Sampling frequency */
char *sasl_authid;
+ int sasl_authid_low; /* authid's low val */
+ int sasl_authid_high; /* authid's high val */
+ int sasl_authid_nbdigit; /* authid's ndigits */
+ char *sasl_authid_head; /* authid's head */
+ char *sasl_authid_tail; /* authid's tail */
unsigned sasl_flags;
char *sasl_mech;
char *sasl_realm;
@@ -636,6 +642,7 @@
char *bufBindDN; /* Bind DN to use */ /*JLS 05-01-01*/
char *bufFilter; /* Filter to use */
char *bufPasswd; /* Bind passwd to use *//*JLS 05-01-01*/
+ char *bufSaslAuthid; /* Sasl Authid to use */
/*
* Note about matcheddnp management. This pointer is managed by the
* function dnFromMessage() that need it to free or remember the string
@@ -647,6 +654,7 @@
int startBindDN; /* Insert random here *//*JLS 05-01-01*/
int startPasswd; /* Insert random here *//*JLS 05-01-01*/
int startRandom; /* Insert random here */
+ int startSaslAuthid; /* Insert random here */
msgid_cell *firstMsgId; /* pending messages */
msgid_cell *lastMsgId; /* last one */
} thread_context;
Index: ldcltU.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/ldcltU.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ldcltU.c 8 Jun 2007 23:19:20 -0000 1.3
+++ ldcltU.c 5 Jul 2007 23:53:41 -0000 1.4
@@ -201,6 +201,9 @@
(void) printf (" string : create random strings rather than random numbers.\n");
(void) printf (" v2 : ldap v2.\n");
(void) printf (" withnewparent : rename with newparent specified as argument.\n");
+ (void) printf (" randomauthid : random SASL Authid.\n");
+ (void) printf (" randomauthidlow=value : low value for random SASL Authid.\n");
+ (void) printf (" randomauthidhigh=value : high value for random SASL Authid.\n");
(void) printf (" -f Filter for searches.\n");
(void) printf (" -h Host to connect. Default \"localhost\".\n");
(void) printf (" -i Number of times inactivity allowed. Default 3 (30 seconds)\n");
Index: threadMain.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/threadMain.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- threadMain.c 10 Nov 2006 23:45:50 -0000 1.2
+++ threadMain.c 5 Jul 2007 23:53:41 -0000 1.3
@@ -1073,6 +1073,29 @@
mctx.passwd = "foo bar"; /* trick... */ /*JLS 03-05-01*/
} /*JLS 03-05-01*/
+ /*
+ * Variable Authid ?
+ */
+ if (mctx.sasl_authid != NULL)
+ {
+ tttctx->bufSaslAuthid = (char *) malloc (strlen (mctx.sasl_authid) + 1);
+ if (tttctx->bufSaslAuthid == NULL)
+ {
+ printf ("ldclt[%d]: T%03d: cannot malloc(tttctx->bufSaslAuthid), error=%d (%s)\n",
+ mctx.pid, tttctx->thrdNum, errno, strerror (errno));
+ ldcltExit (EXIT_INIT);
+ }
+ if (!(mctx.mod2 & M2_RANDOM_SASLAUTHID))
+ strcpy (tttctx->bufSaslAuthid, mctx.sasl_authid);
+ else
+ {
+ tttctx->startSaslAuthid = strlen (mctx.sasl_authid_head);
+ strcpy (tttctx->bufSaslAuthid, mctx.sasl_authid_head);
+ strcpy (&(tttctx->bufSaslAuthid[tttctx->startSaslAuthid+mctx.sasl_authid_nbdigit]),
+ mctx.sasl_authid_tail);
+ }
+ }
+
/*
* Initiates the attribute replace buffers
*/
16 years, 9 months
[Fedora-directory-commits] adminutil/lib/libadminutil admutil.c, 1.8, 1.9 distadm.c, 1.3, 1.4
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/adminutil/lib/libadminutil
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12226/lib/libadminutil
Modified Files:
admutil.c distadm.c
Log Message:
Resolves: 247192
Summary: Modified the admldapBuildInfoCbk() function to pass the userdn through for authentication to the Directory if the userdn is initialized.
Index: admutil.c
===================================================================
RCS file: /cvs/dirsec/adminutil/lib/libadminutil/admutil.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- admutil.c 8 May 2007 19:13:25 -0000 1.8
+++ admutil.c 5 Jul 2007 21:12:55 -0000 1.9
@@ -1276,6 +1276,8 @@
admldapBuildInfoCbk(char* configRoot, char *(*cbk)(), int *errorcode)
{
char *siePasswd = NULL;
+ char *siedn = NULL;
+ char *userdn = NULL;
AdmldapHdnlPtr admInfo = NULL;
int ldapError = LDAP_SUCCESS;
int secureLDAP = 0;
@@ -1294,6 +1296,14 @@
secureLDAP = 1;
}
+ /* if userdn is initialized, override the siedn to make bind succeed */
+ ADM_GetUserDNString(errorcode, &userdn);
+ if (strcasecmp(userdn, ADM_NOT_INITIALIZED)) {
+ siedn = admldapGetSIEDN(admInfo);
+ admldapSetSIEDN(admInfo, userdn);
+ admSetCachedSIEPWD(siePasswd);
+ }
+
if (!secureLDAP) {
admInfo->ldapHndl = ldap_init(admInfo->ldapInfo->lud_host, admInfo->ldapInfo->lud_port);
}
@@ -1377,6 +1387,12 @@
admInfo->passwd=PL_strdup(siePasswd);
}
+ /* Reset the siedn if we changed it*/
+ if (siedn) {
+ admldapSetSIEDN(admInfo, siedn);
+ PL_strfree(siedn);
+ }
+
return (AdmldapInfo)admInfo;
}
Index: distadm.c
===================================================================
RCS file: /cvs/dirsec/adminutil/lib/libadminutil/distadm.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- distadm.c 4 Apr 2007 19:37:36 -0000 1.3
+++ distadm.c 5 Jul 2007 21:12:55 -0000 1.4
@@ -103,9 +103,6 @@
#endif
*/
-/* Yeah, I know, globals suck. */
-#define ADM_NOT_INITIALIZED "NS-not-initialized"
-
#ifndef BIG_LINE
#define BIG_LINE 1024
#endif
16 years, 9 months
[Fedora-directory-commits] adminutil/include/libadminutil distadm.h, 1.4, 1.5
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/adminutil/include/libadminutil
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12226/include/libadminutil
Modified Files:
distadm.h
Log Message:
Resolves: 247192
Summary: Modified the admldapBuildInfoCbk() function to pass the userdn through for authentication to the Directory if the userdn is initialized.
Index: distadm.h
===================================================================
RCS file: /cvs/dirsec/adminutil/include/libadminutil/distadm.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- distadm.h 4 Apr 2007 19:37:41 -0000 1.4
+++ distadm.h 5 Jul 2007 21:12:54 -0000 1.5
@@ -52,6 +52,9 @@
#ifndef ADM_SIEPWD_STRING
#define ADM_SIEPWD_STRING "SIEPWD: "
#endif
+#ifndef ADM_NOT_INITIALIZED
+#define ADM_NOT_INITIALIZED "NS-not-initialized"
+#endif
/* Initialize libadminutil. Should be called by EVERY CGI. */
/* util.c */
16 years, 9 months