Re: NameErr: DSID-03050C55, problem 2003 (BAD_ATT_SYNTAX) when adding group with nested group

ClĂ©ment OUDOT <[email protected]> Wed, 16 Dec 2015 10:38:09 +0100
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <CAK_oV4_sfJbMdh1DLafVD8Xpgjpuw978cBBZPEGWECtifsc3jQ@mail.gmail.com>
--047d7beb94580916ff052700aa41
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

2015-12-16 10:31 GMT+01:00 Natxo Asenjo <[email protected]>:

> hi,
>
> creating a group with nested groups in it fails with error
>
> NameErr: DSID-03050C55, problem 2003 (BAD_ATT_SYNTAX), data 0, best match
> of:
>
> in ldap AD 2008r2
>
> This is the code:
>
> my $nested_group =3D "HRM - Management";
> my $dn =3D "cn=3D$nested_group,$test_base";
>
> my @groups =3D (
>     "cn=3Dhrm - management - mt,$test_base",
>     "cn=3Dhrm - management - directie,$test_base"
> );
>
> my $result =3D $ldaptest->add(
>     "$dn",
>     attrs =3D> [
>         'objectclass'    =3D> [qw/top group/],
>         'cn'             =3D> "cn=3D$nested_group",
>         'samAccountName' =3D> "$nested_group",
>         'grouptype'      =3D> 0x80000002,
>         'member'         =3D> [@groups],
>     ]
> );
>
> $result->code && warn "failed to add group $dn ", $result->error;
>
> Adding users is no problem. Do you know what I'm doing wrong?
>


You need to pass an array ref to the member attribute :

 'member'         =3D> \@groups,


Cl=C3=A9ment.

--047d7beb94580916ff052700aa41
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">2015-12-16 10:31 GMT+01:00 Natxo Asenjo <span dir=3D"ltr">&lt;<a href=
=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
</a>&gt;</span>:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div =
dir=3D"ltr"><div>hi,<br><br></div>creating a group with nested groups in it=
 fails with error <br><br clear=3D"all"><div><div><div>NameErr: DSID-03050C=
55, problem 2003 (BAD_ATT_SYNTAX), data 0, best match of:<br><br></div><div=
>in ldap AD 2008r2<br></div><div><br>This is the code:<br><br>my $nested_gr=
oup =3D &quot;HRM - Management&quot;;<br>my $dn =3D &quot;cn=3D$nested_grou=
p,$test_base&quot;;<br><br>my @groups =3D (<br>=C2=A0=C2=A0=C2=A0 &quot;cn=
=3Dhrm - management - mt,$test_base&quot;,<br>=C2=A0=C2=A0=C2=A0 &quot;cn=
=3Dhrm - management - directie,$test_base&quot;<br>);<br><br>my $result =3D=
 $ldaptest-&gt;add(<br>=C2=A0=C2=A0=C2=A0 &quot;$dn&quot;,<br>=C2=A0=C2=A0=
=C2=A0 attrs =3D&gt; [<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &#39;o=
bjectclass&#39;=C2=A0=C2=A0=C2=A0 =3D&gt; [qw/top group/],<br>=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &#39;cn&#39;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D&gt; &quot;cn=3D$nested_group=
&quot;,<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &#39;samAccountName&#=
39; =3D&gt; &quot;$nested_group&quot;,<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 &#39;grouptype&#39;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D&gt; 0x80000=
002,<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &#39;member&#39;=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D&gt; [@groups],<br>=C2=A0=C2=
=A0=C2=A0 ]<br>);<br><br>$result-&gt;code &amp;&amp; warn &quot;failed to a=
dd group $dn &quot;, $result-&gt;error;<br><br></div><div>Adding users is n=
o problem. Do you know what I&#39;m doing wrong?<br></div></div></div></div=
></blockquote><div><br><br></div><div>You need to pass an array ref to the =
member attribute :<br><br>=C2=A0&#39;member&#39;=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 =3D&gt; \@groups,<br><br><br></div><div>Cl=C3=A9ment.=
<br></div></div></div></div>

--047d7beb94580916ff052700aa41--