1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00
freebsd-ports/sysutils/runit/files/patch-utmpx
Boris Samorodov 55452e601a - Unbreak on CURRENT;
- Pass maintainership from ports@ to submitter;
- Remove utmp code if utmpx is present;
- Handle configuration files correctly;
- Use ETCDIR;
- Remove empty REQUIRE line from runsvdir.sh.in.

PR:		ports/157298
Submitted by:	Chris Rees <utisoft@gmail.com>
2011-05-27 15:26:01 +00:00

97 lines
2.3 KiB
Plaintext

$FreeBSD$
Since init lacks this code in FreeBSD (utx-logout is performed in pam_lastlog)
we will simply make utmpset.c a noop if utmpx is present.
http://lists.freebsd.org/pipermail/freebsd-ports/2011-May/067872.html
diff -ruN ../runit-2.0.0.orig/src/tryuwtmpx.c ./src/tryuwtmpx.c
--- ../runit-2.0.0.orig/src/tryuwtmpx.c 2008-06-15 21:53:26.000000000 +0100
+++ ./src/tryuwtmpx.c 2011-05-21 21:47:36.834727936 +0100
@@ -1,9 +1,9 @@
#include <sys/types.h>
#include <utmpx.h>
-struct futmpx ut;
+struct utmpx ut;
int main(void) {
- char *s =ut.ut_name;
+ char *s =ut.ut_user;
return(0);
}
diff -ruN ../runit-2.0.0.orig/src/utmpset.c ./src/utmpset.c
--- ../runit-2.0.0.orig/src/utmpset.c 2008-06-15 21:53:26.000000000 +0100
+++ ./src/utmpset.c 2011-05-24 19:11:50.186633061 +0100
@@ -22,6 +22,11 @@
void usage(void) { strerr_die4x(1, "usage: ", progname, USAGE, "\n"); }
int utmp_logout(const char *line) {
+
+#ifdef _UW_TMP_UTMPX
+ int ok = 1; /* do_nada(); */
+#else /* _UW_TMP_UTMP */
+
int fd;
uw_tmp ut;
int ok =-1;
@@ -45,9 +50,13 @@
break;
}
close(fd);
+#endif /* _UW_TMP_UTMPX */
return(ok);
}
int wtmp_logout(const char *line) {
+#ifdef _UW_TMP_UTMPX
+ return 1; /* do_nada(); */
+#else /* _UW_TMP_UTMP */
int fd;
int len;
struct stat st;
@@ -79,6 +88,7 @@
}
close(fd);
return(1);
+#endif /* _UW_TMP_UTMPX */
}
int main (int argc, const char * const *argv, const char * const *envp) {
diff -ruN ../runit-2.0.0.orig/src/uw_tmp.h1 ./src/uw_tmp.h1
--- ../runit-2.0.0.orig/src/uw_tmp.h1 2008-06-15 21:53:26.000000000 +0100
+++ ./src/uw_tmp.h1 2011-05-24 19:12:55.575957224 +0100
@@ -3,6 +3,8 @@
/* sysdep: -utmpx */
+#ifndef _UW_TMP_UTMP
+#define _UW_TMP_UTMP
#ifdef _PATH_UTMP
#define UW_TMP_UFILE _PATH_UTMP
#define UW_TMP_WFILE _PATH_WTMP
@@ -17,3 +19,4 @@
#endif
typedef struct utmp uw_tmp;
+#endif /* _UW_TMP_UTMP */
diff -ruN ../runit-2.0.0.orig/src/uw_tmp.h2 ./src/uw_tmp.h2
--- ../runit-2.0.0.orig/src/uw_tmp.h2 2008-06-15 21:53:26.000000000 +0100
+++ ./src/uw_tmp.h2 2011-05-24 19:13:16.542222974 +0100
@@ -3,11 +3,12 @@
/* sysdep: +utmpx */
-#define UW_TMP_UFILE _UTMPX_FILE
-#define UW_TMP_WFILE _WTMPX_FILE
-
+#ifndef _UW_TMP_UTMPX
+#define _UW_TMP_UTMPX
#ifndef ut_time
#define ut_time ut_tv.tv_sec
#endif
-typedef struct futmpx uw_tmp;
+typedef struct utmpx uw_tmp;
+
+#endif /* _UW_TMP_UTMPX */