Issue 8692 - back-sock does not create LDAP_MOD_INCREMENT message
Summary: back-sock does not create LDAP_MOD_INCREMENT message
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-12 16:52 UTC by Michael Ströder
Modified: 2018-03-22 19:25 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Michael Ströder 2017-07-12 16:52:38 UTC
Full_Name: 
Version: 
OS: 
URL: 
Submission from: (NULL) (85.115.23.42)


back-sock does not generate a MODIFY message with "increment:" line when LDAP
clients sends modify operation with LDAP_MOD_INCREMENT.

Example of incomplete message (incrementing attribute gidNumber):

----------------------------- snip -----------------------------
MODIFY
msgid: 119
binddn: uid=msin,cn=ae,ou=ae-dir
peername: PATH=/usr/local/openldap/var/run/ldapi
ssf: 256
connid: 1025
suffix: ou=ae-dir
dn: ou=ae-dir
gidNumber: 1
-

----------------------------- snip -----------------------------
Comment 1 Michael Ströder 2017-07-12 19:39:03 UTC
This seems really trivial to fix - even for me. ;-)

I've successfully tested it with Python module slapdsock (and ldif module in python-ldap
2.4.41+).

I, Michael Ströder, hereby place the following modifications to OpenLDAP Software (and
only these modifications) into the public domain. Hence, these modifications may be
freely used and/or redistributed for any purpose with or without attribution and/or other
notice.

https://www.stroeder.com/temp/0001-ITS-8692-let-back-sock-generate-increment-line.patch

---------------------------------------------------------------------------------------
From 6c37844c5c52b95aff5e4e547cda8a7258e92a35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Str=C3=B6der?= <michael@stroeder.com>
Date: Wed, 12 Jul 2017 20:18:22 +0200
Subject: [PATCH] ITS#8692 let back-sock generate increment: line in case of
 LDAP_MOD_INCREMENT (see RFC 4525, section 3)

---
 servers/slapd/back-sock/modify.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/servers/slapd/back-sock/modify.c b/servers/slapd/back-sock/modify.c
index c35d31bc6..9342d2702 100644
--- a/servers/slapd/back-sock/modify.c
+++ b/servers/slapd/back-sock/modify.c
@@ -85,6 +85,10 @@ sock_back_modify(
 		case LDAP_MOD_REPLACE:
 			fprintf( fp, "replace: %s\n", mod->sm_desc->ad_cname.bv_val );
 			break;
+
+		case LDAP_MOD_INCREMENT:
+			fprintf( fp, "increment: %s\n", mod->sm_desc->ad_cname.bv_val );
+			break;
 		}

 		if( mod->sm_values != NULL ) {
-- 
2.13.2



Comment 2 Michael Ströder 2017-07-12 19:44:06 UTC
(Re-sent without S/MIME sign. for better readability in ITS)

This seems really trivial to fix - even for me. ;-)

I've successfully tested it with Python module slapdsock (and ldif module in python-ldap
2.4.41+).

I, Michael Ströder, hereby place the following modifications to OpenLDAP Software (and
only these modifications) into the public domain. Hence, these modifications may be
freely used and/or redistributed for any purpose with or without attribution and/or other
notice.

https://www.stroeder.com/temp/0001-ITS-8692-let-back-sock-generate-increment-line.patch

---------------------------------------------------------------------------------------
From 6c37844c5c52b95aff5e4e547cda8a7258e92a35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Str=C3=B6der?= <michael@stroeder.com>
Date: Wed, 12 Jul 2017 20:18:22 +0200
Subject: [PATCH] ITS#8692 let back-sock generate increment: line in case of
 LDAP_MOD_INCREMENT (see RFC 4525, section 3)

---
 servers/slapd/back-sock/modify.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/servers/slapd/back-sock/modify.c b/servers/slapd/back-sock/modify.c
index c35d31bc6..9342d2702 100644
--- a/servers/slapd/back-sock/modify.c
+++ b/servers/slapd/back-sock/modify.c
@@ -85,6 +85,10 @@ sock_back_modify(
 		case LDAP_MOD_REPLACE:
 			fprintf( fp, "replace: %s\n", mod->sm_desc->ad_cname.bv_val );
 			break;
+
+		case LDAP_MOD_INCREMENT:
+			fprintf( fp, "increment: %s\n", mod->sm_desc->ad_cname.bv_val );
+			break;
 		}

 		if( mod->sm_values != NULL ) {
-- 
2.13.2




Comment 3 Michael Ströder 2017-09-08 18:26:56 UTC
Is there anything wrong with the patch herein?

Comment 4 Quanah Gibson-Mount 2017-09-08 18:44:36 UTC
changed notes
Comment 5 Quanah Gibson-Mount 2017-09-08 18:48:24 UTC
changed notes
Comment 6 Quanah Gibson-Mount 2017-09-08 18:49:16 UTC
--On Friday, September 08, 2017 7:27 PM +0000 michael@stroeder.com wrote:

> Is there anything wrong with the patch herein?

Hi Michael,

I've added this to my openldap-scratch repo where I'm pulling in patches 
for review for inclusion into the overall project.  I'll be sending out an 
email to -devel soon covering all the ITSes I have queued up needing review.

Regards,
Quanah


--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
<http://www.symas.com>


Comment 7 Quanah Gibson-Mount 2017-10-11 20:09:33 UTC
changed notes
changed state Open to Release
moved from Incoming to Software Bugs
Comment 8 OpenLDAP project 2018-03-22 19:25:54 UTC
fixed in master
fixed in RE24 (2.4.46)
Comment 9 Quanah Gibson-Mount 2018-03-22 19:25:54 UTC
changed notes
changed state Release to Closed