summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-03-13 10:57:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-17 16:53:05 +0000
commit39858da23037b377604c2770c659505a12f90e30 (patch)
tree0ba7dc44bebb3705669fa7590bcbe893c929b753 /meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
parent36f3c889709c492c6a451cc0326e1f760903aa8c (diff)
downloadpoky-39858da23037b377604c2770c659505a12f90e30.tar.gz
shadow: 'useradd' copies root's extended attributes
The copy of extended attributes is interesting for Smack systems because it allows to set the security template of the user's home directories without modifying the tools (useradd here). But the version of useradd that copies the extended attributes doesn't copy the extended attributes of the root. This can make use of homes impossible! This patch corrects the issue by copying the extended attributes of the root directory: /home/user will get the extended attributes of /etc/skel. The patch is submitted upstream (see http://lists.alioth.debian.org/pipermail/pkg-shadow-commits/2017-March/003804.html) The existing patch specific to open-embedded is updated: 0001-useradd.c-create-parent-directories-when-necessary.patch Also, attr are activated for native tools. This is needed when users are created during image creation. (From OE-Core rev: eed66e85af5ca6bbdd80cc3d5cf8453e8d8880bc) Signed-off-by: José Bollo <jose.bollo@iot.bzh> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch')
-rw-r--r--meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch10
1 files changed, 8 insertions, 2 deletions
diff --git a/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch b/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
index 85dde8e1bb..2f084b4e9b 100644
--- a/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
+++ b/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
@@ -11,7 +11,7 @@ diff --git a/src/useradd.c b/src/useradd.c
11index 4bd969d..cb5dd6c 100644 11index 4bd969d..cb5dd6c 100644
12--- a/src/useradd.c 12--- a/src/useradd.c
13+++ b/src/useradd.c 13+++ b/src/useradd.c
14@@ -1893,6 +1893,35 @@ static void usr_update (void) 14@@ -1896,6 +1896,35 @@ static void usr_update (void)
15 } 15 }
16 16
17 /* 17 /*
@@ -47,7 +47,7 @@ index 4bd969d..cb5dd6c 100644
47 * create_home - create the user's home directory 47 * create_home - create the user's home directory
48 * 48 *
49 * create_home() creates the user's home directory if it does not 49 * create_home() creates the user's home directory if it does not
50@@ -1907,36 +1936,33 @@ static void create_home (void) 50@@ -1910,39 +1939,36 @@ static void create_home (void)
51 fail_exit (E_HOMEDIR); 51 fail_exit (E_HOMEDIR);
52 } 52 }
53 #endif 53 #endif
@@ -67,6 +67,9 @@ index 4bd969d..cb5dd6c 100644
67- chown (user_home, user_id, user_gid); 67- chown (user_home, user_id, user_gid);
68- chmod (user_home, 68- chmod (user_home,
69- 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK)); 69- 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
70-#ifdef WITH_ATTR
71- attr_copy_file (def_template, user_home, NULL, NULL);
72-#endif
70- home_added = true; 73- home_added = true;
71+ mkdir_p(user_home); 74+ mkdir_p(user_home);
72+ } 75+ }
@@ -88,6 +91,9 @@ index 4bd969d..cb5dd6c 100644
88+ chown (user_home, user_id, user_gid); 91+ chown (user_home, user_id, user_gid);
89+ chmod (user_home, 92+ chmod (user_home,
90+ 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK)); 93+ 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
94+#ifdef WITH_ATTR
95+ attr_copy_file (def_template, user_home, NULL, NULL);
96+#endif
91+ home_added = true; 97+ home_added = true;
92+#ifdef WITH_AUDIT 98+#ifdef WITH_AUDIT
93+ audit_logger (AUDIT_ADD_USER, Prog, 99+ audit_logger (AUDIT_ADD_USER, Prog,