mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-02 04:59:39 -05:00
Move old files to the Attic
This commit is contained in:
parent
07c7d3c3cb
commit
e2fa599482
39 changed files with 677 additions and 5208 deletions
|
|
@ -1,74 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ldapdelete"=.\ldapdelete.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ldapmodify"=.\ldapmodify.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldif
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldif"=..\..\libraries\libldif\libldif.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "setup"=..\..\include\setup.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ldapmodrdn"=.\ldapmodrdn.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ldappasswd"=.\ldappasswd.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ldapsearch"=.\ldapsearch.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldif
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldif"=..\..\libraries\libldif\libldif.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "setup"=..\..\include\setup.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldif"=..\..\libraries\libldif\libldif.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ud"=.\ud.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldif
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
.TH CENTIPEDE 8C "22 September 1998" "OpenLDAP LDVERSION"
|
||||
.\" $OpenLDAP$
|
||||
.\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved.
|
||||
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
|
||||
.SH NAME
|
||||
centipede \- LDAP centroid index generation and maintenance program
|
||||
.SH SYNOPSIS
|
||||
.B SBINDIR/centipede
|
||||
.B [\-f filter]
|
||||
.B [\-F] [\-R]
|
||||
.B [\-f filter] [\-t directory]
|
||||
.B [\-m authmethod] [\-b binddn]
|
||||
.B [\-p passwd] [\-c cachesize]
|
||||
.B \-s sourceurl \-d desturl attributes
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
The centipede program is used to extract centroid or other index
|
||||
information from one LDAP server and install it in another. Although
|
||||
index information can be extracted from any LDAP server, only a
|
||||
.BR slapd (8)
|
||||
LDAP server will understand the information and thus be capable of
|
||||
making use of it as indexing information (i.e., you should only
|
||||
install index information in a
|
||||
.BR slapd (8)
|
||||
LDAP server).
|
||||
.LP
|
||||
The basic form of the command is as follows
|
||||
.LP
|
||||
.nf
|
||||
.ft tt
|
||||
SBINDIR/centipede [options]
|
||||
-s "ldap://[host/]subtree-to-index-dn"
|
||||
-d "ldap://[host/]parent-of-index-entry-dn"
|
||||
attributes
|
||||
.ft
|
||||
.fi
|
||||
.LP
|
||||
where the
|
||||
.B \-s
|
||||
option specifies the subtree for which index information is to
|
||||
be generated, and the
|
||||
.B \-d
|
||||
option specifies the parent under which the index information is to
|
||||
be installed.
|
||||
.LP
|
||||
For example, suppose you are running an
|
||||
LDAP server on the host
|
||||
.I babs.com
|
||||
for an organization called "BabsCo" based in the US, and you want to
|
||||
generate index information for the cn, sn and objectclass attributes of
|
||||
all the people entries in your subtree. You want to install the index
|
||||
informatioin in the indexing
|
||||
.BR slapd (8)
|
||||
running on the host
|
||||
.I vertigo.rs.itd.umich.edu
|
||||
under the c=US entry.
|
||||
This way, when an LDAP client connects to the
|
||||
.BR slapd (8)
|
||||
on vertigo and does a subtree search of c=US,
|
||||
.BR slapd (8)
|
||||
can consult the index information to tell whether it should refer the
|
||||
client to your server or not. You could accomplish this with a command
|
||||
like this:
|
||||
.LP
|
||||
.nf
|
||||
.ft tt
|
||||
SBINDIR/centipede -f '(objectclass=person)'
|
||||
-m simple -b your-rootdn -p your-rootdnpw
|
||||
-s "ldap://babs.com/o=BabsCo, c=US"
|
||||
-d "ldap://vertigo.rs.itd.umich.edu/c=US"
|
||||
cn sn objectclass
|
||||
.ft
|
||||
.fi
|
||||
.LP
|
||||
Note the
|
||||
.B \-b
|
||||
and
|
||||
.B \-p
|
||||
options can be used to authenticate as an entity able to read all
|
||||
the information you want.
|
||||
.LP
|
||||
See "The SLAPD and SLURPD Administrator's Guide" for more details on
|
||||
using this program.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-v
|
||||
Turn on verbose mode. This option can be given multiple times to increase
|
||||
the level of verbosity.
|
||||
.TP
|
||||
.B \-n
|
||||
Do not actually install index information. Useful in conjunction with
|
||||
.B -v
|
||||
for seeing what
|
||||
.B centipede
|
||||
is up to.
|
||||
.TP
|
||||
.BI \-f " ldapfilter"
|
||||
Specify a filter used to select the entries for which to generate indexing
|
||||
information.
|
||||
.I ldapfilter
|
||||
should be a string LDAP filter as described by RFC 1588.
|
||||
.TP
|
||||
.BI \-F
|
||||
Generate full, as opposed to relative, index information.
|
||||
.TP
|
||||
.BI \-R
|
||||
Generate relative, as opposed to full, index information. Full information
|
||||
is still generated if there is no previous information available from
|
||||
which to generate the relative information. This is the default.
|
||||
.TP
|
||||
.BI \-t " directory"
|
||||
Specify the directory in which to create temporary files, find existing
|
||||
index information, and put new index information. The default is
|
||||
whatever is used by tempnam.
|
||||
.TP
|
||||
.BI \-b " binddn"
|
||||
Specify the DN to authenticate with when extracting index information.
|
||||
.TP
|
||||
.BI \-p " passwd"
|
||||
Specify the password to use for simple authentication when extracting
|
||||
index information.
|
||||
.TP
|
||||
.BI \-m " authmethod"
|
||||
Specify the authentication method to use when extracting index information.
|
||||
.I authmethod
|
||||
should be either "simple" or "kerberos".
|
||||
.TP
|
||||
.BI \-B " binddn"
|
||||
Specify the DN to authenticate with when installing index information.
|
||||
.TP
|
||||
.BI \-P " passwd"
|
||||
Specify the password to use for simple authentication when installing
|
||||
index information.
|
||||
.TP
|
||||
.BI \-M " authmethod"
|
||||
Specify the authentication method to use when installing index information.
|
||||
.I authmethod
|
||||
should be either "simple" or "kerberos".
|
||||
.TP
|
||||
.BI \-c " cachesize"
|
||||
Specify the size in bytes of the cache used when building the new
|
||||
index information. Upping this number can cause a big performance boost,
|
||||
if you've got the memory for it.
|
||||
.SH NOTES
|
||||
This is all very experimental at the moment, and is subject to change.
|
||||
.LP
|
||||
Currently,
|
||||
.B centipede
|
||||
only handles value-based index information. A future version of centipede
|
||||
will allow other types of index information to be manipulated (e.g.,
|
||||
word-based indexes, substring indexes, phonetic indexes, hash indexes,
|
||||
etc.). A future version may also allow weights to be generated.
|
||||
.SH "SEE ALSO"
|
||||
.BR ldap (3),
|
||||
.BR slapd (8)
|
||||
.LP
|
||||
"The SLAPD and SLURPD Administrator's Guide"
|
||||
.SH ACKNOWLEDGEMENTS
|
||||
.B OpenLDAP
|
||||
is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
|
||||
.B OpenLDAP
|
||||
is derived from University of Michigan LDAP 3.3 Release.
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
.TH CHLOG2REPLOG 8C "22 September 1998" "OpenLDAP LDVERSION"
|
||||
.\" $OpenLDAP$
|
||||
.\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved.
|
||||
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
|
||||
.SH NAME
|
||||
chlog2replog \- convert an X.500 DSA-style changelog to an LDAP-style
|
||||
replication log
|
||||
.SH SYNOPSIS
|
||||
.B SBINDIR/chlog2replog
|
||||
.B \-r hostname:port [\-r hostname:port ...]
|
||||
.B \-d dn\-suffix [\-o output\-file] < input\-file
|
||||
.LP
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
chlog2replog is used to convert an X.500\-style changelog to an
|
||||
LDAP\-style replication log. It reads its standard input and
|
||||
writes standard output if no \-o flag is given. If the \-o flag
|
||||
is given,
|
||||
.B chlog2replog
|
||||
writes its output to the given file, following
|
||||
the same advisory locking mechanisms respected by the
|
||||
.B slurpd
|
||||
program. This makes it possible to use chlog2replog in a pipeline
|
||||
to produce input for
|
||||
.B slurpd.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BI \-r " hostname:port"
|
||||
This option specifies the hostname and port number to which updates
|
||||
should be propagated.
|
||||
.B chlog2replog
|
||||
will include one "replica: hostname:port" directive in each replication
|
||||
log entry it writes out for each
|
||||
.B \-r
|
||||
option given. You may supply as many replica hostname:port options as
|
||||
you wish.
|
||||
.TP
|
||||
.BI \-d " dn\-suffix"
|
||||
This option specifies an additional string to append to converted
|
||||
DNs (Distinguished Names) converted from the changelog file. The
|
||||
DNs in the changelog file will typically be partial DNs which omit
|
||||
the portion of the directory tree "above" the organizational root.
|
||||
For example, if your directory tree is rooted at o=University of
|
||||
Michigan, c=US, you will need to include the argument
|
||||
"\-d ", o=University of Michigan, c=US".
|
||||
.TP
|
||||
.BI \-o " output\-file"
|
||||
If given, this option specifies an output file to which converted
|
||||
replication log entries will be written.
|
||||
.B chlog2replog
|
||||
obeys the same file locking conventions used by
|
||||
.B slurpd,
|
||||
so that it is possible to use
|
||||
.B chlog2replog
|
||||
to "feed" changes from an X.500 DSA to
|
||||
.B slurpd. See the
|
||||
.B examples
|
||||
section, below, for more information.
|
||||
.SH EXAMPLES
|
||||
To read the DSA-style changelog file
|
||||
.BR changlelog
|
||||
and write on the standard output an LDAP-style replication log,
|
||||
appending ", o=University of Michigan, c=US" to all entry
|
||||
DNs, and including a replica: entry for host "ldapserver," port
|
||||
389, give the command:
|
||||
.LP
|
||||
.nf
|
||||
.ft tt
|
||||
SBINDIR/chlog2replog -d ", o=University of Michigan, c=US"
|
||||
-r ldapserver:389 < changelog
|
||||
.ft
|
||||
.fi
|
||||
.LP
|
||||
To do the same, but routing the output to the file "replog," using
|
||||
slurpd\-compatible file\-locking,
|
||||
give this command:
|
||||
.LP
|
||||
.nf
|
||||
.ft tt
|
||||
SBINDIR/chlog2replog -d ", o=University of Michigan, c=US"
|
||||
-r ldapserver:389 -o replog < changelog
|
||||
.ft
|
||||
.fi
|
||||
.LP
|
||||
To continually read new changes from the file "changelog" and write
|
||||
them to the file "replog",
|
||||
give this command:
|
||||
.LP
|
||||
.nf
|
||||
.ft tt
|
||||
tail +0f changelog | SBINDIR/chlog2replog
|
||||
-d ", o=University of Michigan, c=US"
|
||||
-r ldapserver:389 -o replog < changelog
|
||||
.ft
|
||||
.fi
|
||||
|
||||
.LP
|
||||
.SH "SEE ALSO"
|
||||
.BR ldap (3),
|
||||
.BR ldif (5),
|
||||
.BR slurpd (8),
|
||||
.BR slapd (8),
|
||||
.LP
|
||||
"The SLAPD and SLURPD Administrator's Guide"
|
||||
.SH ACKNOWLEDGEMENTS
|
||||
.B OpenLDAP
|
||||
is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
|
||||
.B OpenLDAP
|
||||
is derived from University of Michigan LDAP 3.3 Release.
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
.TH EDB2LDIF 8C "22 September 1998" "OpenLDAP LDVERSION"
|
||||
.\" $OpenLDAP$
|
||||
.\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved.
|
||||
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
|
||||
.SH NAME
|
||||
edb2ldif \- QUIPU EDB file to LDIF conversion tool
|
||||
.SH SYNOPSIS
|
||||
.B SBINDIR/edb2ldif
|
||||
.B [\-d] [\-v] [\-r] [\-o] [\-b basedn]
|
||||
.B [\-a addvalsfile] [\-f fileattrdir]
|
||||
.B [\-i ignoreattr...] [edbfile...]
|
||||
.B
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
Data that is held in a QUIPU DSA (available as part of the ISODE package)
|
||||
is stored in or can be easily converted to the EDB file format. The
|
||||
.I edb2ldif
|
||||
tool is used to convert directory data from EDB file format to the
|
||||
LDAP Directory Interchange Format (LDIF) used by
|
||||
.BR slapd (8)
|
||||
and associated utilities. The
|
||||
.BR slapadd (8)
|
||||
program can be used to convert the resulting LDIF data into a database
|
||||
that is compatible with
|
||||
.BR slapd (8).
|
||||
.LP
|
||||
.I edb2ldif
|
||||
writes LDIF formatted data to standard output. If you specify a particular
|
||||
.I edbfile
|
||||
(or files) to read data from, they are converted. If no
|
||||
.I edbfile
|
||||
is specified, the files named
|
||||
.BR EDB.root
|
||||
(if it exists) and
|
||||
.BR EDB
|
||||
in the current directory are converted. An entire EDB hierarchy
|
||||
can be converted using the
|
||||
.B \-r
|
||||
option.
|
||||
.LP
|
||||
When
|
||||
.I edb2ldif
|
||||
is invoked, it will also look for files named
|
||||
.BR .add
|
||||
in the directories
|
||||
where EDB files are found and append the contents of the
|
||||
.BR .add
|
||||
file to each entry in the corresponding EDB file.
|
||||
Typically, this feature is used to include inherited
|
||||
attribute values (e.g., objectClass) that do not appear in the EDB files.
|
||||
.LP
|
||||
See "The SLAPD and SLURPD Administrator's Guide" for more details on
|
||||
using
|
||||
.I edb2ldif,
|
||||
including step-by-step conversion instructions.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-d
|
||||
Turn on some extra debugging which is written to standard error.
|
||||
.TP
|
||||
.B \-v
|
||||
Enable verbose mode that writes status information to standard error, such
|
||||
as which EDB file is being processed, how many entries have been
|
||||
converted so far, etc.
|
||||
.TP
|
||||
.B \-r
|
||||
Recurse through child directories, processing all EDB files found.
|
||||
.TP
|
||||
.B \-o
|
||||
Cause local
|
||||
.B .add
|
||||
file definitions to override the global addfile (see the
|
||||
.B \-a
|
||||
option below)
|
||||
.TP
|
||||
.BI \-b " basedn"
|
||||
Specify the Distinguished Name that all EDB file entries appear below.
|
||||
.TP
|
||||
.B \-a " addvalsfile"
|
||||
The LDIF information contained in this file will be appended to each entry.
|
||||
(See the
|
||||
.B \-o
|
||||
option above.)
|
||||
.TP
|
||||
.BI \-f " fileattrdir"
|
||||
Specify a single directory where all file-based attributes (typically sounds
|
||||
and images) can be found. If this option is not given, file attributes are
|
||||
assumed to be located in the same directory as the EDB file that refers to
|
||||
them.
|
||||
.TP
|
||||
.BI \-i " ignoreattr"
|
||||
Specify an attribute that should not be converted. You can include as many
|
||||
\- i flags as necessary.
|
||||
.SH "SEE ALSO"
|
||||
.BR ldap (3),
|
||||
.BR ldif (5),
|
||||
.BR slapd (8),
|
||||
.BR slapadd (8)
|
||||
.LP
|
||||
"The SLAPD and SLURPD Administrator's Guide"
|
||||
.LP
|
||||
Volume 5 of The ISODE Manual
|
||||
.SH ACKNOWLEDGEMENTS
|
||||
.B OpenLDAP
|
||||
is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
|
||||
.B OpenLDAP
|
||||
is derived from University of Michigan LDAP 3.3 Release.
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
.TH LDIF 8C "22 September 1998" "OpenLDAP LDVERSION"
|
||||
.\" $OpenLDAP$
|
||||
.\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved.
|
||||
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
|
||||
.SH NAME
|
||||
ldif \- convert arbitrary data to LDIF format
|
||||
.SH SYNOPSIS
|
||||
.B SBINDIR/ldif [\-b] attr\-name
|
||||
.LP
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
This program is used to convert arbitrary data to the
|
||||
LDAP Directory Interchange Format (LDIF) described in
|
||||
.BR ldif (5).
|
||||
.B ldif
|
||||
reads data from standard input, converts it,
|
||||
and writes the corresponding LDIF output to standard output.
|
||||
The output is suitable for use as a line in an
|
||||
.BR ldif (5)
|
||||
file.
|
||||
.LP
|
||||
Without the
|
||||
.B \-b
|
||||
flag,
|
||||
.B ldif
|
||||
considers its input a sequence of values to be
|
||||
converted, one per line. With the
|
||||
.B \-b
|
||||
flag,
|
||||
.B ldif
|
||||
considers its input as a single raw binary value to be
|
||||
converted. This can be useful when converting binary data
|
||||
such as a photo or audio attribute.
|
||||
.LP
|
||||
See "The SLAPD and SLURPD Administrator's Guide" for more details on
|
||||
using this program.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-b
|
||||
This option specifies that
|
||||
.B ldif
|
||||
should interpret its input as a single binary value for conversion.
|
||||
Otherwise, it interprets it as a sequence of lines, with each line
|
||||
containing a single value.
|
||||
.SH "SEE ALSO"
|
||||
.BR ldap (3),
|
||||
.BR ldif (5),
|
||||
.BR slapadd (8),
|
||||
.BR slapd (8)
|
||||
.LP
|
||||
"The SLAPD and SLURPD Administrator's Guide"
|
||||
.SH ACKNOWLEDGEMENTS
|
||||
.B OpenLDAP
|
||||
is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
|
||||
.B OpenLDAP
|
||||
is derived from University of Michigan LDAP 3.3 Release.
|
||||
|
|
@ -453,9 +453,6 @@
|
|||
/* Define if you have the <pwd.h> header file. */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
/* Define if you have the <quipu/commonarg.h> header file. */
|
||||
#undef HAVE_QUIPU_COMMONARG_H
|
||||
|
||||
/* Define if you have the <readline/history.h> header file. */
|
||||
#undef HAVE_READLINE_HISTORY_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libavl"=.\libavl.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libavl"=.\libavl.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "testavl"=.\testavl.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libavl
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "dtest"=.\dtest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=.\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "etest"=.\etest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=.\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "idtest"=.\idtest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=.\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=.\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "apitest"=.\apitest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=.\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=.\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=.\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=..\liblutil\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ltest"=.\ltest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "apitest_r"=.\apitest_r.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap_r
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap_r"=.\libldap_r.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap_r"=.\libldap_r.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=.\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=..\liblutil\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ltest"=.\ltest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap"=.\libldap.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=..\liblutil\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ltest"=.\ltest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldif"=.\libldif.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=.\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "passwd"=.\passwd.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=.\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "backldbm"=".\back-ldbm\backldbm.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libavl"=..\..\libraries\libavl\libavl.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap_r"=..\..\libraries\libldap_r\libldap_r.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldbm"=..\..\libraries\libldbm\libldbm.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldif"=..\..\libraries\libldif\libldif.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libslapd"=.\libslapd.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "setup"=..\..\include\setup.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "slapd"=.\slapd.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libavl
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldbm
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldif
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap_r
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name backldbm
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libslapd
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name setup
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -29,21 +29,16 @@ XLIBS = -lavl -lldif -lldbm -llutil -lldap_r -llber
|
|||
XXLIBS = $(SLAPD_LIBS) \
|
||||
$(LDBM_LIBS) $(SECURITY_LIBS) \
|
||||
$(LDIF_LIBS) $(LUTIL_LIBS)
|
||||
XXXLIBS = $(LTHREAD_LIBS) $(MODULES_LIBS)
|
||||
XXXLIBS = $(MODULES_LIBS) $(LTHREAD_LIBS)
|
||||
|
||||
PROGRAMS=ldif slappasswd slapadd slapcat slapindex
|
||||
LDBMPROGRAMS=centipede sizecount
|
||||
PROGRAMS=slapadd slapcat slapindex slappasswd
|
||||
|
||||
# CPPFLAGS will include the defines for dynamic libs in Mingw32.
|
||||
NT_DYN_DEFS = -DLBER_DECL=dllimport -DLDAP_DECL=dllimport
|
||||
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_DEFS)
|
||||
|
||||
SRCS = ldif.c mimic.c slapcommon.c slapadd.c slapcat.c slapindex.c
|
||||
|
||||
XSRCS = edb2-vers.c
|
||||
|
||||
# LDBMSRCS = centipede.c sizecount.c
|
||||
LDBMSRCS =
|
||||
SRCS = mimic.c slapcommon.c \
|
||||
slapadd.c slapcat.c slapindex.c slappasswd.c
|
||||
|
||||
SLAPD_OBJS = ../config.o ../ch_malloc.o ../backend.o ../charray.o \
|
||||
../module.o ../aclparse.o ../filterentry.o \
|
||||
|
|
@ -56,21 +51,10 @@ SLAPD_OBJS = ../config.o ../ch_malloc.o ../backend.o ../charray.o \
|
|||
|
||||
SLAPOBJS = $(SLAPD_OBJS) slapcommon.o mimic.o
|
||||
|
||||
EDB2LDIFSRCS = edb2ldif.c ldapsyntax.c
|
||||
EDB2LDIFOBJS = edb2ldif.o ldapsyntax.o
|
||||
|
||||
UNIX_PRGS = build-ldbm
|
||||
|
||||
all-local: build-progs $(@PLAT@_PRGS)
|
||||
all-local: build-progs
|
||||
|
||||
build-progs: $(PROGRAMS)
|
||||
|
||||
build-ldbm: ldbm-tools-$(BUILD_LDBM)
|
||||
ldbm-tools-no:
|
||||
@echo "run configure with --enable-ldbm to build LDBM tools"
|
||||
|
||||
ldbm-tools-yes ldbm-tools-mod: $(LDBMPROGRAMS)
|
||||
|
||||
#
|
||||
# SLAP Tools
|
||||
#
|
||||
|
|
@ -83,39 +67,11 @@ slapcat: slapcat.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND)
|
|||
slapindex: slapindex.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND)
|
||||
$(LTLINK) -o $@ slapindex.o $(SLAPOBJS) ../libbackends.a $(LIBS)
|
||||
|
||||
ldif: ldif.o $(SLAPD_LIBDEPEND)
|
||||
$(LTLINK) -o $@ ldif.o $(LIBS)
|
||||
|
||||
slappasswd: slappasswd.o $(SLAPD_LIBDEPEND)
|
||||
$(LTLINK) -o $@ slappasswd.o $(LIBS)
|
||||
|
||||
#
|
||||
# LDBM Specific Tools
|
||||
# (deprecated)
|
||||
centipede: centipede.o $(SLAPD_LIBDEPEND)
|
||||
$(LTLINK) -o $@ centipede.o $(LIBS)
|
||||
|
||||
sizecount: sizecount.o ../phonetic.o ../ch_malloc.o $(SLAPD_LIBDEPEND)
|
||||
$(LTLINK) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o $(LIBS)
|
||||
|
||||
clean-local: FORCE
|
||||
$(RM) $(PROGRAMS) $(LDBMPROGRAMS) \
|
||||
$(XPROGRAMS) $(XSRCS) *.o core .libs/* *.exe
|
||||
$(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) *.o core .libs/* *.exe
|
||||
|
||||
depend-local: FORCE
|
||||
DEPEND_LDBM= ; \
|
||||
if [ "$(BUILD_LDBM)" != "no" ]; then \
|
||||
DEPEND_LDBM="$(LDBMSRCS)"; \
|
||||
fi; \
|
||||
$(MKDEP) $(DEFS) $(DEFINES) $(SRCS) $$DEPEND_LDBM
|
||||
|
||||
install-local: install-ldbm-$(BUILD_LDBM)
|
||||
|
||||
install-ldbm-no:
|
||||
|
||||
install-ldbm-yes install-ldbm-mod: FORCE
|
||||
-$(MKDIR) $(DESTDIR)$(sbindir)
|
||||
@for bin in $(PROGRAMS); do \
|
||||
$(LTINSTALL) $(INSTALLFLAGS) -s -m 755 \
|
||||
$$bin$(EXEEXT) $(DESTDIR)$(sbindir); \
|
||||
done
|
||||
$(MKDEP) $(DEFS) $(DEFINES) $(SRCS)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,796 +0,0 @@
|
|||
/* $OpenLDAP$ */
|
||||
/*
|
||||
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
|
||||
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
||||
*/
|
||||
#include "portable.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <ac/stdlib.h>
|
||||
#include <ac/socket.h>
|
||||
#include <ac/string.h>
|
||||
#include <ac/ctype.h>
|
||||
#include <ac/time.h>
|
||||
#include <ac/unistd.h>
|
||||
#include <ac/wait.h>
|
||||
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IO_H
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#include "../slap.h"
|
||||
#include "../back-ldbm/back-ldbm.h"
|
||||
|
||||
static DBCache *openchoice(char c, int mode, int verbose, char **fname);
|
||||
static void print_entry(FILE *fp, char c, Datum *key, char *klabel, Datum *data, char *dlabel);
|
||||
static void free_and_close(DBCache *dbc, Datum key, Datum data);
|
||||
static void edit_entry(char c, Datum *data);
|
||||
static void get_keydata(FILE *fp, char c, Datum *key, Datum *data);
|
||||
|
||||
static DBCache *dbc;
|
||||
static LDBM dbp;
|
||||
static Backend *be = NULL;
|
||||
|
||||
int
|
||||
main( int argc, char **argv )
|
||||
{
|
||||
char buf[256];
|
||||
Datum savekey, key, data, last;
|
||||
char *fname;
|
||||
ID id, cursor;
|
||||
ID_BLOCK *idl;
|
||||
Backend *tbe;
|
||||
int i;
|
||||
char *tailorfile;
|
||||
|
||||
LDBMCursor *cursorp;
|
||||
|
||||
fprintf(stderr,
|
||||
"ldbmtest not updated to support new index formats!\n" );
|
||||
exit( EXIT_FAILURE );
|
||||
|
||||
|
||||
ldbm_datum_init( savekey );
|
||||
ldbm_datum_init( key );
|
||||
ldbm_datum_init( data );
|
||||
ldbm_datum_init( last );
|
||||
|
||||
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
|
||||
while ( (i = getopt( argc, argv, "d:f:" )) != EOF ) {
|
||||
switch ( i ) {
|
||||
case 'd': /* turn on debugging */
|
||||
ldap_debug = atoi( optarg );
|
||||
break;
|
||||
|
||||
case 'f': /* specify a tailor file */
|
||||
tailorfile = strdup( optarg );
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf( stderr,
|
||||
"usage: %s [-d level] [-f slapdconfigfile]\n",
|
||||
argv[0] );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* initialize stuff and figure out which backend we're dealing with
|
||||
*/
|
||||
|
||||
slap_init(SLAP_TOOL_MODE, "ldbmtest");
|
||||
read_config( tailorfile );
|
||||
slap_startup( NULL );
|
||||
|
||||
while ( 1 ) {
|
||||
printf( "dbtest: " );
|
||||
|
||||
if ( fgets( buf, sizeof(buf), stdin ) == NULL )
|
||||
break;
|
||||
|
||||
switch ( buf[0] ) {
|
||||
case 'c': /* create an index */
|
||||
fname = NULL;
|
||||
if ( (dbc = openchoice( buf[1], LDBM_READER, 0,
|
||||
&fname )) != NULL ) {
|
||||
printf( "Already exists\n" );
|
||||
ldbm_close( dbc->dbc_db );
|
||||
break;
|
||||
}
|
||||
if ( (dbc = openchoice( buf[1], LDBM_WRCREAT, 1,
|
||||
&fname )) != NULL ) {
|
||||
ldbm_close( dbc->dbc_db );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l': /* lookup something in an index */
|
||||
if ( (dbc = openchoice( buf[1], LDBM_READER, 1, NULL ))
|
||||
== NULL ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
get_keydata( stdin, buf[1], &key, NULL );
|
||||
data = ldbm_fetch( dbc->dbc_db, key );
|
||||
print_entry( stdout, buf[1], &key, "key: ", &data,
|
||||
"data:\n" );
|
||||
|
||||
free_and_close( dbc, key, data );
|
||||
break;
|
||||
|
||||
case 'L': /* get all blocks for a key from an index */
|
||||
if ( (dbc = openchoice( buf[1], LDBM_READER, 1, NULL ))
|
||||
== NULL ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
get_keydata( stdin, buf[1], &key, NULL );
|
||||
if ( (idl = idl_fetch( be, dbc, key )) != NULL ) {
|
||||
data.dptr = (char *) idl;
|
||||
data.dsize = (ID_BLOCK_NMAX(idl) + 1) * sizeof(ID);
|
||||
print_entry( stdout, buf[1], &key, "key: ",
|
||||
&data, "data:\n" );
|
||||
}
|
||||
free_and_close( dbc, key, data );
|
||||
break;
|
||||
|
||||
case 't': /* traverse */
|
||||
case 'T': /* traverse - keys only */
|
||||
if ( (dbc = openchoice( buf[1], LDBM_READER, 1, NULL ))
|
||||
== NULL ) {
|
||||
perror( "openchoice" );
|
||||
continue;
|
||||
}
|
||||
|
||||
savekey.dptr = NULL;
|
||||
for ( key = ldbm_firstkey( dbc->dbc_db, &cursorp );
|
||||
key.dptr != NULL;
|
||||
key = ldbm_nextkey( dbc->dbc_db, key, cursorp ) )
|
||||
{
|
||||
if ( savekey.dptr != NULL )
|
||||
ldbm_datum_free( dbc->dbc_db, savekey );
|
||||
savekey = key;
|
||||
|
||||
data = ldbm_fetch( dbc->dbc_db, key );
|
||||
|
||||
if ( buf[0] == 't' ) {
|
||||
print_entry( stdout, buf[1], &key,
|
||||
"key: ", &data, "data:\n" );
|
||||
} else {
|
||||
print_entry( stdout, buf[1], &key,
|
||||
"key: ", NULL, NULL );
|
||||
}
|
||||
|
||||
if ( data.dptr != NULL ) {
|
||||
ldbm_datum_free( dbc->dbc_db, data );
|
||||
}
|
||||
}
|
||||
if ( savekey.dptr != NULL )
|
||||
ldbm_datum_free( dbc->dbc_db, savekey );
|
||||
|
||||
ldbm_close( dbc->dbc_db );
|
||||
break;
|
||||
|
||||
case 'x': /* delete an entry */
|
||||
if ( (dbc = openchoice( buf[1], LDBM_WRITER, 1, NULL ))
|
||||
== NULL ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
get_keydata( stdin, buf[1], &key, NULL );
|
||||
|
||||
if ( ldbm_delete( dbc->dbc_db, key ) != 0 ) {
|
||||
if ( ldbm_errno( dbc->dbc_db ) == 0 ) {
|
||||
perror( "ldbm_delete" );
|
||||
} else {
|
||||
fprintf( stderr, "db_errno=%d",
|
||||
ldbm_errno( dbc->dbc_db ) );
|
||||
}
|
||||
}
|
||||
|
||||
data.dptr = NULL;
|
||||
free_and_close( dbc, key, data );
|
||||
break;
|
||||
|
||||
#ifndef HAVE_WINSOCK
|
||||
case 'e': /* edit an entry */
|
||||
if ( (dbc = openchoice( buf[1], LDBM_WRITER, 1, NULL ))
|
||||
== NULL ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
get_keydata( stdin, buf[1], &key, NULL );
|
||||
|
||||
data = ldbm_fetch( dbc->dbc_db, key );
|
||||
if ( data.dptr == NULL ) {
|
||||
if ( ldbm_errno( dbc->dbc_db ) == 0 ) {
|
||||
perror( "ldbm_fetch" );
|
||||
} else {
|
||||
fprintf( stderr, "db_errno=%d\n",
|
||||
ldbm_errno( dbc->dbc_db ) );
|
||||
}
|
||||
free_and_close( dbc, key, data );
|
||||
break;
|
||||
}
|
||||
|
||||
edit_entry( buf[1], &data );
|
||||
|
||||
if ( data.dptr == NULL ) {
|
||||
if ( ldbm_delete( dbc->dbc_db, key ) != 0 ) {
|
||||
perror( "ldbm_delete" );
|
||||
}
|
||||
} else if ( ldbm_store( dbc->dbc_db, key, data,
|
||||
LDBM_REPLACE ) != 0 ) {
|
||||
if ( ldbm_errno( dbc->dbc_db ) == 0 ) {
|
||||
perror( "ldbm_store" );
|
||||
} else {
|
||||
fprintf( stderr, "db_errno=%d\n",
|
||||
ldbm_errno( dbc->dbc_db ) );
|
||||
}
|
||||
}
|
||||
|
||||
free_and_close( dbc, key, data );
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 'a': /* add an entry */
|
||||
if ( (dbc = openchoice( buf[1], LDBM_WRITER, 1, NULL ))
|
||||
== NULL ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
get_keydata( stdin, buf[1], &key, &data );
|
||||
|
||||
if ( ldbm_store( dbc->dbc_db, key, data, LDBM_INSERT )
|
||||
!= 0 ) {
|
||||
if ( ldbm_errno( dbc->dbc_db ) == 0 ) {
|
||||
perror( "ldbm_store" );
|
||||
} else {
|
||||
fprintf( stderr, "db_errno=%d\n",
|
||||
ldbm_errno( dbc->dbc_db ) );
|
||||
}
|
||||
}
|
||||
|
||||
free_and_close( dbc, key, data );
|
||||
break;
|
||||
|
||||
case 'i': /* insert an id into an index entry */
|
||||
if ( (dbc = openchoice( buf[1], LDBM_WRITER, 1, NULL ))
|
||||
== NULL ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
get_keydata( stdin, buf[1], &key, &data );
|
||||
|
||||
idl = (ID_BLOCK *) data.dptr;
|
||||
for ( id = idl_firstid( idl, &cursor ); id != NOID;
|
||||
id = idl_nextid( idl, &cursor ) ) {
|
||||
if ( idl_insert_key( be, dbc, key, id )
|
||||
!= 0 ) {
|
||||
fprintf( stderr,
|
||||
"idl_insert_key (%s) %ld failed\n",
|
||||
key.dptr, id );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
free_and_close( dbc, key, data );
|
||||
break;
|
||||
|
||||
case 'b': /* select a backend by suffix */
|
||||
printf( "suffix: " );
|
||||
fflush( stdout );
|
||||
if ( fgets( buf, sizeof(buf), stdin ) == NULL ) {
|
||||
exit( EXIT_SUCCESS );
|
||||
} else {
|
||||
buf[strlen( buf ) - 1] = '\0';
|
||||
}
|
||||
(void) dn_normalize( buf );
|
||||
if ( (tbe = select_backend( buf )) == NULL ) {
|
||||
fprintf( stderr, "unknown suffix \"%s\"\n",
|
||||
buf );
|
||||
} else {
|
||||
be = tbe;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'B': /* print current suffix */
|
||||
if ( be == NULL ) {
|
||||
printf( "no current backend\n" );
|
||||
} else {
|
||||
printf( "current backend has suffix \"%s\"\n",
|
||||
be->be_suffix[0] );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'C': /* produce concordance of an index */
|
||||
if ( (dbc = openchoice( 'i', LDBM_READER, 1, NULL ))
|
||||
== NULL ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
last.dptr = NULL;
|
||||
|
||||
for ( key = ldbm_firstkey( dbp, &cursorp );
|
||||
key.dptr != NULL;
|
||||
key = ldbm_nextkey( dbp, last, cursorp ) )
|
||||
{
|
||||
if ( last.dptr != NULL ) {
|
||||
ldbm_datum_free( dbp, last );
|
||||
}
|
||||
last = key;
|
||||
printf( "key(%d): (%s)\n", key.dsize,
|
||||
key.dptr );
|
||||
}
|
||||
|
||||
free_and_close( dbc, key, last );
|
||||
break;
|
||||
|
||||
default:
|
||||
printf( "commands: l<c> => lookup index\n" );
|
||||
printf( " L<c> => lookup index (all)\n" );
|
||||
printf( " t<c> => traverse index\n" );
|
||||
printf( " T<c> => traverse index keys\n" );
|
||||
printf( " x<c> => delete from index\n" );
|
||||
printf( " e<c> => edit index entry\n" );
|
||||
printf( " a<c> => add index entry\n" );
|
||||
printf( " c<c> => create index\n" );
|
||||
printf( " i<c> => insert ids into index\n" );
|
||||
printf( " b => change default backend\n" );
|
||||
printf( " B => print default backend\n" );
|
||||
printf( "where <c> is a char selecting the index:\n" );
|
||||
printf( " d => dn2id\n" );
|
||||
printf( " e => id2entry\n" );
|
||||
printf( " f => arbitrary file\n" );
|
||||
printf( " i => attribute index\n" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
slap_shutdown( NULL );
|
||||
slap_destroy();
|
||||
|
||||
return( EXIT_SUCCESS );
|
||||
}
|
||||
|
||||
static void
|
||||
free_and_close( DBCache *dbc, Datum key, Datum data )
|
||||
{
|
||||
ldbm_cache_really_close( be, dbc );
|
||||
if ( key.dptr != NULL )
|
||||
ldbm_datum_free( dbp, key );
|
||||
if ( data.dptr != NULL )
|
||||
ldbm_datum_free( dbp, data );
|
||||
}
|
||||
|
||||
static int
|
||||
dnid_cmp( const void *a, const void *b )
|
||||
{
|
||||
return( *(const long int *)a - *(const long int *)b );
|
||||
}
|
||||
|
||||
static char *
|
||||
myrealloc( char *p, int size )
|
||||
{
|
||||
if ( p == NULL )
|
||||
return( (char *) malloc( size ) );
|
||||
else
|
||||
return( (char *) realloc( p, size ) );
|
||||
}
|
||||
|
||||
static void
|
||||
get_idlist( FILE *fp, Datum *data )
|
||||
{
|
||||
char buf[20];
|
||||
int i, fd, tty;
|
||||
ID_BLOCK *p;
|
||||
unsigned int psize, pmax;
|
||||
unsigned int nmax, nids;
|
||||
|
||||
fd = fileno( fp );
|
||||
tty = isatty( fd );
|
||||
|
||||
p = NULL;
|
||||
psize = 2 * sizeof(ID);
|
||||
pmax = 0;
|
||||
nmax = 0;
|
||||
nids = 0;
|
||||
i = 0;
|
||||
while ( 1 ) {
|
||||
if ( tty )
|
||||
printf( "id? " );
|
||||
if ( fgets( buf, sizeof(buf), fp ) == NULL || buf[0] == '\n' )
|
||||
break;
|
||||
if ( strncmp( buf, "nmax=", 5 ) == 0 ) {
|
||||
nmax = atol( buf + 5 );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( psize + sizeof(ID) > pmax ) {
|
||||
pmax += BUFSIZ;
|
||||
p = (ID_BLOCK *) myrealloc( (char *) p, pmax );
|
||||
}
|
||||
|
||||
if ( strncmp( buf, "nids=0", 6 ) == 0 ) {
|
||||
nids = NOID;
|
||||
continue;
|
||||
}
|
||||
|
||||
ID_BLOCK_ID(p,i++) = atol( buf );
|
||||
psize += sizeof(ID);
|
||||
}
|
||||
if ( nmax == 0 ) {
|
||||
if ( tty ) {
|
||||
nmax = i;
|
||||
printf( "%d IDs entered. Max number of ids? [%d] ", i,
|
||||
i );
|
||||
if ( fgets( buf, sizeof(buf), fp ) != NULL &&
|
||||
isdigit( (unsigned char) buf[0] ) ) {
|
||||
nmax = atol( buf );
|
||||
}
|
||||
} else {
|
||||
nmax = i;
|
||||
}
|
||||
}
|
||||
if ( i > 0 ) {
|
||||
ID_BLOCK_NMAX(p) = nmax;
|
||||
if ( nids != 0 ) {
|
||||
ID_BLOCK_NIDS(p) = 0;
|
||||
ID_BLOCK_ID(p,i) = NOID;
|
||||
} else {
|
||||
ID_BLOCK_NIDS(p) = i;
|
||||
}
|
||||
|
||||
qsort( (void *) &ID_BLOCK_ID(p, 0), i, sizeof(ID), dnid_cmp );
|
||||
}
|
||||
|
||||
data->dptr = (char *) p;
|
||||
data->dsize = (nmax + ID_BLOCK_IDS_OFFSET) * sizeof(ID);
|
||||
}
|
||||
|
||||
static void
|
||||
get_entry( FILE *fp, Datum *data )
|
||||
{
|
||||
char buf[BUFSIZ];
|
||||
char *p;
|
||||
unsigned int pmax, psize, len;
|
||||
int fd;
|
||||
|
||||
fd = fileno( fp );
|
||||
if ( isatty( fd ) )
|
||||
printf( "Enter entry, <cr><cr> to end:\n" );
|
||||
|
||||
p = NULL;
|
||||
pmax = psize = 0;
|
||||
while ( fgets( buf, sizeof(buf), fp ) != NULL ) {
|
||||
len = strlen( buf );
|
||||
if ( psize + strlen( buf ) > pmax ) {
|
||||
pmax += BUFSIZ;
|
||||
p = myrealloc( p, pmax );
|
||||
}
|
||||
if ( psize == 0 )
|
||||
strcpy( p, buf );
|
||||
else
|
||||
strcat( p, buf );
|
||||
psize += len;
|
||||
|
||||
if ( buf[0] == '\n' )
|
||||
break;
|
||||
}
|
||||
|
||||
data->dptr = p;
|
||||
data->dsize = psize + 1;
|
||||
}
|
||||
|
||||
#ifndef HAVE_WINSOCK
|
||||
static void
|
||||
edit_entry( char c, Datum *data )
|
||||
{
|
||||
int fd, pid;
|
||||
char tmpname[20];
|
||||
FILE *fp;
|
||||
#ifndef HAVE_WAITPID
|
||||
WAITSTATUSTYPE status;
|
||||
#endif
|
||||
|
||||
strcpy( tmpname, LDAP_TMPDIR LDAP_DEFSEP "dbtestXXXXXX" );
|
||||
#ifndef HAVE_MKSTEMP
|
||||
if ( (fd = open( mktemp( tmpname ), O_RDWR|O_CREAT|O_EXCL, 0600 )) == -1 ) {
|
||||
perror( tmpname );
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if ( (fd = mkstemp( tmpname )) == -1 ) {
|
||||
perror( tmpname );
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
fp = fdopen( fd, "w" );
|
||||
print_entry( fp, c, NULL, NULL, data, NULL );
|
||||
fflush( fp );
|
||||
|
||||
pid = fork();
|
||||
|
||||
if ( pid == -1 ) {
|
||||
perror( "fork" );
|
||||
return;
|
||||
} else if ( pid == 0 ) {
|
||||
char *editor;
|
||||
|
||||
if ( (editor = getenv( "EDITOR" )) == NULL ) {
|
||||
editor = LDAP_EDITOR;
|
||||
}
|
||||
execl( editor, editor, tmpname, NULL );
|
||||
perror( "execl" );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
fclose( fp );
|
||||
|
||||
#ifdef HAVE_WAITPID
|
||||
if ( waitpid( (pid_t) -1, NULL, WAIT_FLAGS ) < 0 )
|
||||
#else
|
||||
if ( wait3( (pid_t) -1, &status, WAIT_FLAGS, 0 ) < 0 )
|
||||
#endif
|
||||
{
|
||||
perror( "wait" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (fp = fopen( tmpname, "r" )) == NULL ) {
|
||||
perror( tmpname );
|
||||
return;
|
||||
}
|
||||
if ( data->dptr != NULL ) {
|
||||
ldbm_datum_free( NULL, *data );
|
||||
}
|
||||
get_keydata( fp, c, NULL, data );
|
||||
fclose( fp );
|
||||
unlink( tmpname );
|
||||
}
|
||||
#endif
|
||||
|
||||
static DBCache *
|
||||
openfile( char *name, int namesiz, int mode, int verbose, char c )
|
||||
{
|
||||
DBCache *dbc;
|
||||
|
||||
if ( name == NULL || *name == '\0' ) {
|
||||
if ( c == 'f' ) {
|
||||
printf( " file: " );
|
||||
if ( fgets( name, namesiz, stdin ) == NULL )
|
||||
exit( EXIT_SUCCESS );
|
||||
name[strlen( name ) - 1] = '\0';
|
||||
} else {
|
||||
printf( " attr: " );
|
||||
if ( fgets( name, namesiz, stdin ) == NULL )
|
||||
exit( EXIT_SUCCESS );
|
||||
name[strlen( name ) - 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
if ( (dbc = ldbm_cache_open( be, name, (c == 'f') ? "" : LDBM_SUFFIX,
|
||||
LDBM_READER )) == NULL ) {
|
||||
perror( name );
|
||||
} else {
|
||||
dbp = dbc->dbc_db;
|
||||
}
|
||||
|
||||
return( dbc );
|
||||
}
|
||||
|
||||
static DBCache *
|
||||
openchoice( char c, int mode, int verbose, char **fname )
|
||||
{
|
||||
static char name[MAXPATHLEN];
|
||||
|
||||
switch ( c ) {
|
||||
case 'd': /* dn2id */
|
||||
sprintf( name, "dn2id" );
|
||||
break;
|
||||
case 'e': /* id2entry */
|
||||
sprintf( name, "id2entry" );
|
||||
break;
|
||||
case 'f': /* arbitrary file */
|
||||
case 'i': /* index */
|
||||
if ( fname != NULL && *fname != NULL ) {
|
||||
strcpy( name, *fname );
|
||||
} else {
|
||||
name[0] = '\0';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf( "specify one of [fdei] to select file\n" );
|
||||
return( NULL );
|
||||
break;
|
||||
}
|
||||
if ( fname != NULL ) {
|
||||
*fname = name;
|
||||
}
|
||||
|
||||
return( openfile( name, MAXPATHLEN, mode, verbose, c ) );
|
||||
}
|
||||
|
||||
static void
|
||||
print_entry(
|
||||
FILE *fp,
|
||||
char c,
|
||||
Datum *key,
|
||||
char *klabel,
|
||||
Datum *data,
|
||||
char *dlabel
|
||||
)
|
||||
{
|
||||
ID id;
|
||||
ID_BLOCK *idl;
|
||||
unsigned int i;
|
||||
char msg[2];
|
||||
|
||||
if ( data != NULL && data->dptr == NULL ) {
|
||||
msg[0] = c;
|
||||
msg[1] = '\0';
|
||||
|
||||
if ( ldbm_errno( dbp ) == 0 )
|
||||
perror( msg );
|
||||
else
|
||||
fprintf( stderr, "%s: db_errno=%d\n", msg,
|
||||
ldbm_errno( dbp ) );
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( c ) {
|
||||
case 'd': /* dn2id - key is dn, data is dnid */
|
||||
if ( key != NULL )
|
||||
fprintf( fp, "%s%s (len %d)\n", klabel, key->dptr,
|
||||
key->dsize );
|
||||
if ( data != NULL ) {
|
||||
SAFEMEMCPY( (char *) &id, data->dptr, sizeof(ID) );
|
||||
fprintf( fp, "%s%ld\n", dlabel ? dlabel : "", id );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'e': /* id2entry - key is dnid, data is entry */
|
||||
if ( key != NULL ) {
|
||||
SAFEMEMCPY( (char *) &id, key->dptr, sizeof(ID) );
|
||||
fprintf( fp, "%s %ld\n", klabel, id );
|
||||
}
|
||||
if ( data != NULL ) {
|
||||
if ( dlabel ) {
|
||||
fprintf( fp, "data length: %d\n", data->dsize );
|
||||
fputs( dlabel, fp );
|
||||
}
|
||||
fputs( data->dptr, fp );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'i': /* index - key is string, data is dnid[] */
|
||||
if ( key != NULL )
|
||||
fprintf( fp, "%s%s (len %d)\n", klabel, key->dptr,
|
||||
key->dsize );
|
||||
if ( data != NULL ) {
|
||||
idl = (ID_BLOCK *) data->dptr;
|
||||
|
||||
if ( dlabel )
|
||||
fprintf( fp, "%s\tnmax=%ld\n\tncur=%ld\n", dlabel,
|
||||
ID_BLOCK_NMAX(idl), ID_BLOCK_NIDS(idl) );
|
||||
|
||||
if ( ID_BLOCK_INDIRECT( idl ) ) {
|
||||
for ( i = 0; !ID_BLOCK_NOID(idl, i); i++ ) {
|
||||
fprintf( fp, "\t%ld\n", ID_BLOCK_ID(idl, i) );
|
||||
}
|
||||
} else if ( ID_BLOCK_ALLIDS( idl ) ) {
|
||||
fprintf( fp, "\tALLIDS\n" );
|
||||
} else {
|
||||
for ( i = 0; i < ID_BLOCK_NIDS(idl); i++ ) {
|
||||
fprintf( fp, "\t%ld\n", ID_BLOCK_ID(idl,i) );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'f': /* arbitrary file - assume key & data are strings */
|
||||
if ( key != NULL )
|
||||
fprintf( fp, "%s%s\n", klabel, key->dptr );
|
||||
if ( data != NULL ) {
|
||||
fprintf( fp, "%s%s\n", dlabel ? dlabel : "",
|
||||
data->dptr );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf( stderr, "specify [dei] to select a file\n" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
get_keydata( FILE *fp, char c, Datum *key, Datum *data )
|
||||
{
|
||||
static char kbuf[BUFSIZ], dbuf[BUFSIZ];
|
||||
long n;
|
||||
int fd, tty;
|
||||
|
||||
fd = fileno( fp );
|
||||
tty = isatty( fd );
|
||||
|
||||
switch ( c ) {
|
||||
case 'd': /* dn2id - key is dn, data is dnid */
|
||||
if ( key != NULL ) {
|
||||
if ( tty )
|
||||
printf( " dn: " );
|
||||
if ( fgets( kbuf, sizeof(kbuf), fp ) == NULL ) {
|
||||
exit( EXIT_SUCCESS );
|
||||
}
|
||||
kbuf[strlen( kbuf ) - 1] = '\0';
|
||||
key->dptr = strdup( kbuf );
|
||||
key->dsize = strlen( kbuf ) + 1;
|
||||
}
|
||||
|
||||
if ( data != NULL ) {
|
||||
if ( tty )
|
||||
printf( " dnid: " );
|
||||
if ( fgets( dbuf, sizeof(dbuf), fp ) == NULL ) {
|
||||
exit( EXIT_SUCCESS );
|
||||
}
|
||||
n = atol( dbuf );
|
||||
data->dptr = (char *) malloc( sizeof(n) );
|
||||
memcpy( data->dptr, (char *) &n, sizeof(n) );
|
||||
data->dsize = sizeof(n);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'e': /* id2entry - key is dnid, data is entry */
|
||||
if ( key != NULL ) {
|
||||
if ( tty )
|
||||
printf( " dnid: " );
|
||||
if ( fgets( kbuf, sizeof(kbuf), fp ) == NULL ) {
|
||||
exit( EXIT_SUCCESS );
|
||||
}
|
||||
n = atol( kbuf );
|
||||
key->dptr = (char *) malloc( sizeof(n) );
|
||||
memcpy( key->dptr, (char *) &n, sizeof(n) );
|
||||
key->dsize = sizeof(n);
|
||||
}
|
||||
|
||||
if ( data != NULL ) {
|
||||
get_entry( fp, data );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'i': /* index - key is string, data is dnid[] */
|
||||
if ( key != NULL ) {
|
||||
if ( tty )
|
||||
printf( " key: " );
|
||||
if ( fgets( kbuf, sizeof(kbuf), fp ) == NULL ) {
|
||||
exit( EXIT_SUCCESS );
|
||||
}
|
||||
kbuf[strlen( kbuf ) - 1] = '\0';
|
||||
key->dptr = strdup( kbuf );
|
||||
key->dsize = strlen( kbuf ) + 1;
|
||||
}
|
||||
|
||||
if ( data != NULL ) {
|
||||
get_idlist( fp, data );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "specify [dei] to select file type\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
# Microsoft Developer Studio Project File - Name="ldbmtest" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=ldbmtest - Win32 Single Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ldbmtest.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ldbmtest.mak" CFG="ldbmtest - Win32 Single Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ldbmtest - Win32 Release" (based on\
|
||||
"Win32 (x86) Console Application")
|
||||
!MESSAGE "ldbmtest - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "ldbmtest - Win32 Single Debug" (based on\
|
||||
"Win32 (x86) Console Application")
|
||||
!MESSAGE "ldbmtest - Win32 Single Release" (based on\
|
||||
"Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ldbmtest - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\Release"
|
||||
# PROP Intermediate_Dir "..\..\..\Release\ldbmtest"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 libdb.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ldbmtest - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\Debug"
|
||||
# PROP Intermediate_Dir "..\..\..\Debug\ldbmtest"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 libdb.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ldbmtest - Win32 Single Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "ldbmtest"
|
||||
# PROP BASE Intermediate_Dir "ldbmtest"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\SDebug"
|
||||
# PROP Intermediate_Dir "..\..\..\SDebug\ldbmtest"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 libdb.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ldbmtest - Win32 Single Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ldbmtes0"
|
||||
# PROP BASE Intermediate_Dir "ldbmtes0"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\SRelease"
|
||||
# PROP Intermediate_Dir "..\..\..\SRelease\ldbmtest"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 libdbs.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ldbmtest - Win32 Release"
|
||||
# Name "ldbmtest - Win32 Debug"
|
||||
# Name "ldbmtest - Win32 Single Debug"
|
||||
# Name "ldbmtest - Win32 Single Release"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ldbmtest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\mimic.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ldbmtest"=.\ldbmtest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
/* $OpenLDAP$ */
|
||||
/*
|
||||
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
|
||||
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
||||
*/
|
||||
#include "portable.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <ac/stdlib.h>
|
||||
|
||||
#include <ac/string.h>
|
||||
#include <ac/socket.h>
|
||||
#include <ac/unistd.h>
|
||||
|
||||
#ifdef HAVE_IO_H
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#include <ldap.h>
|
||||
|
||||
#include "ldif.h"
|
||||
|
||||
static void
|
||||
usage( char *name )
|
||||
{
|
||||
fprintf( stderr, "usage: %s [-b] <attrtype>\n", name );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
int
|
||||
main( int argc, char **argv )
|
||||
{
|
||||
char buf[BUFSIZ];
|
||||
char *type, *out;
|
||||
int len, binary = 0;
|
||||
|
||||
if (argc < 2 || argc > 3 ) {
|
||||
usage( argv[0] );
|
||||
}
|
||||
if ( argc == 3 ) {
|
||||
if ( strcmp( argv[1], "-b" ) != 0 ) {
|
||||
usage( argv[0] );
|
||||
}
|
||||
binary = 1;
|
||||
type = argv[2];
|
||||
} else {
|
||||
if ( strcmp( argv[1], "-b" ) == 0 ) {
|
||||
usage( argv[0] );
|
||||
}
|
||||
type = argv[1];
|
||||
}
|
||||
|
||||
/* if the -b flag was used, read single binary value from stdin */
|
||||
if ( binary ) {
|
||||
char *val;
|
||||
int nread, max, cur;
|
||||
|
||||
if (( val = (char *) malloc( BUFSIZ )) == NULL ) {
|
||||
perror( "malloc" );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
max = BUFSIZ;
|
||||
cur = 0;
|
||||
while ( (nread = read( 0, buf, BUFSIZ )) != 0 ) {
|
||||
if ( nread + cur > max ) {
|
||||
max += BUFSIZ;
|
||||
if (( val = (char *) realloc( val, max )) ==
|
||||
NULL ) {
|
||||
perror( "realloc" );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
memcpy( val + cur, buf, nread );
|
||||
cur += nread;
|
||||
}
|
||||
|
||||
if (( out = ldif_put( LDIF_PUT_BINARY, type, val, cur )) == NULL ) {
|
||||
perror( "ldif_type_and_value" );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
fputs( out, stdout );
|
||||
ber_memfree( out );
|
||||
free( val );
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
/* not binary: one value per line... */
|
||||
while ( fgets( buf, sizeof(buf), stdin ) != NULL ) {
|
||||
if( buf[len=strlen(buf)] == '\n') buf[len] = '\0';
|
||||
|
||||
if (( out = ldif_put( LDIF_PUT_VALUE, type, buf, strlen( buf ) ))
|
||||
== NULL ) {
|
||||
perror( "ldif_type_and_value" );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
fputs( out, stdout );
|
||||
ber_memfree( out );
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
@ -1,145 +0,0 @@
|
|||
# Microsoft Developer Studio Project File - Name="ldif" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=ldif - Win32 Single Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ldif.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ldif.mak" CFG="ldif - Win32 Single Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ldif - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "ldif - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "ldif - Win32 Single Debug" (based on\
|
||||
"Win32 (x86) Console Application")
|
||||
!MESSAGE "ldif - Win32 Single Release" (based on\
|
||||
"Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ldif - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\Release"
|
||||
# PROP Intermediate_Dir "..\..\..\Release\ldif"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 libdb.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ldif - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "ldif___W"
|
||||
# PROP BASE Intermediate_Dir "ldif___W"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\Debug"
|
||||
# PROP Intermediate_Dir "..\..\..\Debug\ldif"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 libdb.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ldif - Win32 Single Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "ldif___W"
|
||||
# PROP BASE Intermediate_Dir "ldif___W"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\SDebug"
|
||||
# PROP Intermediate_Dir "..\..\..\SDebug\ldif"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 oldif32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
|
||||
# ADD LINK32 libdbs.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ldif - Win32 Single Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ldif___0"
|
||||
# PROP BASE Intermediate_Dir "ldif___0"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\SRelease"
|
||||
# PROP Intermediate_Dir "..\..\..\SRelease\ldif"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 oldif32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
|
||||
# ADD LINK32 libdbs.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ldif - Win32 Release"
|
||||
# Name "ldif - Win32 Debug"
|
||||
# Name "ldif - Win32 Single Debug"
|
||||
# Name "ldif - Win32 Single Release"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ldif.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ldif"=.\ldif.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldif
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldif"=..\..\libraries\libldif\libldif.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -1,190 +0,0 @@
|
|||
/* $OpenLDAP$ */
|
||||
#include "portable.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <ac/stdlib.h>
|
||||
#include <ac/string.h>
|
||||
#include <ac/unistd.h>
|
||||
|
||||
#include <ldap.h>
|
||||
#include <ldbm.h>
|
||||
|
||||
#define CACHE_SIZE 1000000
|
||||
#define MODE 0600
|
||||
#define DB_FLAGS (LDBM_WRCREAT|LDBM_NEWDB)
|
||||
#define SUBLEN 3
|
||||
|
||||
extern char *first_word(char *);
|
||||
extern char *next_word(char *);
|
||||
extern char *word_dup(char *);
|
||||
extern char *phonetic(char *);
|
||||
|
||||
extern int ldap_debug;
|
||||
|
||||
int slap_debug;
|
||||
int ldap_syslog;
|
||||
int ldap_syslog_level;
|
||||
|
||||
static void add(LDBM ldbm, char *s, int *count, int *size, int freeit);
|
||||
|
||||
int
|
||||
main( int argc, char **argv )
|
||||
{
|
||||
LDAP *ld;
|
||||
LDAPMessage *res, *e;
|
||||
int i, j, k, count, len, nentries;
|
||||
int vcount, wcount, pcount, scount;
|
||||
int vsize, wsize, psize, ssize;
|
||||
struct berval **bvals;
|
||||
char **vals;
|
||||
char *dn, *p, *val;
|
||||
char buf[SUBLEN+1];
|
||||
LDBM wldbm, pldbm, sldbm;
|
||||
static char *attrs[] = { "cn", "nentries", NULL };
|
||||
|
||||
/*
|
||||
ldap_debug = 255;
|
||||
*/
|
||||
if ( (ld = ldap_init( "vertigo:5555", 0 )) == NULL ) {
|
||||
perror( "ldap_init" );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
if ( ldap_search( ld, "cn=index", LDAP_SCOPE_ONELEVEL, "(objectclass=*)",
|
||||
attrs, 0 ) == -1 ) {
|
||||
ldap_perror( ld, "ldap_search" );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
printf( "attr\tdn\tnentries\tvcount\tvsize\twcount\twsize\tpcount\tpsize\tscount\tssize\n" );
|
||||
fflush( stdout );
|
||||
count = 0;
|
||||
while ( ldap_result( ld, LDAP_RES_ANY, 0, NULL, &res )
|
||||
== LDAP_RES_SEARCH_ENTRY ) {
|
||||
count++;
|
||||
e = ldap_first_entry( ld, res );
|
||||
dn = ldap_get_dn( ld, e );
|
||||
if ( (vals = ldap_get_values( ld, e, "nentries" )) != NULL ) {
|
||||
nentries = atoi( vals[0] );
|
||||
ldap_value_free( vals );
|
||||
} else {
|
||||
fprintf( stderr, "no nentries attribute for (%s)\n", dn );
|
||||
nentries = -1;
|
||||
}
|
||||
|
||||
for ( i = 0; attrs[i] != NULL; i++ ) {
|
||||
if ( strcasecmp( attrs[i], "nentries" ) == 0 ) {
|
||||
continue;
|
||||
}
|
||||
if ( (wldbm = ldbm_open( "wcount.ldbm", DB_FLAGS, MODE,
|
||||
CACHE_SIZE )) == NULL || (pldbm = ldbm_open( "pcount.ldbm",
|
||||
DB_FLAGS, MODE, CACHE_SIZE )) == NULL || (sldbm = ldbm_open(
|
||||
"scount.ldbm", DB_FLAGS, MODE, CACHE_SIZE )) == NULL ) {
|
||||
perror( "ldbm_open" );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
vcount = 0; vsize = 0;
|
||||
wcount = 0; wsize = 0;
|
||||
pcount = 0; psize = 0;
|
||||
scount = 0; ssize = 0;
|
||||
if ( (bvals = ldap_get_values_len( ld, e, attrs[i] )) != NULL ) {
|
||||
for ( j = 0; bvals[j] != NULL; j++ ) {
|
||||
char *w;
|
||||
|
||||
/* update value count */
|
||||
vcount++;
|
||||
vsize += bvals[j]->bv_len;
|
||||
|
||||
/* update word and phoneme counts */
|
||||
for ( w = first_word( bvals[j]->bv_val ); w != NULL;
|
||||
w = next_word( w ) ) {
|
||||
add( wldbm, word_dup( w ), &wcount, &wsize, 1 );
|
||||
|
||||
add( pldbm, phonetic( w ), &pcount, &psize, 1 );
|
||||
}
|
||||
|
||||
/* update substring count */
|
||||
len = bvals[j]->bv_len;
|
||||
val = bvals[j]->bv_val;
|
||||
if ( len > SUBLEN - 2 ) {
|
||||
buf[0] = '^';
|
||||
for ( k = 0; k < SUBLEN - 1; k++ ) {
|
||||
buf[k + 1] = val[k];
|
||||
}
|
||||
buf[SUBLEN] = '\0';
|
||||
add( sldbm, buf, &scount, &ssize, 0 );
|
||||
|
||||
p = val + len - SUBLEN + 1;
|
||||
for ( k = 0; k < SUBLEN; k++ ) {
|
||||
buf[k] = p[k];
|
||||
}
|
||||
buf[SUBLEN - 1] = '$';
|
||||
buf[SUBLEN] = '\0';
|
||||
add( sldbm, buf, &scount, &ssize, 0 );
|
||||
}
|
||||
for ( p = val; p < (val + len - SUBLEN + 1); p++ ) {
|
||||
for ( k = 0; k < SUBLEN; k++ ) {
|
||||
buf[k] = p[k];
|
||||
}
|
||||
buf[SUBLEN] = '\0';
|
||||
add( sldbm, buf, &scount, &ssize, 0 );
|
||||
}
|
||||
}
|
||||
ldap_value_free_len( bvals );
|
||||
}
|
||||
printf( "%s\t%s\t%d", attrs[i], dn, nentries );
|
||||
printf( "\t%d\t%d", vcount, vsize );
|
||||
printf( "\t%d\t%d", wcount, wsize );
|
||||
printf( "\t%d\t%d", pcount, psize );
|
||||
printf( "\t%d\t%d\n", scount, ssize );
|
||||
fflush( stdout );
|
||||
|
||||
ldbm_close( wldbm );
|
||||
ldbm_close( pldbm );
|
||||
ldbm_close( sldbm );
|
||||
}
|
||||
|
||||
free( dn );
|
||||
ldap_msgfree( res );
|
||||
}
|
||||
printf( "%d entries\n", count );
|
||||
fflush( stdout );
|
||||
|
||||
if ( ldap_result2error( ld, res, 1 ) != LDAP_SUCCESS ) {
|
||||
ldap_perror( ld, "ldap_result" );
|
||||
}
|
||||
ldap_unbind( ld );
|
||||
|
||||
(void) unlink( "wcount.ldbm" );
|
||||
(void) unlink( "pcount.ldbm" );
|
||||
(void) unlink( "scount.ldbm" );
|
||||
|
||||
exit( EXIT_SUCCESS );
|
||||
}
|
||||
|
||||
static void
|
||||
add(
|
||||
LDBM ldbm,
|
||||
char *s,
|
||||
int *count,
|
||||
int *size,
|
||||
int freeit
|
||||
)
|
||||
{
|
||||
Datum key, data;
|
||||
|
||||
ldbm_datum_init( key );
|
||||
ldbm_datum_init( data );
|
||||
|
||||
key.dptr = s;
|
||||
key.dsize = strlen( key.dptr ) + 1;
|
||||
data.dptr = "";
|
||||
data.dsize = 0;
|
||||
if ( ldbm_store( ldbm, key, data, LDBM_INSERT ) == 0 ) {
|
||||
(*count)++;
|
||||
(*size) += strlen( key.dptr );
|
||||
}
|
||||
if ( freeit && ( key.dptr != NULL ) )
|
||||
ldbm_datum_free( ldbm, key );
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libldap_r"=..\..\libraries\libldap_r\libldap_r.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "slurpd"=.\slurpd.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Loading…
Reference in a new issue