I'm trying to get the value of a user's home from a puppet script. This particular user is a Samba user, not a local one, with the username of the form DOMAIN\user
.
I've tried the following, with no success:
echo "~DOMAIN\\user"
( outputs the exact input )getent passwd DOMAIN\\user
( outputs nothing, the user is not even listed using getent passwd )
I'm surprised that getent did not work, since it is configured to do so:
$ cat /etc/nsswitch.conf | grep passwd
passwd: compat winbind
A simple C program using the getpwnam
works, but that's going to be problematic to include and use from puppet.
How can I retrieve the user's home from puppet or a simple shell command?