1 |
Thanks to David Michael for the initial patch and upstream fixes. |
2 |
|
3 |
Signed-off-by: Michał Górny <mgorny@g.o> |
4 |
--- |
5 |
eclass/acct-group.eclass | 16 +++++++++++++++- |
6 |
eclass/acct-user.eclass | 16 +++++++++++++++- |
7 |
2 files changed, 30 insertions(+), 2 deletions(-) |
8 |
|
9 |
diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass |
10 |
index 5550e4a2fb10..dc1562974870 100644 |
11 |
--- a/eclass/acct-group.eclass |
12 |
+++ b/eclass/acct-group.eclass |
13 |
@@ -80,7 +80,7 @@ S=${WORKDIR} |
14 |
|
15 |
|
16 |
# << Phase functions >> |
17 |
-EXPORT_FUNCTIONS pkg_pretend pkg_preinst |
18 |
+EXPORT_FUNCTIONS pkg_pretend src_install pkg_preinst |
19 |
|
20 |
# @FUNCTION: acct-group_pkg_pretend |
21 |
# @DESCRIPTION: |
22 |
@@ -116,6 +116,20 @@ acct-group_pkg_pretend() { |
23 |
fi |
24 |
} |
25 |
|
26 |
+# @FUNCTION: acct-group_src_install |
27 |
+# @DESCRIPTION: |
28 |
+# Installs sysusers.d file for the group. |
29 |
+acct-group_src_install() { |
30 |
+ debug-print-function ${FUNCNAME} "${@}" |
31 |
+ |
32 |
+ insinto /usr/lib/sysusers.d |
33 |
+ newins - ${CATEGORY}-${ACCT_GROUP_NAME}.conf < <( |
34 |
+ printf "g\t%q\t%q\n" \ |
35 |
+ "${ACCT_GROUP_NAME}" \ |
36 |
+ "${ACCT_GROUP_ID/#-*/-}" |
37 |
+ ) |
38 |
+} |
39 |
+ |
40 |
# @FUNCTION: acct-group_pkg_preinst |
41 |
# @DESCRIPTION: |
42 |
# Creates the group if it does not exist yet. |
43 |
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass |
44 |
index e82f3c56dbbe..f9772c3cb111 100644 |
45 |
--- a/eclass/acct-user.eclass |
46 |
+++ b/eclass/acct-user.eclass |
47 |
@@ -312,7 +312,7 @@ acct-user_pkg_pretend() { |
48 |
# @FUNCTION: acct-user_src_install |
49 |
# @DESCRIPTION: |
50 |
# Installs a keep-file into the user's home directory to ensure it is |
51 |
-# owned by the package. |
52 |
+# owned by the package, and sysusers.d file. |
53 |
acct-user_src_install() { |
54 |
debug-print-function ${FUNCNAME} "${@}" |
55 |
|
56 |
@@ -321,6 +321,20 @@ acct-user_src_install() { |
57 |
# created yet |
58 |
keepdir "${ACCT_USER_HOME}" |
59 |
fi |
60 |
+ |
61 |
+ insinto /usr/lib/sysusers.d |
62 |
+ newins - ${CATEGORY}-${ACCT_USER_NAME}.conf < <( |
63 |
+ printf "u\t%q\t%q\t%q\t%q\t%q\n" \ |
64 |
+ "${ACCT_USER_NAME}" \ |
65 |
+ "${ACCT_USER_ID/#-*/-}:${ACCT_USER_GROUPS[0]}" \ |
66 |
+ "${DESCRIPTION//[:,=]/;}" \ |
67 |
+ "${ACCT_USER_HOME}" \ |
68 |
+ "${ACCT_USER_SHELL/#-*/-}" |
69 |
+ if [[ ${#ACCT_USER_GROUPS[@]} -gt 1 ]]; then |
70 |
+ printf "m\t${ACCT_USER_NAME}\t%q\n" \ |
71 |
+ "${ACCT_USER_GROUPS[@]:1}" |
72 |
+ fi |
73 |
+ ) |
74 |
} |
75 |
|
76 |
# @FUNCTION: acct-user_pkg_preinst |
77 |
-- |
78 |
2.28.0 |