The xattr of the root of the skeleton are now
copied when the home directories of users are
created.
This patch is needed to set default Smack attributes
to home directories.
For example, for automatically setting the Smack access of home
directories to User::Home and their transmute value to TRUE for
the newly created users, it is now enough to issue
chsmack -a User::Home -t /etc/skel
where /etc/skel is the skeleton directory used when creating users.
Change-Id: I0a310d03b5fc335a54fad09b1bbff2be107fbb06
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
if (skeldir != NULL && *skeldir != '\0' && access (skeldir, F_OK) == 0)
{
- if (copy_dir_rec (skeldir, home, 0, uid, gid) != 0)
+ if (copy_xattr (skeldir, home) != 0 ||
+ copy_dir_rec (skeldir, home, 0, uid, gid) != 0)
{
fprintf (stderr, _("%s: Copying of skel directory failed.\n"),
program);