From 426cd1ce14a32b7c940064bd3772b470252895634d7969fc327dad87382dfab1 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Mon, 7 Jan 2013 19:05:37 +0000 Subject: [PATCH] Accepting request 147441 from home:sbrabec:branches:security:chipcard - Fix path to nologin in useradd (bnc#796242). OBS-URL: https://build.opensuse.org/request/show/147441 OBS-URL: https://build.opensuse.org/package/show/security:chipcard/pcsc-lite?expand=0&rev=85 --- pcsc-lite.changes | 5 +++++ pcsc-lite.spec | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pcsc-lite.changes b/pcsc-lite.changes index b100d63..8bf87d6 100644 --- a/pcsc-lite.changes +++ b/pcsc-lite.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jan 7 19:44:56 CET 2013 - sbrabec@suse.cz + +- Fix path to nologin in useradd (bnc#796242). + ------------------------------------------------------------------- Fri Nov 30 08:34:00 UTC 2012 - wr@rosenauer.org diff --git a/pcsc-lite.spec b/pcsc-lite.spec index a7840a5..3e8131b 100644 --- a/pcsc-lite.spec +++ b/pcsc-lite.spec @@ -1,7 +1,7 @@ # # spec file for package pcsc-lite # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -159,7 +159,12 @@ rm -rf $RPM_BUILD_ROOT %pre getent group %{GROUP} >/dev/null || groupadd -r %{GROUP} -getent passwd %{USER} >/dev/null || useradd -r -g %{GROUP} -s /bin/nologin -c "Smart Card Reader" -d /var/run/pcscd %{USER} +if getent passwd %{USER} >/dev/null ; then + # There was a bad login shell up to openSUSE 12.2 (bnc#796242), never in SLE. Fix it. + usermod -s /usr/sbin/nologin %{USER} +else + useradd -r -g %{GROUP} -s /usr/sbin/nologin -c "Smart Card Reader" -d /var/run/pcscd %{USER} +fi %if %suse_version > 1140 %service_add_pre pcscd.service pcscd.socket %endif