aboutsummaryrefslogtreecommitdiff
path: root/sysutils/libutempter
diff options
context:
space:
mode:
authorMichael Nottebrock <lofi@FreeBSD.org>2004-08-29 22:54:38 +0000
committerMichael Nottebrock <lofi@FreeBSD.org>2004-08-29 22:54:38 +0000
commit2acccefd8eb0a19e254d17ef2fe1591fdf709795 (patch)
treec03faabebbde09e967dea5f00bb750d36be19596 /sysutils/libutempter
parentabab1efce8ef424338aae5a47e4aa4c59d0c1be3 (diff)
downloadports-2acccefd8eb0a19e254d17ef2fe1591fdf709795.tar.gz
ports-2acccefd8eb0a19e254d17ef2fe1591fdf709795.zip
Notes
Diffstat (limited to 'sysutils/libutempter')
-rw-r--r--sysutils/libutempter/Makefile20
-rw-r--r--sysutils/libutempter/distinfo2
-rw-r--r--sysutils/libutempter/files/patch-Makefile47
-rw-r--r--sysutils/libutempter/files/patch-iface.c18
-rw-r--r--sysutils/libutempter/files/patch-utempter.c76
-rw-r--r--sysutils/libutempter/pkg-descr12
-rw-r--r--sysutils/libutempter/pkg-plist7
7 files changed, 182 insertions, 0 deletions
diff --git a/sysutils/libutempter/Makefile b/sysutils/libutempter/Makefile
new file mode 100644
index 000000000000..b6d0328d603e
--- /dev/null
+++ b/sysutils/libutempter/Makefile
@@ -0,0 +1,20 @@
+# New ports collection makefile for: libutempter
+# Date created: 18 Aug 2004 14:50:41 CEST
+# Whom: Michael Nottebrock <lofi@freebsd.org>,
+# David Malone <dwmalone@maths.tcd.ie>
+# $FreeBSD$
+
+PORTNAME= libutempter
+PORTVERSION= 1.1.1
+CATEGORIES= sysutils
+MASTER_SITES= ftp://ftp.altlinux.org/pub/people/ldv/utempter/
+
+MAINTAINER= ports@FreeBSD.org
+COMMENT= Interface to record user sessions to utmp and wtmp files
+
+USE_BZIP2= yes
+USE_GMAKE= yes
+INSTALLS_SHLIB= yes
+NO_FILTER_SHLIBS=yes
+
+.include <bsd.port.mk>
diff --git a/sysutils/libutempter/distinfo b/sysutils/libutempter/distinfo
new file mode 100644
index 000000000000..a7328eae405d
--- /dev/null
+++ b/sysutils/libutempter/distinfo
@@ -0,0 +1,2 @@
+MD5 (libutempter-1.1.1.tar.bz2) = 0d472416e0234ece562c38a037fbaba0
+SIZE (libutempter-1.1.1.tar.bz2) = 13668
diff --git a/sysutils/libutempter/files/patch-Makefile b/sysutils/libutempter/files/patch-Makefile
new file mode 100644
index 000000000000..e93763181dd3
--- /dev/null
+++ b/sysutils/libutempter/files/patch-Makefile
@@ -0,0 +1,47 @@
+--- Makefile.orig Tue Dec 24 12:25:11 2002
++++ Makefile Wed Aug 18 15:54:06 2004
+@@ -30,12 +30,12 @@
+ TARGETS = $(PROJECT) $(SHAREDLIB) $(STATICLIB)
+
+ INSTALL = install
+-libdir = /usr/lib
+-libexecdir = /usr/lib
+-includedir = /usr/include
+-DESTDIR =
++libdir = /lib
++libexecdir = /libexec
++includedir = /include
++DESTDIR = $(PREFIX)
+
+-CFLAGS = $(RPM_OPT_FLAGS) -DLIBEXECDIR=\"$(libexecdir)\"
++CFLAGS+= -DLIBEXECDIR=\"$(PREFIX)$(libexecdir)\"
+
+ all: $(TARGETS)
+
+@@ -51,13 +51,21 @@
+
+ iface.o: iface.c utempter.h
+
++$(PROJECT).o: $(PROJECT).c
++
++$(PROJECT): $(PROJECT).o
++ $(LINK.o) $(PROJECT).o -o $(PROJECT) -lutil
++
++
+ install:
+- $(INSTALL) -pD -m2711 $(PROJECT) $(DESTDIR)$(libexecdir)/$(PROJECT)/$(PROJECT)
+- $(INSTALL) -pD -m644 $(PROJECT).h $(DESTDIR)$(includedir)/$(PROJECT).h
+- $(INSTALL) -pD -m755 $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SHAREDLIB).$(VERSION)
+- $(INSTALL) -pD -m644 $(STATICLIB) $(DESTDIR)$(libdir)/$(STATICLIB)
++ mkdir -p $(DESTDIR)$(libexecdir)/$(PROJECT) $(DESTDIR)$(includedir) \
++ $(DESTDIR)$(libdir)
++ $(INSTALL) -m4711 $(PROJECT) $(DESTDIR)$(libexecdir)/$(PROJECT)/$(PROJECT)
++ $(INSTALL) -m644 $(PROJECT).h $(DESTDIR)$(includedir)/$(PROJECT).h
++ $(INSTALL) -m755 $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SHAREDLIB).$(VERSION)
++ $(INSTALL) -m644 $(STATICLIB) $(DESTDIR)$(libdir)/$(STATICLIB)
+ ln -s $(SHAREDLIB).$(VERSION) $(DESTDIR)$(libdir)/$(SONAME)
+ ln -s $(SONAME) $(DESTDIR)$(libdir)/$(SHAREDLIB)
+
+ clean:
+- $(RM) $(TARGETS) iface.o iface.os core *~
++ $(RM) $(TARGETS) $(PROJECT).o iface.o iface.os core *~
diff --git a/sysutils/libutempter/files/patch-iface.c b/sysutils/libutempter/files/patch-iface.c
new file mode 100644
index 000000000000..1c214aacb334
--- /dev/null
+++ b/sysutils/libutempter/files/patch-iface.c
@@ -0,0 +1,18 @@
+--- iface.c.orig Wed Aug 18 16:09:25 2004
++++ iface.c Wed Aug 18 16:11:38 2004
+@@ -32,6 +32,15 @@
+ #include <sys/wait.h>
+ #include <sys/types.h>
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ extern int getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid);
+
+ #include "utempter.h"
diff --git a/sysutils/libutempter/files/patch-utempter.c b/sysutils/libutempter/files/patch-utempter.c
new file mode 100644
index 000000000000..7b89e73506d9
--- /dev/null
+++ b/sysutils/libutempter/files/patch-utempter.c
@@ -0,0 +1,76 @@
+--- utempter.c.orig Wed Aug 18 15:04:15 2004
++++ utempter.c Wed Aug 18 15:16:18 2004
+@@ -29,11 +29,11 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+-#include <pty.h>
+ #include <pwd.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+ #include <utmp.h>
++#include <libutil.h>
+
+ #define DEV_PREFIX "/dev/"
+ #define DEV_PREFIX_LEN (sizeof(DEV_PREFIX)-1)
+@@ -102,42 +102,29 @@
+ pid_t pid, int add)
+ {
+ struct utmp ut;
+- int offset = strlen (term) - sizeof (ut.ut_id);
+
+ memset (&ut, 0, sizeof (ut));
+
+- strncpy (ut.ut_user, user, sizeof (ut.ut_user));
++ strncpy (ut.ut_name, user, sizeof (ut.ut_name));
+
+ strncpy (ut.ut_line, term, sizeof (ut.ut_line));
+
+- if (offset < 0)
+- offset = 0;
+- strncpy (ut.ut_id, term + offset, sizeof (ut.ut_id));
+-
+ if (host)
+ strncpy (ut.ut_host, host, sizeof (ut.ut_host));
+
+- if (add)
+- ut.ut_type = USER_PROCESS;
+- else
+- ut.ut_type = DEAD_PROCESS;
+-
+- ut.ut_pid = pid;
+-
+- gettimeofday (&ut.ut_tv, 0);
++ time (&ut.ut_time);
+
+- setutent ();
+- if (!pututline (&ut))
+- {
++ if (add) {
++ login (&ut);
++ } else {
++ if (logout (term) != 1) {
+ #ifdef UTEMPTER_DEBUG
+- fprintf (stderr, "utempter: pututline: %s\n",
+- strerror (errno));
++ fprintf (stderr, "utempter: logout: %s\n",
++ strerror (errno));
+ #endif
+ exit (EXIT_FAILURE);
++ }
+ }
+- endutent ();
+-
+- updwtmp (_PATH_WTMP, &ut);
+
+ #ifdef UTEMPTER_DEBUG
+ fprintf (stderr,
+@@ -203,7 +190,7 @@
+ exit (EXIT_FAILURE);
+ }
+
+- device = ptsname (STDIN_FILENO);
++ device = ttyname (STDIN_FILENO);
+ if (!device)
+ {
+ #ifdef UTEMPTER_DEBUG
diff --git a/sysutils/libutempter/pkg-descr b/sysutils/libutempter/pkg-descr
new file mode 100644
index 000000000000..78235d39adaa
--- /dev/null
+++ b/sysutils/libutempter/pkg-descr
@@ -0,0 +1,12 @@
+The libutempter library provides interface for terminal emulators such as
+screen and xterm to record user sessions to utmp and wtmp files.
+
+The utempter is a privileged helper used by libutempter library to manipulate
+utmp and wtmp files.
+
+This implementation is based on ideas of RedHat's utempter by Erik Troan
+(version 0.5.2 at the moment of writing).
+
+There are two interfaces supported: old and new.
+New API is recommended for new applications, old - for compatibility with
+old software.
diff --git a/sysutils/libutempter/pkg-plist b/sysutils/libutempter/pkg-plist
new file mode 100644
index 000000000000..c52e0300e9da
--- /dev/null
+++ b/sysutils/libutempter/pkg-plist
@@ -0,0 +1,7 @@
+include/utempter.h
+lib/libutempter.a
+lib/libutempter.so
+lib/libutempter.so.0
+lib/libutempter.so.1.1.1
+libexec/utempter/utempter
+@dirrm libexec/utempter