Accepting request 584535 from home:eeich:branches:network:cluster

- Do not look for the ttyS* group - it should be dialout
  always (boo#1084571).
- Fix shebang - remove /usr/bin/env.

OBS-URL: https://build.opensuse.org/request/show/584535
OBS-URL: https://build.opensuse.org/package/show/network:cluster/conman?expand=0&rev=25
This commit is contained in:
Egbert Eich 2018-03-08 21:09:39 +00:00 committed by Git OBS Bridge
parent c15b3b7c58
commit 88ac25c576
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Mar 8 20:14:50 UTC 2018 - eich@suse.com
- Do not look for the ttyS* group - it should be dialout
always (boo#1084571).
- Fix shebang - remove /usr/bin/env.
-------------------------------------------------------------------
Fri Feb 16 13:15:00 UTC 2018 - eich@suse.com

View File

@ -131,6 +131,8 @@ for i in $(find %{buildroot}/usr/lib/conman) ; do
fi
fi
done
sed -i -e '1 s@#!.*/bin/env perl@#!%{_bindir}/perl@' \
%{buildroot}%{_bindir}/conmen
%if 0%{?conmandir:1}
mkdir -p %{buildroot}%{_tmpfilesdir}
@ -161,16 +163,13 @@ fi
%define conman_home "%_localstatedir%_rundir/%conmandir"
%define conman_descr "Connection Manager service"
shopt -s nullglob
for i in /dev/ttyS[0-9] /dev/ttyS[1-9][0-9]
do TTYS_GRP=$(stat --format="%G" $i); break
done
addgrp=0; addusr=0
getent group %conman_g >/dev/null || addgrp=1
[ $addgrp -eq 1 ] && groupadd -r %conman_g
getent passwd %conman_u >/dev/null || addusr=1
[ $addusr -eq 1 ] && useradd -r -g %conman_g -d %conman_home \
-s /bin/false -c %conman_descr %conman_u
[ -n "$TTYS_GRP" ] && usermod -a -G $TTYS_GRP %conman_u
usermod -a -G dialout %conman_u
%endif
exit 0
%endif