LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-20-2011, 10:08 AM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Rep: Reputation: 33
LDAP syntax : shorter notation


Hello,

I want to write the following shorter :

access to dn="ou=book1,ou=contacts,ou=110011,dc=webonline" attrs=children
by group.exact="cn=admins,ou=110011,dc=webonline" write
by * none break
access to dn="ou=book2,ou=contacts,ou=110011,dc=webonline" attrs=children
by group.exact="cn=admins,ou=110011,dc=webonline" write
by * none break
access to dn="ou=book3,ou=contacts,ou=110011,dc=webonline" attrs=children
by group.exact="cn=admins,ou=110011,dc=webonline" write
by * none break
 
Old 09-21-2011, 03:12 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
can i suggest in what way you want to make it shorter? actually describing a problem is kinda useful. and a please / thank you never hurts either. assuming this is OpenLDAP (is it??) then try a dn.regex: http://www.openldap.org/doc/admin24/access-control.html
 
Old 09-21-2011, 05:12 AM   #3
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Original Poster
Rep: Reputation: 33
Yes this is openLDAP.

You see that I have several OU's beneath ou=contacts,ou=110011,dc=webonline :
- book1
- book2
- book3
- bookX

In stead of repeating the same line every time :

access to dn="ou=bookX,ou=contacts,ou=110011,dc=webonline" attrs=children
by group.exact="cn=admins,ou=110011,dc=webonline" write
by * none break

is there a possibility to write this shorter ?

Thank you for responding.
 
Old 09-21-2011, 05:14 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
as above, look at a dn.regex.
 
Old 09-21-2011, 05:44 AM   #5
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Original Poster
Rep: Reputation: 33
Something like :

access to dn.regex="ou=book[123],ou=contacts,ou=110011,dc=webonline" attrs=children

I don't see where <pattern> is explained ? Or are these regular expressions the same as in PHP ?
 
Old 09-21-2011, 05:50 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
a regular expression is a standard across all implementations. Unless they are done wrong.
 
Old 09-21-2011, 07:40 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Umm, actually there are lang & tool specific variations http://regex.info/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ldap syntax wrong ? jonaskellens Linux - Newbie 1 04-29-2011 04:58 AM
LDAP Problem Invalid DN Syntax (34) steve007 Linux - Newbie 3 08-24-2009 08:53 AM
Even shorter way of getting around LQ Jeebizz LQ Suggestions & Feedback 11 02-20-2009 05:29 PM
LDAP Problem Invalid DN syntax (34) steve007 Linux - Newbie 3 10-18-2005 06:03 AM
pointer notation vs array notation? pablowablo Programming 5 03-14-2005 01:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration