]> git.pld-linux.org Git - packages/libutempter.git/commitdiff
- replacement for utempter (unfinished)
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Tue, 21 Sep 2010 12:19:31 +0000 (12:19 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    libutempter-lastlog.patch -> 1.1
    libutempter-utmp-cleanup.patch -> 1.1
    libutempter.spec -> 1.63
    utempter-64bit_timeval.patch -> 1.2
    utempter-lastlog.patch -> 1.2
    utempter-utmp-cleanup.patch -> 1.3

libutempter-lastlog.patch [new file with mode: 0644]
libutempter-utmp-cleanup.patch [moved from utempter-utmp-cleanup.patch with 63% similarity]
libutempter.spec
utempter-64bit_timeval.patch [deleted file]
utempter-lastlog.patch [deleted file]

diff --git a/libutempter-lastlog.patch b/libutempter-lastlog.patch
new file mode 100644 (file)
index 0000000..432e4c6
--- /dev/null
@@ -0,0 +1,43 @@
+--- libutempter-1.1.5/utempter.c.org   2010-09-21 14:12:11.474543375 +0200
++++ libutempter-1.1.5/utempter.c       2010-09-21 14:13:35.669584497 +0200
+@@ -113,20 +113,27 @@
+ {
+       struct utmp ut;
+       struct timeval tv;
++      int fd;
++      struct lastlog ll;
+ #ifdef __GLIBC__
+       int     offset;
+ #endif
+       memset(&ut, 0, sizeof(ut));
++      memset(&ll, 0, sizeof(ll));
+       memset(&tv, 0, sizeof(tv));
+       (void) gettimeofday(&tv, 0);
++      ll.ll_time = time(NULL);
+       strncpy(ut.ut_name, user, sizeof(ut.ut_name));
+       strncpy(ut.ut_line, term, sizeof(ut.ut_line));
+-      if (host)
++      strncpy(ll.ll_line, term, sizeof(ll.ll_line));
++      if (host) {
+               strncpy(ut.ut_host, host, sizeof(ut.ut_host));
++              strncpy(ll.ll_host, host, sizeof(ll.ll_host));
++      }
+ #ifdef __GLIBC__
+@@ -156,6 +163,11 @@
+       endutent();
+       (void) updwtmp(_PATH_WTMP, &ut);
++      if ((fd = open(_PATH_LASTLOG, O_RDWR)) != -1) {
++              lseek(fd, (off_t) ((long)pw->pw_uid * sizeof(ll)), SEEK_SET);
++              write(fd, &ll, sizeof(ll));
++              close(fd);
++      }
+ #elif defined(__FreeBSD__)
similarity index 63%
rename from utempter-utmp-cleanup.patch
rename to libutempter-utmp-cleanup.patch
index 24707a3ed78f082f010f4f02ab40f4be3d08401d..686f6f75080c686046a836b12bd9cabd59e60b05 100644 (file)
@@ -1,29 +1,25 @@
-diff -urN utempter-0.5.3.org/Makefile utempter-0.5.3/Makefile
---- utempter-0.5.3.org/Makefile        2003-12-18 23:33:32.081092612 +0100
-+++ utempter-0.5.3/Makefile    2003-12-18 23:34:17.941588864 +0100
-@@ -11,12 +11,12 @@
+--- libutempter-1.1.5/Makefile~        2007-02-19 13:14:08.000000000 +0100
++++ libutempter-1.1.5/Makefile 2010-09-21 14:16:43.025917709 +0200
+@@ -27,7 +27,7 @@
+ STATICLIB = lib$(PROJECT).a
+ MAP = lib$(PROJECT).map
  
- CFLAGS = -Wall $(RPM_OPT_FLAGS)
+-TARGETS = $(PROJECT) $(SHAREDLIB) $(STATICLIB)
++TARGETS = $(PROJECT) $(SHAREDLIB) $(STATICLIB) utmp-cleanup
  
--TARGETS = $(NAME) utmp $(SHAREDLIB)
-+TARGETS = $(NAME) utmp $(SHAREDLIB) utmp-cleanup
- all:  $(TARGETS)
+ INSTALL = install
+ libdir = /usr/lib
+@@ -70,8 +70,9 @@
+       $(INSTALL) -p -m644 $(PROJECT).h $(DESTDIR)$(includedir)/
+       $(INSTALL) -p -m755 $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SHAREDLIB).$(VERSION)
+       $(INSTALL) -p -m644 $(STATICLIB) $(DESTDIR)$(libdir)/
++      $(INSTALL) -p -m755 utmp-cleanup $(DESTDIR)$(libexecdir)/$(PROJECT)/
+       ln -s $(SHAREDLIB).$(VERSION) $(DESTDIR)$(libdir)/$(SONAME)
+       ln -s $(SONAME) $(DESTDIR)$(libdir)/$(SHAREDLIB)
  
  clean:
--      rm -f *.so utempter utmp *.os
-+      rm -f *.so utempter utmp *.os utmp-cleanup
- %.os : %.c
-       $(CC) -c $(CFLAGS) -fPIC $< -o $@
-@@ -26,6 +26,7 @@
-       mkdir -p $(RPM_BUILD_ROOT)/$(LIBDIR)
-       mkdir -p $(RPM_BUILD_ROOT)/usr/include
-       install -m 4755 utempter $(RPM_BUILD_ROOT)/usr/sbin
-+      install -m 755 utmp-cleanup $(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)
-       ln -sf $(SHAREDLIB).$(VERSION) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB)
+-      $(RM) $(TARGETS) iface.o iface.os core *~
++      $(RM) $(TARGETS) iface.o iface.os core *~ utmp-cleanup
 diff -urN utempter-0.5.3.org/utmp-cleanup.c utempter-0.5.3/utmp-cleanup.c
 --- utempter-0.5.3.org/utmp-cleanup.c  1970-01-01 01:00:00.000000000 +0100
 +++ utempter-0.5.3/utmp-cleanup.c      2003-12-18 23:33:51.996966369 +0100
