Skip to content

Commit 70d37e2

Browse files
besser82solardiz
authored andcommitted
misc: Add preset files for systemd-sysusers.
Such preset files are used with distributions that rely on systemd-sysusers to ensure all required system users and system groups are present on system boot. The preset files can be installed by the two new optional "install-sysusers", and, if needed, "install-sysusers-auth" targets. Signed-off-by: Björn Esser <[email protected]>
1 parent 13fa8a4 commit 70d37e2

File tree

7 files changed

+40
-1
lines changed

7 files changed

+40
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/libs/libtcb.so
66
/libs/libtcb.so.0
77
/libs/libtcb.so.0.*
8+
/misc/tcb.sysusers
89
/pam_tcb/pam_tcb.so*
910
/progs/tcb_chkpwd
1011
/progs/tcb_convert

ChangeLog

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@
1515

1616
* ci/run-build-and-tests.sh: Build with "-Werror" enabled on CI.
1717

18+
misc: Add preset file for systemd-sysusers.
19+
Such preset files are used with distributions that rely
20+
on systemd-sysusers to ensure all required system users
21+
and system groups are present on system boot.
22+
* Make.defs: Add preset for SYSUSERSDIR.
23+
* Makefile: Add (optional) top-level "install-sysusers" and
24+
"install-sysusers-auth" targets.
25+
* misc/Makefile: Likewise, with also adding build and clean
26+
targets.
27+
"install-sysusers-auth" targets.
28+
* misc/tcb.sysusers.in: New file.
29+
* misc/tcb-auth.sysusers: New file.
30+
* .gitignore: Add build output from "misc" directory.
31+
1832
2021-09-25 Björn Esser <besser82 at fedoraproject.org>
1933

2034
* pam_tcb/support.c (_set_ctrl): Request automatic prefix only if

Make.defs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ SLIBDIR = /lib
2222
LIBDIR = /usr/lib
2323
LIBEXECDIR = /usr/libexec
2424
MANDIR = /usr/man
25+
SYSUSERSDIR = /usr/lib/sysusers.d
2526

2627
SHLIBMODE = 755

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ all install install-non-root clean:
66

77
install-pam_unix install-pam_pwdb:
88
$(MAKE) -C pam_tcb $@
9+
10+
install-sysusers install-sysusers-auth:
11+
$(MAKE) -C misc $@

misc/Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
include ../Make.defs
22

3-
all clean:
3+
all: tcb.sysusers
4+
5+
tcb.sysusers: tcb.sysusers.in
6+
sed -e "s!@LIBEXECDIR@!$(LIBEXECDIR)!g" < $< > $@
47

58
install-non-root: install
69

@@ -10,3 +13,13 @@ install:
1013

1114
$(INSTALL) -m 644 tcb.5 $(DESTDIR)$(MANDIR)/man5/
1215
$(INSTALL) -m 644 ../include/tcb.h $(DESTDIR)/usr/include/
16+
17+
install-sysusers:
18+
$(MKDIR) -p -m 755 $(DESTDIR)$(SYSUSERSDIR)
19+
$(INSTALL) -m 644 tcb.sysusers $(DESTDIR)$(SYSUSERSDIR)/tcb.conf
20+
21+
install-sysusers-auth: install-sysusers
22+
$(INSTALL) -m 644 tcb-auth.sysusers $(DESTDIR)$(SYSUSERSDIR)/tcb-auth.conf
23+
24+
clean:
25+
rm -f tcb.sysusers

misc/tcb-auth.sysusers

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Additional access group for the tcb password shadowing scheme
2+
# when "TCB_AUTH_GROUP yes" is in use.
3+
# The "root" user is guaranteed to be present on any system.
4+
g auth /etc/tcb/root

misc/tcb.sysusers.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Access groups for the tcb password shadowing scheme
2+
g chkpwd @LIBEXECDIR@/chkpwd
3+
g shadow /etc/tcb

0 commit comments

Comments
 (0)