Hi all, I would like to use AutoFS on Samba but I encounter difficulties with ldap entries. I have already add the Automount Schema from the Wiki (https://wiki.samba.org/index.php/Samba_AD_schema_extensions) but I can't add "auto_master" and the folowings leaf. I tried : dn: automountmapname=auto_master,dc=MYDOMAIN automountMapName: auto_master objectClass: automountMap objectClass: top With error : "ERR: (Naming violation) "objectclass: Invalid RDN 'AUTOMOUNTMAPNAME' for objectclass 'automountMap'!"" and |dn: ou=auto.master,ou=automount,||dc=MYDOMAIN objectClass: top objectClass: automountMap objectClass: organizationalUnit ou: auto.master name: auto.master automountMapName: auto.master| With error : ERR: (Object class violation) "objectclass: the objectclass 'organizationalUnit' seems to be unrelated to automountMap!" Did someone succeed with AutoFs and Samba 4 ? If yes could you please share your ldifs ? Thanks Jeremy
On Fri, 18 Aug 2017 11:52:51 +0200 Jeremy Guasco via samba <samba at lists.samba.org> wrote:> Hi all, > > I would like to use AutoFS on Samba but I encounter difficulties with > ldap entries. > I have already add the Automount Schema from the Wiki > (https://wiki.samba.org/index.php/Samba_AD_schema_extensions) but I > can't add "auto_master" and the folowings leaf. > > I tried : > > dn: automountmapname=auto_master,dc=MYDOMAIN > automountMapName: auto_master > objectClass: automountMap > objectClass: top > > With error : "ERR: (Naming violation) "objectclass: Invalid RDN > 'AUTOMOUNTMAPNAME' for objectclass 'automountMap'!"" > > and > > |dn: ou=auto.master,ou=automount,||dc=MYDOMAIN > objectClass: top > objectClass: automountMap > objectClass: organizationalUnit > ou: auto.master > name: auto.master > automountMapName: auto.master| > > With error : ERR: (Object class violation) "objectclass: the > objectclass 'organizationalUnit' seems to be unrelated to > automountMap!" > > Did someone succeed with AutoFs and Samba 4 ? If yes could you please > share your ldifs ? > > Thanks > > JeremyYou need something like this: dn: OU=automount,dc=MYDOMAIN objectClass: top objectClass: organizationalUnit ou: automount name: automount showInAdvancedViewOnly: TRUE dn: OU=auto.master,OU=automount,dc=MYDOMAIN objectClass: top objectClass: automountMap objectClass: organizationalUnit ou: auto.master name: auto.master automountMapName: auto.master dn: CN=/shares,OU=auto.master,OU=automount,dc=MYDOMAIN objectClass: top objectClass: automount objectClass: container cn: /shares name: /shares automountKey: /shares automountInformation: auto.shares dn: OU=auto.shares,OU=automount,dc=MYDOMAIN objectClass: top objectClass: automountMap objectClass: organizationalUnit ou: auto.shares name: auto.shares automountMapName: auto.shares dn: CN=dropbox,OU=auto.shares,OU=automount,dc=MYDOMAIN objectClass: top objectClass: automount objectClass: container cn: dropbox name: dropbox automountKey: dropbox automountInformation: -fstype=cifs,rw,username=rowland,password=xxxxxxxxxx,uid=3001106,iocharset=utf8 ://192.168.0.2/dropbox You then need something to extract the info from AD. Rowland
On Mon, 21 Aug 2017 11:48:39 +0200 Jeremy Guasco <jguasco+samba at lncsa.com> wrote:> Thank you for the reply. > > I can create the "dn: OU=automount" but when I want to create "dn: > OU=auto.master,OU=automount" I have the following error : > > ERR: (Object class violation) "objectclass: the objectclass > 'organizationalUnit' seems to be unrelated to automountMap!" on DN > OU=auto.master,OU=automount,dc=corp,DC=lncsa,dc=com at block before > line 15 Modify failed after processing 0 recordsHow did you add the schema you found on the Samba wikipage ? Rowland
On Mon, 21 Aug 2017 13:47:39 +0200 Jeremy Guasco <jguasco+samba at lncsa.com> wrote:> Le 21/08/2017 à 12:21, Rowland Penny via samba a écrit : > > On Mon, 21 Aug 2017 11:48:39 +0200 > > Jeremy Guasco <jguasco+samba at lncsa.com> wrote: > > > >> Thank you for the reply. > >> > >> I can create the "dn: OU=automount" but when I want to create "dn: > >> OU=auto.master,OU=automount" I have the following error : > >> > >> ERR: (Object class violation) "objectclass: the objectclass > >> 'organizationalUnit' seems to be unrelated to automountMap!" on DN > >> OU=auto.master,OU=automount,dc=corp,DC=lncsa,dc=com at block before > >> line 15 Modify failed after processing 0 records > > How did you add the schema you found on the Samba wikipage ? > > > > Rowland > > > > I splited the ldif on 2 files (attributes and classes) : > > ldbmodify -H /var/lib/samba/private/sam.ldb > samba_automount_attributes --option="dsdb:schema update allowed"=true > > ldbmodify -H /var/lib/samba/private/sam.ldb samba_automount_classes > --option="dsdb:schema update allowed"=true >That's the correct way to do it (the wikipage was wrong, I have corrected this) Have you checked that the objectClasses are in AD ? ldbsearch --cross-ncs -H /usr/local/samba/private/sam.ldb -b "CN=Schema,CN=Configuration,DC=samdom,DC=example,DC=com" -s sub '(cn=automount)' ldbsearch --cross-ncs -H /usr/local/samba/private/sam.ldb -b "CN=Schema,CN=Configuration,DC=samdom,DC=example,DC=com" -s sub '(cn=automountMap)' If they do exist, what do you get for 'objectClassCategory' ? Rowland
On Mon, 21 Aug 2017 14:52:40 +0200 Jeremy Guasco <jguasco+samba at lncsa.com> wrote:> Le 21/08/2017 à 14:15, Rowland Penny via samba a écrit : > > > > That's the correct way to do it (the wikipage was wrong, I have > > corrected this) > > > > Have you checked that the objectClasses are in AD ? > > > > ldbsearch --cross-ncs -H /usr/local/samba/private/sam.ldb -b > > "CN=Schema,CN=Configuration,DC=samdom,DC=example,DC=com" -s sub > > '(cn=automount)' > > > > ldbsearch --cross-ncs -H /usr/local/samba/private/sam.ldb -b > > "CN=Schema,CN=Configuration,DC=samdom,DC=example,DC=com" -s sub > > '(cn=automountMap)' > > > > If they do exist, what do you get for 'objectClassCategory' ? > > > > Rowland > > > Here are the 2 objectClasses with objectClassCategory at 1*: > * > > > dn: CN=automount,CN=Schema,CN=Configuration,DC=corp,DC=lncsa,DC=com > objectClass: top > objectClass: classSchema > cn: automount > description: Automount information > instanceType: 4 > whenCreated: 20170818122538.0Z > whenChanged: 20170818122538.0Z > uSNCreated: 10604 > subClassOf: top > governsID: 1.3.6.1.1.1.2.17 > mustContain: automountKey > mustContain: automountInformation > mayContain: description > rDNAttID: cn > showInAdvancedViewOnly: TRUE > *objectClassCategory: 1* > lDAPDisplayName: automount > name: automount > objectGUID: 4ce936a8-8791-4b74-944b-f8e66748724d > schemaIDGUID: 32dda32c-859a-c19a-f0da-de84c2c8fd47 > objectCategory: > CN=Class-Schema,CN=Schema,CN=Configuration,DC=corp,DC=lncsa,DC > =com > defaultObjectCategory: > CN=automount,CN=Schema,CN=Configuration,DC=corp,DC=lncs > a,DC=com > uSNChanged: 10605 > distinguishedName: > CN=automount,CN=Schema,CN=Configuration,DC=corp,DC=lncsa,DC > =com > > > dn: CN=automountMap,CN=Schema,CN=Configuration,DC=corp,DC=lncsa,DC=com > objectClass: top > objectClass: classSchema > cn: automountMap > instanceType: 4 > whenCreated: 20170818122538.0Z > whenChanged: 20170818122538.0Z > uSNCreated: 10601 > subClassOf: top > governsID: 1.3.6.1.1.1.2.16 > mustContain: automountMapName > mayContain: description > rDNAttID: cn > showInAdvancedViewOnly: TRUE > *objectClassCategory: 1* > lDAPDisplayName: automountMap > name: automountMap > objectGUID: 16aef7e2-65b5-4810-b253-a0f5b0242e77 > schemaIDGUID: b75c9d77-997c-bfb3-635f-1a001b6cdf1c > objectCategory: > CN=Class-Schema,CN=Schema,CN=Configuration,DC=corp,DC=lncsa,DC > =com > defaultObjectCategory: > CN=automountMap,CN=Schema,CN=Configuration,DC=corp,DC=l > ncsa,DC=com > uSNChanged: 10602 > distinguishedName: > CN=automountMap,CN=Schema,CN=Configuration,DC=corp,DC=lncsa > ,DC=com > > >And here is the same attribute from mine: objectClassCategory: 3 Notice the difference ? 1 = Structural 3 = auxiliary Probably the easiest way out of this, will be to try and modify the '1' to '3' with ldbedit: ldbedit -e nano --cross-ncs -H /usr/local/samba/private/sam.ldb --option="dsdb:schema update allowed"=true Change 'nano' to your favourite editor and '/usr/local/samba/private' to the path to your 'sam.ldb' Search for 'objectClassCategory' in 'CN=automount' & 'CN=automountMap' in 'CN=Schema,CN=Configuration,DC=your,DC=domain,DC=com Change the '1' to '3' and save and close the file. Hopefully, you should now be able to add your autofs ldifs. This should work, but as always, you do this at your own risk and should back everything up before hand ;-) I will try and upload a new ldif txt file to the wiki Rowland