X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslurpd%2Fslurp.h;h=9a125c63f71f80a2ffeeb7399c8c20bd6c1825d6;hb=59d4b38a7c9247d13bbff43c73c253929e348fdf;hp=0cb25e3736ddf4701a499defbd2a655e7edfed3a;hpb=3d491808a8d12428eae124e73c49876befef3286;p=openldap
diff --git a/servers/slurpd/slurp.h b/servers/slurpd/slurp.h
index 0cb25e3736..9a125c63f7 100644
--- a/servers/slurpd/slurp.h
+++ b/servers/slurpd/slurp.h
@@ -1,10 +1,18 @@
/* $OpenLDAP$ */
-/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 1998-2007 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * .
*/
-/*
- * Copyright (c) 1996 Regents of the University of Michigan.
+/* Portions Copyright (c) 1996 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
@@ -14,6 +22,10 @@
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
+/* ACKNOWLEDGEMENTS:
+ * This work was originally developed by the University of Michigan
+ * (as part of U-MICH LDAP).
+ */
/* slurp.h - Standalone Ldap Update Replication Daemon (slurpd) */
@@ -43,11 +55,31 @@
#include "ldif.h"
#ifdef HAVE_WINSOCK
+ /* should be moved to portable.h.nt */
#define ftruncate(a,b) _chsize(a,b)
#define truncate(a,b) _lclose( _lcreat(a, 0))
+#define mkdir(a,b) mkdir(a)
#define S_IRGRP 0
#define S_IWGRP 0
+#ifndef F_OK
+#define F_OK 0
+#endif
+#ifndef W_OK
+#define W_OK 2
+#endif
+#ifndef R_OK
+#define R_OK 4
+#endif
+#ifndef S_IRUSR
+#define S_IRUSR S_IREAD
#endif
+#ifndef S_IWUSR
+#define S_IWUSR S_IWRITE
+#endif
+#endif
+
+#undef SERVICE_NAME
+#define SERVICE_NAME OPENLDAP_PACKAGE "-slurpd"
/* Default directory for slurpd's private copy of replication logs */
#define DEFAULT_SLURPD_REPLICA_DIR LDAP_RUNDIR LDAP_DIRSEP "openldap-slurp"
@@ -61,9 +93,6 @@
/* slurpd dump file - contents of rq struct are written here (debugging) */
#define SLURPD_DUMPFILE LDAP_TMPDIR LDAP_DIRSEP "slurpd.dump"
-/* default srvtab file. Can be overridden */
-#define SRVTAB "/etc/srvtab"
-
/* Amount of time to sleep if no more work to do */
#define DEFAULT_NO_WORK_INTERVAL 3
@@ -81,11 +110,6 @@
#define TLS_ON 1
#define TLS_CRITICAL 2
-/* We support simple (plaintext password) and SASL authentication */
-#define AUTH_SIMPLE 1
-#define AUTH_KERBEROS 2
-#define AUTH_SASL 3
-
/* Rejection records are prefaced with this string */
#define ERROR_STR "ERROR"
@@ -114,8 +138,10 @@
#define T_MODOPREPLACE 9
#define T_MODOPDELETESTR "delete"
#define T_MODOPDELETE 10
+#define T_MODOPINCREMENTSTR "increment"
+#define T_MODOPINCREMENT 11
#define T_MODSEPSTR "-"
-#define T_MODSEP 11
+#define T_MODSEP 12
#define T_NEWRDNSTR "newrdn"
#define T_DELOLDRDNSTR "deleteoldrdn"
@@ -125,23 +151,23 @@
/* Config file keywords */
#define HOSTSTR "host"
+#define URISTR "uri"
#define ATTRSTR "attr"
#define SUFFIXSTR "suffix"
#define BINDDNSTR "binddn"
#define BINDMETHSTR "bindmethod"
-#define KERBEROSSTR "kerberos"
#define SIMPLESTR "simple"
#define SASLSTR "sasl"
#define CREDSTR "credentials"
#define OLDAUTHCSTR "bindprincipal"
#define AUTHCSTR "authcID"
#define AUTHZSTR "authzID"
-#define SRVTABSTR "srvtab"
#define SASLMECHSTR "saslmech"
#define REALMSTR "realm"
#define SECPROPSSTR "secprops"
+#define STARTTLSSTR "starttls"
#define TLSSTR "tls"
-#define TLSCRITICALSTR "critical"
+#define CRITICALSTR "critical"
#define REPLICA_SLEEP_TIME ( 10 )
@@ -151,7 +177,6 @@
#define BIND_ERR_OPEN 2
#define BIND_ERR_BAD_ATYPE 3
#define BIND_ERR_SIMPLE_FAILED 4
-#define BIND_ERR_KERBEROS_FAILED 5
#define BIND_ERR_BADRI 6
#define BIND_ERR_VERSION 7
#define BIND_ERR_REFERRALS 8
@@ -210,16 +235,16 @@ struct ri {
/* Private data */
char *ri_hostname; /* canonical hostname of replica */
int ri_port; /* port where slave slapd running */
+ char *ri_uri; /* e.g. "ldaps://ldap-1.example.com:636" */
LDAP *ri_ldp; /* LDAP struct for this replica */
int ri_tls; /* TLS: 0=no, 1=yes, 2=critical */
- int ri_bind_method; /* AUTH_SIMPLE or AUTH_KERBEROS */
+ int ri_bind_method; /* AUTH_SIMPLE or AUTH_SASL */
char *ri_bind_dn; /* DN to bind as when replicating */
char *ri_password; /* Password for any method */
char *ri_secprops; /* SASL security properties */
char *ri_realm; /* realm for any mechanism */
char *ri_authcId; /* authentication ID for any mechanism */
char *ri_authzId; /* authorization ID for any mechanism */
- char *ri_srvtab; /* srvtab file for kerberos bind */
char *ri_saslmech; /* SASL mechanism to use */
struct re *ri_curr; /* current repl entry being processed */
struct stel *ri_stel; /* pointer to Stel for this replica */
@@ -231,7 +256,6 @@ struct ri {
int (*ri_process) LDAP_P(( Ri * )); /* process the next repl entry */
void (*ri_wake) LDAP_P(( Ri * )); /* wake up a sleeping thread */
};
-
@@ -240,12 +264,10 @@ struct ri {
* be considered private to routines in re.c, and to routines in ri.c.
*/
typedef struct mi {
-
/* Private data */
char *mi_type; /* attr or type */
char *mi_val; /* value */
int mi_len; /* length of mi_val */
-
} Mi;
@@ -257,7 +279,6 @@ typedef struct mi {
*/
typedef struct re Re;
struct re {
-
/* Private data */
ldap_pvt_thread_mutex_t
re_mutex; /* mutex for this Re */