From 21f26c1e6b72808a10c21925e75d8076ac3b6498 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Wed, 6 Jan 2021 13:14:26 +0100 Subject: [PATCH] add git-shell to /etc/shells --- git-core.spec | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/git-core.spec b/git-core.spec index a6c7ac0..d0a7e04 100644 --- a/git-core.spec +++ b/git-core.spec @@ -646,6 +646,20 @@ ln -snf git-remote-http $RPM_BUILD_ROOT%{gitcoredir}/git-remote-ftps %clean rm -rf $RPM_BUILD_ROOT +%post +if [ ! -f /etc/shells ]; then + echo "%{_bindir}/git-shell" >> /etc/shells +else + grep -q '^%{_bindir}/git-shell$' /etc/shells || echo "%{_bindir}/git-shell" >> /etc/shells +fi + +%preun +if [ "$1" = "0" ]; then + umask 022 + grep -v '^%{_bindir}/git-shell$' /etc/shells > /etc/shells.new + mv -f /etc/shells.new /etc/shells +fi + %post daemon-inetd %service -q rc-inetd reload -- 2.43.0