Browse Source

pam: use lua for %post scriptlet

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@3853 ec354946-7b23-47d6-9f5a-488ba84defc7
daisuke 14 years ago
parent
commit
2f4d7e28c5
1 changed files with 23 additions and 16 deletions
  1. 23 16
      p/pam/pam-vl.spec

+ 23 - 16
p/pam/pam-vl.spec

@@ -6,7 +6,7 @@ Summary: A security tool which provides authentication for applications
 Summary(ja): アプリケーションに認証の仕組みを提供するセキュリティツール
 Name: pam
 Version: 1.1.1
-Release: 5%{?_dist_release}
+Release: 6%{?_dist_release}
 # The library is BSD licensed with option to relicense as GPLv2+ - this option is redundant
 # as the BSD license allows that anyway. pam_timestamp and pam_console modules are GPLv2+
 License: BSD and GPLv2+
@@ -54,7 +54,8 @@ Patch1010: pam-1.1.1-cve-2010-3853.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: cracklib, cracklib-dicts >= 2.8
-Requires(post): coreutils, /sbin/ldconfig
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
 BuildRequires: autoconf >= 2.60
 BuildRequires: automake, libtool
 BuildRequires: bison, flex, sed
@@ -95,7 +96,8 @@ Summary: A security tool which provides authentication for applications.
 Summary(ja): アプリケーションに認証の仕組みを提供するセキュリティツール
 Group: System Environment/Base
 Requires: %{name} = %{version}-%{release}
-
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
 
 %description -n compat32-%{name}
 PAM (Pluggable Authentication Modules) is a system security tool
@@ -287,19 +289,20 @@ done
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-/sbin/ldconfig
-if [ ! -a /var/log/faillog ] ; then
-	install -m 600 /dev/null /var/log/faillog
-fi
-if [ ! -a /var/log/tallylog ] ; then
-	install -m 600 /dev/null /var/log/tallylog
-fi
-
-## restart sshd
-if [ -e /etc/rc.d/init.d/sshd ]; then
-        /etc/rc.d/init.d/sshd condrestart
-fi
+%post -p <lua>
+os.execute("/sbin/ldconfig")
+list = {"faillog", "tallylog"}
+for i, f in pairs(list) do
+  fname = "/var/log"..f
+  if not posix.access(fname, "r") then
+    f = io.open(fname, "w")
+    f:close()
+    posix.chmod(fname, "u+rw,go-rwx")
+  end
+end
+if posix.access("/etc/rc.d/init.d/sshd", "x") then
+  os.execute("/etc/rc.d/init.d/sshd condrestart")
+end
 
 %postun -p /sbin/ldconfig
 
@@ -503,6 +506,10 @@ fi
 
 
 %changelog
+* Thu May 12 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 1.1.1-6
+- use lua in %%post scriptlet
+  - remove coreutils from R(post)
+
 * Tue Apr 19 2011 IWAI, Masaharu <iwai@alib.jp> 1.1.1-5
 - add patches from RHEL 1.1.1-4.1
  - drop-privs patch (Patch1009): fix CVE-2010-3435 and CVE-2010-3316