index 1f28059675f629b2f4dc297f5236ec696f4e029a..48f273da4b50dcf9e5c1b9aa66a8d16c2b94c766 100644 (file)
@@ -4,23 +4,25 @@ Summary(pl.UTF-8):    Program pozwalający na zapisywanie w utmpx
 Summary(pt_BR.UTF-8):  Programa para atualização do utmp/wtmp
 Summary(ru.UTF-8):     Привилегированная программа для изменений в utmp/wtmp
 Summary(uk.UTF-8):     Привілейована програма для внесення змін до utmp/wtmp
-Name:          utempter
-Version:       0.5.5
-Release:       10
+%define        utempter_compat_ver     0.5.5
+Name:          libutempter
+Version:       1.1.5
+Release:       0.1
 License:       MIT or LGPL
 Group:         Base
-Source0:       %{name}-%{version}.tar.gz
-# Source0-md5: a628f149132e2f729bc4601e6a4f6c29
+Source0:       ftp://ftp.altlinux.org/pub/people/ldv/utempter/%{name}-%{version}.tar.bz2
+# Source0-md5: d62a93ba9f3796a91cf03be5ef25a9a1
 Patch0:                %{name}-lastlog.patch
 Patch1:                %{name}-utmp-cleanup.patch
-Patch2:                %{name}-64bit_timeval.patch
 BuildRequires: rpmbuild(macros) >= 1.202
 Requires(pre): /usr/bin/getgid
 Requires(pre): /usr/sbin/groupadd
 Requires(post,postun): /sbin/ldconfig
 Requires(postun):      /usr/sbin/groupdel
 Provides:      group(utmp)
+Provides:      utempter = %{utempter_compat_ver}
 Obsoletes:     libutempter0
+Obsoletes:     utempter
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -60,6 +62,7 @@ Summary(pl.UTF-8):    Plik nagłówkowy biblioteki utemptera
 Group:         Development/Libraries
 Requires:      %{name} = %{version}-%{release}
 Obsoletes:     libutempter0-devel
+Obsoletes:     utempter-devel
 
 %description devel
 Header file for utempter library.
@@ -71,19 +74,21 @@ Plik nagłówkowy biblioteki utemptera.
 %setup -q
 %patch0 -p1
 %patch1 -p1
