From 819ffa1c37010b03176bdb0c3b5fbb221008c3af Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 18 Jan 2002 22:01:29 +0000 Subject: [PATCH] Limit slurpd friendly code to replication user. --- servers/slapd/add.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/servers/slapd/add.c b/servers/slapd/add.c index c3ec108fe4..d041060170 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -28,6 +28,7 @@ static int slap_mods2entry( Modifications *mods, Entry **e, + int repl_user, const char **text ); int @@ -279,7 +280,7 @@ do_add( Connection *conn, Operation *op ) } } - rc = slap_mods2entry( modlist, &e, &text ); + rc = slap_mods2entry( modlist, &e, repl_user, &text ); if( rc != LDAP_SUCCESS ) { send_ldap_result( conn, op, rc, NULL, text, NULL, NULL ); @@ -335,6 +336,7 @@ done: static int slap_mods2entry( Modifications *mods, Entry **e, + int repl_user, const char **text ) { Attribute **tail = &(*e)->e_attrs; @@ -353,6 +355,11 @@ static int slap_mods2entry( #ifdef SLURPD_FRIENDLY ber_len_t i,j; + if( !repl_user ) { + *text = "attribute provided more than once"; + return LDAP_TYPE_OR_VALUE_EXISTS; + } + for( i=0; attr->a_vals[i].bv_val; i++ ) { /* count them */ } @@ -365,6 +372,7 @@ static int slap_mods2entry( sizeof( struct berval ) * (i+j) ); /* should check for duplicates */ + AC_MEMCPY( &attr->a_vals[i], mods->sml_bvalues, sizeof( struct berval ) * j ); -- 2.39.5