[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Generated fields from static rules ?



On 10/14/12Â11:23Â+0200, Yoann Gini wrote:
Hello,

Iâm new on this list. I actually try to configure a LDAP server to manage my identities (and use Kerberos as authentication backend). In my goal, I want to minimize information that need to be set by administrator to create entry.

Here is a basic example :

dn: uid=yoann,ou=people,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
objectClass: posixAccount
cn: Yoann Gini
gidNumber: 20
homeDirectory: /home/users/yoann
sn: Gini
uid: yoann
uidNumber: 2000
givenName: Yoann
loginShell: /usr/local/bin/zsh
mail: yoann@example.com
userPassword: {SASL}yoann@EXAMPLE.COM

As you can see, they have many redundant informationsâ

What I looking for is a way to fix some field for posixAccount or *,ou=people,dc=example,dc=com.

For example, userPassword should be construct with a static text, a ldap entry and a global variableâ {SASL}$uid$#KRB_REALM#.
Like the mail : $uid$#domain#

#!/bin/sh

username=$1
domainname=$2
firstname=$3
lastname=$4
uidnumber=$5
gidnumber=$6
uc_domainname=`echo $domainname | tr 'a-z' 'A-Z'`

cat << EOF
dn: uid=$username,ou=people,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
objectClass: posixAccount
cn: $firstname $lastname
gidNumber: $gidnumber
homeDirectory: /home/users/$username
sn: $lastname
uid: $username
uidNumber: $uidnumber
givenName: $lastname
loginShell: /usr/local/bin/zsh
mail: $username@$domainname
userPassword: {SASL}$username@$uc_domainname
EOF

--
Dan White