-%patch2 -p1
 
 %build
 %{__make} \
        CC="%{__cc}" \
-       RPM_OPT_FLAGS="%{rpmcflags}"
+       RPM_OPT_FLAGS="%{rpmcppflags} %{rpmcflags}" \
+       libdir="%{_libdir}" \
+       libexecdir="%{_libexecdir}"
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
 %{__make} install \
-       LIBDIR="%{_libdir}" \
-       RPM_BUILD_ROOT=$RPM_BUILD_ROOT
+       libdir="%{_libdir}" \
+       libexecdir="%{_libexecdir}" \
+       DESTDIR=$RPM_BUILD_ROOT
 
 install -d $RPM_BUILD_ROOT/var/run
 :> $RPM_BUILD_ROOT/var/run/utmpx
diff --git a/utempter-64bit_timeval.patch b/utempter-64bit_timeval.patch
deleted file mode 100644 (file)
index 45dc40b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
---- utempter-0.5.5/utempter.c.orig     2010-02-28 21:06:00.395478197 +0100
-+++ utempter-0.5.5/utempter.c  2010-02-28 21:06:52.294473115 +0100
-@@ -91,6 +91,7 @@
-     char * id;
-     int fd;
-     struct lastlog ll;
-+    struct timeval tv;
-  
-     if (argc < 3) usage();
-@@ -158,7 +159,9 @@
-     strncpy(utx.ut_id, id, sizeof(utx.ut_id));
--    gettimeofday(&utx.ut_tv, NULL);
-+    gettimeofday(&tv, NULL);
-+    utx.ut_tv.tv_sec = tv.tv_sec;
-+    utx.ut_tv.tv_usec = tv.tv_usec;
-     ll.ll_time = time(NULL);
-     pututxline(&utx);
diff --git a/utempter-lastlog.patch b/utempter-lastlog.patch
deleted file mode 100644 (file)
index aeb299d..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-diff -ur utempter-0.5.2.orig/utempter.c utempter-0.5.2/utempter.c
---- utempter-0.5.2.orig/utempter.c     Thu Apr  8 18:19:36 1999
-+++ utempter-0.5.2/utempter.c  Fri May  5 04:19:51 2000
-@@ -88,6 +88,8 @@
-     int i;
-     struct stat sb;
-     char * id;
-+    int fd;
-+    struct lastlog ll;
-  
-     if (argc < 3) usage();
-@@ -115,6 +117,7 @@
-       host = NULL;
-     }
-+    memset(&ll, 0, sizeof(ll));
-     memset(&utx, 0, sizeof(utx));
-     if (add)
-       utx.ut_type = USER_PROCESS;
-@@ -130,6 +133,7 @@
-     checkDevice(device);
-     strncpy(utx.ut_line, device + 5, sizeof(utx.ut_line));
-+    strncpy(ll.ll_line, device + 5, sizeof(ll.ll_line));
-     pw = getpwuid(getuid());
-     if (!pw) {
-@@ -139,8 +143,10 @@
-     strncpy(utx.ut_user, pw->pw_name, sizeof(utx.ut_user));
--    if (host) 
-+    if (host) {
-       strncpy(utx.ut_host, host, sizeof(utx.ut_host));
-+      strncpy(ll.ll_host, host, sizeof(ll.ll_host));
-+    }
-     if (!strncmp("pts/", utx.ut_line, 4)) {
-       id = utx.ut_line + 3;
-@@ -152,9 +158,16 @@
-     strncpy(utx.ut_id, id, sizeof(utx.ut_id));
-     gettimeofday(&utx.ut_tv, NULL);
-+    ll.ll_time = time(NULL);
-     pututxline(&utx);
-     updwtmpx(_PATH_WTMP, &utx);
-+
-+    if ((fd = open(_PATH_LASTLOG, O_RDWR)) != -1) {
-+      lseek(fd, (off_t) ((long)pw->pw_uid * sizeof(ll)), SEEK_SET);
-+      write(fd, &ll, sizeof(ll));
-+      close(fd);
-+    }
-     return 0;
- }
This page took 0.090225 seconds and 4 git commands to generate.