Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3E9B0EFE4 for ; Thu, 17 Jan 2013 16:44:24 +0000 (UTC) Received: (qmail 58909 invoked by uid 500); 17 Jan 2013 16:44:24 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 58873 invoked by uid 500); 17 Jan 2013 16:44:24 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 58864 invoked by uid 99); 17 Jan 2013 16:44:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jan 2013 16:44:24 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of elecharny@gmail.com designates 209.85.217.172 as permitted sender) Received: from [209.85.217.172] (HELO mail-lb0-f172.google.com) (209.85.217.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jan 2013 16:44:17 +0000 Received: by mail-lb0-f172.google.com with SMTP id n8so259121lbj.31 for ; Thu, 17 Jan 2013 08:43:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:reply-to:user-agent:mime-version:to :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=LyNwEpaFtPTWit1S+qCBpcCCfH7u8h58RGh75uLrGn8=; b=c62aCJ9voeG8Je5AJctWEwQXUbdPkB6Me8eGDE3m/drT1HxDUbrQfxGPAHmL009txg HYW/MEZ3FNyymyq4KvFShnCVGUgUxgB/ZHjan6xNDNZkFQb68kUN9oL8LQfuOlnnCKmq 8RcgUO9KmsNQVvFvItIximUnT9E+7hEOXzOWmMjcQjaVCg8Dwu0hOL9bk2NCANANwsq5 l7bYLLfrFTbWsNO0eFH2mU2gwHTSXvT9ywu/x3MpbZyT+IPJSwoKWBe3KIBDTpYyK2T+ BDnTQDvYAoJISzxW49i+WVNuWcjxlKH+eksqxdkw7O29918nfHjsi+wcsXqmWSNjkEnm 0+AQ== X-Received: by 10.152.110.18 with SMTP id hw18mr5548746lab.22.1358441035856; Thu, 17 Jan 2013 08:43:55 -0800 (PST) Received: from Emmanuels-MacBook-Pro.local (lon92-10-78-226-4-211.fbx.proxad.net. [78.226.4.211]) by mx.google.com with ESMTPS id lx18sm981205lab.14.2013.01.17.08.43.54 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jan 2013 08:43:55 -0800 (PST) Message-ID: <50F82A4A.1000703@gmail.com> Date: Thu, 17 Jan 2013 17:43:54 +0100 From: =?UTF-8?B?RW1tYW51ZWwgTMOpY2hhcm55?= Reply-To: elecharny@apache.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: [Attribute writing] Writing non-string attributes References: In-Reply-To: X-Enigmail-Version: 1.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Le 1/17/13 5:22 PM, Jonathan Russell a écrit : > Hello, > > I'm trying to write an array of bytes as an attribute in LDAP. I'm trying to do > this without converting it into a string. So I have the following in my LDIF: > > > dn: m-oid=1.3.6.1.4.1.18060.0.9.3.1.9, ou=attributeTypes, cn=other, ou=schema > objectclass: metaAttributeType > objectclass: metaTop > objectclass: top > m-oid: 1.3.6.1.4.1.18060.0.9.3.1.9 > m-name: ibm-imm > m-description: the actual block data being stored > m-equality: caseIgnoreIA5Match > m-ordering: caseIgnoreOrderingMatch > m-substr: caseIgnoreSubstringsMatch > m-syntax: 1.3.6.1.4.1.1466.115.121.1.15 This is the DirectoryString syntax. Why don't you use the OctetString syntax (1.3.6.1.4.1.1466.115.121.1.40) insted, as you want to store bytes ? Same for the matching rule... > m-length: 32700 > m-singleValue: TRUE > > dn: m-oid=1.3.6.1.4.1.18060.0.9.5.1.2, ou=objectClasses, cn=other, ou=schema > objectclass: metaObjectClass > objectclass: metaTop > objectclass: top > m-oid: 1.3.6.1.4.1.18060.0.9.5.1.2 > m-name: DeploymentBlock > m-description: Deployment information > m-must: cn > m-must: ibm-imm > m-may: name > m-may: uid > m-may: uniqueIdentifier > m-may: fileName > m-may: profileName > m-may: status > m-may: ou > > > In my actual code, I have the following: > ServerEntry newEntry = service.newEntry (new LdapDN (dnString)); > newEntry.add ("objectClass", "top", "DeploymentBlock"); > newEntry.add ("ou", baseString); > newEntry.add ("name", "deployment"); > newEntry.add ("cn", ); > newEntry.add ("ibm-imm", ); > service.getAdminSession ().add (newEntry); > OfmLogHandler.DEBUG ("Done adding block!"); > > When I run my code, I find the entry in Apache Director Studio, but the > attribute associated with the block data ("ibm-imm") is not there. When I try to > read back the data: > > serverEntry.get ("ibm-imm"), it says that it's null. So I'm obviously writing > the data incorrectly, but I'm not sure how. Is my syntax for ibm-imm not correct? Depends on what you store in the attribute. DirectoryString can obly be a valid UTF-8 String, so if you try to store any byte which is not a valid UTF-8 char then it will be rejected. But again, you should use and OctetString syntax. -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com