lists.arthurdejong.org
RSS feed

Re: Using the initial letter in the home directory

[Date Prev][Date Next] [Thread Prev][Thread Next]

Re: Using the initial letter in the home directory



Acording to manpage of nslcd.conf and "Attribute mapping expressions" and bash manpage "${parameter:offset:length}"
I think that following example should work:
map     passwd  homeDirectory   "/home/${sAMAccountName:0:1}/${sAMAccountName}"

I haven't tested it, so please try it and you will see.

Best,
JJ


On Tue, May 24, 2016 at 6:22 PM, Giovanni Mascellani <g.mascellani [at] gmail.com> wrote:
Hi dear nss-pam-ldapd users and developers.

I am considering migrating to nss-pam-ldapd a network that at the moment
is using a custom modification by me of the old libnss-ldap (the
modification is to overcome the common mismatch between the Active
Directory server and the Linux clients).

Due to the number of users, I am keeping the home directories grouped in
different directories by the initial letter of the username. For
example, the home of the user foo would be /home/f/foo instead of
/home/foo. Is it possible to do this with the map directive in
nslcd.conf? At the moment I have in the configuration:

  map     passwd  homeDirectory   "/home/${sAMAccountName}"

and would like something like

  map     passwd  homeDirectory
"/home/${initialOfSAMAccountName}/${sAMAccountName}"

If this possible?

Thanks for the help and have a nice day.

Giovanni.
--
Giovanni Mascellani <g.mascellani [at] gmail.com>
PhD Student - Scuola Normale Superiore, Pisa, Italy

http://poisson.phc.unipi.it/~mascellani


--
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe [at] lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-users/



--
Jakub Jindra
-- 
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-users/