From patchwork Tue Nov 6 17:33:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 197523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "aserp1040.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (not verified)) by ozlabs.org (Postfix) with ESMTPS id DA5292C00B1 for ; Wed, 7 Nov 2012 04:36:53 +1100 (EST) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qA6HaomW000336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Nov 2012 17:36:51 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qA6HaoLd025531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 6 Nov 2012 17:36:50 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1TVn1w-0007Ji-WB; Tue, 06 Nov 2012 09:33:41 -0800 Received: from ucsinet22.oracle.com ([156.151.31.94]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1TVn1s-0007JN-3G for fedfs-utils-devel@oss.oracle.com; Tue, 06 Nov 2012 09:33:36 -0800 Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qA6HXZZ0010883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Nov 2012 17:33:35 GMT Received: from mail-pb0-f43.google.com ([209.85.160.43]) by acsinet13.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qA6HWtFu014787 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 6 Nov 2012 17:33:34 GMT Received: by mail-pb0-f43.google.com with SMTP id jt11so539025pbb.2 for ; Tue, 06 Nov 2012 09:33:34 -0800 (PST) Received: by 10.68.217.67 with SMTP id ow3mr5486788pbc.26.1352223214529; Tue, 06 Nov 2012 09:33:34 -0800 (PST) Received: from seurat.1015granger.net ([2001:df8:0:64:20c:29ff:fe93:815b]) by mx.google.com with ESMTPS id pv8sm2545137pbc.26.2012.11.06.09.33.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Nov 2012 09:33:32 -0800 (PST) From: Chuck Lever To: fedfs-utils-devel@oss.oracle.com Date: Tue, 06 Nov 2012 12:33:30 -0500 Message-ID: <20121106173330.26310.57525.stgit@seurat.1015granger.net> In-Reply-To: <20121106172934.26310.10982.stgit@seurat.1015granger.net> References: <20121106172934.26310.10982.stgit@seurat.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Flow-Control-Info: class=Default reputation=ipRepBelow100 ip=209.85.160.43 ct-class=R6 ct-vol1=0 ct-vol2=0 ct-vol3=0 ct-risk=68 ct-spam1=0 ct-spam2=0 ct-bulk=0 rcpts=1 size=3240 X-MM-CT-Classification: not spam X-MM-CT-RefID: str=0001.0A090208.509949EE.00B9,ss=1,re=0.000,fgs=0 Subject: [fedfs-utils] [PATCH 04/11] libnsdb: Change nsdb_update_nci_s() to insert fedfsNceDN attribute X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] The latest NSDB schema replaces the fedfsNcePrefix attribute with the fedfsNceDN attribute, which is the full DN of the NCE under the current naming context. Update the update_nci and remove_nci APIs to use the fedfsNceDN attribute. Signed-off-by: Chuck Lever --- src/libnsdb/administrator.c | 22 +++++++++------------- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/libnsdb/administrator.c b/src/libnsdb/administrator.c index 1b46360..896a8a8 100644 --- a/src/libnsdb/administrator.c +++ b/src/libnsdb/administrator.c @@ -1086,13 +1086,10 @@ nsdb_update_fsl_s(nsdb_t host, const char *nce, const char *fsl_uuid, * * @param ld an initialized LDAP server descriptor * @param context a NUL-terminated C string containing DN of namingContext - * @param nceprefix a NUL-terminated C string containing value of new FedFsNcePrefix attribute + * @param nce a NUL-terminated C string containing value of new FedFsNceDN attribute * @param ldap_err OUT: possibly an LDAP error code * @return a FedFsStatus code * - * If "nceprefix" is NULL, then assign an empty string value to the - * FedFsNcePrefix attribute. - * * LDIF equivalent: * * @verbatim @@ -1100,15 +1097,15 @@ nsdb_update_fsl_s(nsdb_t host, const char *nce, const char *fsl_uuid, dn: "context" changeType: modify objectClass: fedfsNsdbContainerInfo - add: fedfsNcePrefix - fedfsNcePrefix: "nceprefix" + add: fedfsNceDN + fedfsNceDN: "nce" @endverbatim */ static FedFsStatus nsdb_add_nci_attributes_s(LDAP *ld, const char *context, - const char *nceprefix, unsigned int *ldap_err) + const char *nce, unsigned int *ldap_err) { - char *ocvals[2], *prefixvals[2]; + char *ocvals[2], *ncevals[2]; LDAPMod *mods[3]; LDAPMod mod[2]; int i, rc; @@ -1120,8 +1117,7 @@ nsdb_add_nci_attributes_s(LDAP *ld, const char *context, nsdb_init_mod_attribute(mods[i++], "objectClass", ocvals, "fedfsNsdbContainerInfo"); nsdb_init_mod_attribute(mods[i++], - "fedfsNcePrefix", prefixvals, - nceprefix == NULL ? "" : nceprefix); + "fedfsNceDN", ncevals, nce); mods[i] = NULL; rc = ldap_modify_ext_s(ld, context, mods, NULL, NULL); @@ -1164,7 +1160,7 @@ nsdb_update_nci_s(nsdb_t host, const char *nce, unsigned int *ldap_err) if (retval != FEDFS_OK) return retval; - retval = nsdb_add_nci_attributes_s(host->fn_ldap, context, prefix, + retval = nsdb_add_nci_attributes_s(host->fn_ldap, context, nce, ldap_err); free(context); free(prefix); @@ -1187,7 +1183,7 @@ nsdb_update_nci_s(nsdb_t host, const char *nce, unsigned int *ldap_err) changeType: modify delete: objectClass objectClass: fedfsNsdbContainerInfo - delete: fedfsNcePrefix + delete: fedfsNceDN @endverbatim */ static FedFsStatus @@ -1206,7 +1202,7 @@ nsdb_remove_nci_attributes_s(LDAP *ld, const char *context, nsdb_init_del_attribute(mods[i++], "objectClass", ocvals, "fedfsNsdbContainerInfo"); nsdb_init_del_attribute(mods[i++], - "fedfsNcePrefix", NULL, NULL); + "fedfsNceDN", NULL, NULL); mods[i] = NULL; rc = ldap_modify_ext_s(ld, context, mods, NULL, NULL);