--- /dev/null
+--- Makefile
++++ Makefile 2005/06/20 11:16:24
+@@ -21,6 +21,12 @@
+ %.os : %.c
+ $(CC) -c $(CFLAGS) -fPIC $< -o $@
+
++%.o : %.c
++ $(CC) -c $(CFLAGS) -fpie $< -o $@
++
++utempter: utempter.o
++ $(CC) -o $@ -pie $^
++
+ install:
+ mkdir -p $(RPM_BUILD_ROOT)/usr/sbin
+ mkdir -p $(RPM_BUILD_ROOT)/$(LIBDIR)
--- /dev/null
+--- utempter-0.5.5/utempter.c
++++ utempter-0.5.5/utempter.c
+@@ -89,6 +89,7 @@ int main(int argc, const char ** argv) {
+ int i;
+ struct stat sb;
+ char * id;
++ struct timeval tv;
+
+ if (argc < 3) usage();
+
+@@ -116,6 +117,9 @@ int main(int argc, const char ** argv) {
+ host = NULL;
+ }
+
++ memset(&tv, 0, sizeof(tv));
++ (void) gettimeofday(&tv, 0);
++
+ memset(&utx, 0, sizeof(utx));
+ if (add)
+ utx.ut_type = USER_PROCESS;
+@@ -152,7 +156,8 @@ int main(int argc, const char ** argv) {
+
+ strncpy(utx.ut_id, id, sizeof(utx.ut_id));
+
+- gettimeofday(&utx.ut_tv, NULL);
++ utx.ut_tv.tv_sec = tv.tv_sec;
++ utx.ut_tv.tv_usec = tv.tv_usec;
+
+ pututxline(&utx);
+ updwtmpx(_PATH_WTMP, &utx);
--- /dev/null
+--- utempter-0.5.5/Makefile.eal3 2004-08-05 11:33:17.000000000 +0200
++++ utempter-0.5.5/Makefile 2004-08-05 11:34:06.000000000 +0200
+@@ -25,9 +25,11 @@
+ mkdir -p $(RPM_BUILD_ROOT)/usr/sbin
+ mkdir -p $(RPM_BUILD_ROOT)/$(LIBDIR)
+ mkdir -p $(RPM_BUILD_ROOT)/usr/include
++ mkdir -p $(RPM_BUILD_ROOT)/usr/share/man/man8
+ install -m 4755 utempter $(RPM_BUILD_ROOT)/usr/sbin
+ install -m 644 utempter.h $(RPM_BUILD_ROOT)/usr/include
+ install -m 644 $(SHAREDLIB) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB).$(VERSION)
++ install -c -m 644 utempter.8 $(RPM_BUILD_ROOT)/usr/share/man/man8/utempter.8
+ ln -sf $(SHAREDLIB).$(VERSION) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB)
+
+ $(SHAREDLIB): utmpintf.os
+--- utempter-0.5.5/utempter.8.eal3 1970-01-01 01:00:00.000000000 +0100
++++ utempter-0.5.5/utempter.8 2003-11-18 09:01:43.000000000 +0100
+@@ -0,0 +1,30 @@
++.\" Copyright (C) 2003 International Business Machines Corporation
++.\" Author: Emily Ratliff <ratliff@austin.ibm.com>
++.\" This file is distributed according to the GNU General Public License.
++.\"
++.TH "UTEMPTER" 8 "2003-03-21" "" "Linux System Administrator's Manual"
++.SH NAME
++utempter \- privileged helper program for utmp/wtmp updates
++.SH "SYNOPSIS"
++\fButempter\fR \-a \fIslave-device-name\fR \fIhost\fR
++.sp
++\fButempter\fR \-d \fIslave-device-name\fR
++.SH "DESCRIPTION"
++.B utempter
++is a privileged helper program that writes utmp/wtmp entries for unprivileged
++programs.
++
++.SH "OPTIONS"
++The following options are supported:
++.IP "\fB-a \fIslave-device-name host\fR
++add an entry to the utmp/wtmp file
++.IP "\fB\-d \fIslave-device-name\fR
++delete an entry from the utmp file
++
++.SH "RETURN VALUE"
++On success, 0 is returned.
++On error, 1 is returned.
++
++.SH "SEE ALSO"
++.BR utmp (5),
++.BR utmpname (3)
--- /dev/null
+#
+# spec file for package utempter
+#
+# Copyright (c) 2011 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
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
+
+
+Name: utempter
+%define utmpGroup utmp
+Version: 0.5.5
+Release: 152
+License: MIT
+Summary: A privileged helper for utmp and wtmp updates
+Group: Productivity/Security
+# bug437293
+%ifarch ppc64
+Obsoletes: utempter-64bit
+%endif
+Source: utempter-%{version}.tar.gz
+Source2: baselibs.conf
+Patch0: utempter.eal3.diff
+Patch1: utempter-0.5.5-pie.diff
+Patch2: utempter-ppc64.patch
+#
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+
+%description
+Utempter is a utility that allows non-privileged applications such as
+terminal emulators to modify the utmp database without having to be
+setuid root.
+
+%package devel
+License: MIT
+Summary: Development files for utempter
+Group: Development/Libraries/C and C++
+Requires: %{name} = %{version}
+
+%description devel
+Utempter is a privileged helper for utmp and wtmp updates. This
+package contains the development files needed.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1
+%patch2 -p1
+
+%build
+make %{?_smp_mflags} RPM_OPT_FLAGS="%{optflags}" CC="gcc"
+
+%install
+export DESTDIR=%{buildroot}
+make PREFIX=$DESTDIR LIBDIR=%{_libdir} install
+chmod 755 $DESTDIR%{_libdir}/libutempter.so*
+/sbin/ldconfig -n $DESTDIR%{_libdir}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(444,root,root,755)
+%doc COPYING
+%attr(02755, root, %{utmpGroup}) /usr/sbin/utempter
+%attr(555,root,root) %{_libdir}/libutempter.so.*
+%attr(444,root,root) %doc /usr/share/man/man8/*
+
+%files devel
+%defattr(444,root,root,755)
+%attr(555,root,root) %{_libdir}/libutempter.so
+%attr(444,root,root) /usr/include/utempter.h
+
+%changelog