mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-04 20:06:43 +02:00
testing/gdm: new aport
This commit is contained in:
parent
847eca8ecc
commit
f25f0efdfc
@ -0,0 +1,151 @@
|
||||
From 4d25e3bbd9e22a4db5dfb3c9267f0336761ea904 Mon Sep 17 00:00:00 2001
|
||||
From: William Pitcock <nenolod@dereferenced.org>
|
||||
Date: Tue, 6 Jun 2017 00:23:34 +0000
|
||||
Subject: [PATCH 1/3] gdm-session-record: alpine does not have utmp
|
||||
|
||||
---
|
||||
daemon/gdm-session-record.c | 100 ++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 96 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session-record.c b/daemon/gdm-session-record.c
|
||||
index 32933ef0..3154df2e 100644
|
||||
--- a/daemon/gdm-session-record.c
|
||||
+++ b/daemon/gdm-session-record.c
|
||||
@@ -33,6 +33,16 @@
|
||||
#include <utmp.h>
|
||||
#endif
|
||||
|
||||
+#if defined(HAVE_UTIL_H)
|
||||
+#include <util.h>
|
||||
+#endif
|
||||
+
|
||||
+#if defined(HAVE_GETTTYENT)
|
||||
+#include <fcntl.h> /* open(2) */
|
||||
+#include <ttyent.h>
|
||||
+static int fd = -1;
|
||||
+#endif
|
||||
+
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <glib/gstdio.h>
|
||||
@@ -43,6 +53,9 @@
|
||||
#define GDM_BAD_SESSION_RECORDS_FILE "/var/log/btmp"
|
||||
#endif
|
||||
|
||||
+static void write_utmp_login_manually (struct utmp *ut);
|
||||
+static void write_utmp_logout_manually (char *);
|
||||
+
|
||||
#if !defined(GDM_NEW_SESSION_RECORDS_FILE)
|
||||
# if defined(WTMPX_FILE)
|
||||
# define GDM_NEW_SESSION_RECORDS_FILE WTMPX_FILE
|
||||
@@ -183,6 +196,84 @@ record_set_line (UTMP *u,
|
||||
g_debug ("using ut_line %.*s", (int) sizeof (u->ut_line), u->ut_line);
|
||||
}
|
||||
|
||||
+static void
|
||||
+write_utmp_login_manually (struct utmp *ut)
|
||||
+{
|
||||
+#if defined(HAVE_GETTTYENT) && defined(HAVE_UTMP_H)
|
||||
+ UTMP ubuf;
|
||||
+ int topslot = -1;
|
||||
+
|
||||
+ g_debug ("Adding new utmp record");
|
||||
+
|
||||
+ /*
|
||||
+ * First, loop through /etc/ttys, if needed, to initialize the
|
||||
+ * top of the tty slots, since gdm has no tty.
|
||||
+ */
|
||||
+ if (topslot < 0) {
|
||||
+ topslot = 0;
|
||||
+ while (getttyent () != (struct ttyent *) NULL)
|
||||
+ topslot++;
|
||||
+ }
|
||||
+ if ((topslot < 0) || ((fd < 0) &&
|
||||
+ (fd = open (_PATH_UTMP, O_RDWR|O_CREAT, 0644)) < 0))
|
||||
+ return;
|
||||
+
|
||||
+ /*
|
||||
+ * Now find a slot that's not in use...
|
||||
+ */
|
||||
+ (void) lseek (fd, (off_t) (topslot * sizeof (struct utmp)), SEEK_SET);
|
||||
+
|
||||
+ while (1) {
|
||||
+ if (read (fd, &ubuf, sizeof (struct utmp)) ==
|
||||
+ sizeof (struct utmp)) {
|
||||
+ if (!ubuf.ut_name[0]) {
|
||||
+ (void) lseek (fd, -(off_t) sizeof (struct utmp),
|
||||
+ SEEK_CUR);
|
||||
+ break;
|
||||
+ }
|
||||
+ topslot++;
|
||||
+ } else {
|
||||
+ (void) lseek (fd, (off_t) (topslot *
|
||||
+ sizeof (struct utmp)), SEEK_SET);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ (void) write (fd, ut, sizeof (struct utmp));
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+write_utmp_logout_manually (char *line)
|
||||
+{
|
||||
+#if defined(HAVE_GETTTYENT) && defined(HAVE_UTMP_H)
|
||||
+ int rval = 1;
|
||||
+ struct timeval tv;
|
||||
+ UTMP ut;
|
||||
+
|
||||
+ g_debug ("Removing utmp record");
|
||||
+
|
||||
+ if (fd >= 0) {
|
||||
+ (void) lseek (fd, 0, SEEK_SET);
|
||||
+ while (read (fd, &ut, sizeof (struct utmp)) == sizeof (struct utmp)) {
|
||||
+ if (!ut.ut_name[0] ||
|
||||
+ strncmp (ut.ut_line, line, UT_LINESIZE))
|
||||
+ continue;
|
||||
+ bzero (ut.ut_name, UT_NAMESIZE);
|
||||
+ bzero (ut.ut_host, UT_HOSTSIZE);
|
||||
+ gettimeofday (&tv, NULL);
|
||||
+ ut.ut_time = tv.tv_sec;
|
||||
+ (void) lseek (fd, -(off_t) sizeof (struct utmp), SEEK_CUR);
|
||||
+ (void) write (fd, &ut, sizeof (struct utmp));
|
||||
+ rval = 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (rval != 0)
|
||||
+ g_debug ("Failed to remove utmp record");
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
void
|
||||
gdm_session_record_login (GPid session_pid,
|
||||
const char *user_name,
|
||||
@@ -227,8 +318,9 @@ gdm_session_record_login (GPid session_pid,
|
||||
#if defined(HAVE_GETUTXENT)
|
||||
g_debug ("Adding or updating utmp record for login");
|
||||
pututxline (&session_record);
|
||||
-#elif defined(HAVE_LOGIN)
|
||||
- login (&session_record);
|
||||
+#else
|
||||
+ if (strcmp (session_record.ut_name, "(unknown)") != 0)
|
||||
+ write_utmp_login_manually (&session_record);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -270,8 +362,8 @@ gdm_session_record_logout (GPid session_pid,
|
||||
#if defined(HAVE_GETUTXENT)
|
||||
g_debug ("Adding or updating utmp record for logout");
|
||||
pututxline (&session_record);
|
||||
-#elif defined(HAVE_LOGOUT)
|
||||
- logout (session_record.ut_line);
|
||||
+#else
|
||||
+ write_utmp_logout_manually (session_record.ut_line);
|
||||
#endif
|
||||
}
|
||||
|
||||
--
|
||||
2.13.0
|
||||
|
||||
42
testing/gdm/0002-configure-Alpine-does-not-use-PAM.patch
Normal file
42
testing/gdm/0002-configure-Alpine-does-not-use-PAM.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From 7500e98c4794413f3e78c712147f5f35962d6c6d Mon Sep 17 00:00:00 2001
|
||||
From: William Pitcock <nenolod@dereferenced.org>
|
||||
Date: Tue, 6 Jun 2017 00:27:22 +0000
|
||||
Subject: [PATCH 2/3] configure: Alpine does not use PAM.
|
||||
|
||||
---
|
||||
Makefile.am | 1 -
|
||||
configure.ac | 6 ------
|
||||
2 files changed, 7 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index d3c46c8f..aa527219 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -6,7 +6,6 @@ SUBDIRS = \
|
||||
daemon \
|
||||
libgdm \
|
||||
utils \
|
||||
- pam_gdm \
|
||||
po \
|
||||
tests \
|
||||
$(NULL)
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e8434d78..602969bd 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -232,12 +232,6 @@ AM_CONDITIONAL(ENABLE_EXHERBO_PAM_CONFIG, test x$with_default_pam_config = xexhe
|
||||
AM_CONDITIONAL(ENABLE_LFS_PAM_CONFIG, test x$with_default_pam_config = xlfs)
|
||||
AM_CONDITIONAL(ENABLE_ARCH_PAM_CONFIG, test x$with_default_pam_config = xarch)
|
||||
|
||||
-AC_CHECK_HEADERS([security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
|
||||
- [have_pam=yes],
|
||||
- [if test "x$have_pam" = xyes ; then
|
||||
- AC_MSG_ERROR([PAM development files not found.])
|
||||
- fi])
|
||||
-
|
||||
AC_ARG_ENABLE(console-helper,
|
||||
AS_HELP_STRING([--enable-console-helper],
|
||||
[Enable PAM console helper @<:@default=auto@:>@]),,
|
||||
--
|
||||
2.13.0
|
||||
|
||||
2816
testing/gdm/0003-reintroduce-ConsoleKit-support.patch
Normal file
2816
testing/gdm/0003-reintroduce-ConsoleKit-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
50
testing/gdm/APKBUILD
Normal file
50
testing/gdm/APKBUILD
Normal file
@ -0,0 +1,50 @@
|
||||
# Maintainer: William Pitcock <nenolod@dereferenced.org>
|
||||
pkgname=gdm
|
||||
pkgver=3.24.2
|
||||
pkgrel=0
|
||||
pkgdesc="GNOME display manager"
|
||||
url="https://wiki.gnome.org/Projects/GDM"
|
||||
arch="all"
|
||||
license="GPL"
|
||||
depends="dconf"
|
||||
depends_dev=""
|
||||
makedepends="dconf-dev gnome-desktop-dev accountsservice-dev libcanberra-dev intltool itstool libxml2-utils consolekit-dev linux-pam-dev autoconf automake libtool $depends_dev"
|
||||
install=""
|
||||
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
|
||||
source="http://ftp.gnome.org/pub/GNOME/sources/gdm/${pkgver%.*}/gdm-$pkgver.tar.xz
|
||||
0001-gdm-session-record-alpine-does-not-have-utmp.patch
|
||||
0002-configure-Alpine-does-not-use-PAM.patch
|
||||
0003-reintroduce-ConsoleKit-support.patch"
|
||||
builddir="$srcdir/gdm-$pkgver"
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
autoreconf
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
./configure \
|
||||
--build=$CBUILD \
|
||||
--host=$CHOST \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--mandir=/usr/share/man \
|
||||
--localstatedir=/var \
|
||||
--without-systemd \
|
||||
--without-plymouth \
|
||||
--disable-systemd-journal \
|
||||
--with-console-kit \
|
||||
--with-pid-file=/var/run/gdm.pid
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
sha512sums="6e2649bce5520532a2976bac8a47629fc4c852d7127b913c29a9c43a7dba26d75472a083cbfff7b64bab56deb38ed13d8387d4d302d55f263c80120255a4a270 gdm-3.24.2.tar.xz
|
||||
57ced6bf01ec45a0ab6147cd5235230c6e75f10b25c50bd046b6cec1668fa03db93404185394d61a83d5f144d325de36f9b62ebdfa67dcdda91757c1711852c3 0001-gdm-session-record-alpine-does-not-have-utmp.patch
|
||||
6b75dde1370aa03de1f6c47d2a3fd07610392d8e82e94128be0af7eb06be01b7c365d6c406b77ca7c239a80d086f247c6693e8398d9196ab104b237892346598 0002-configure-Alpine-does-not-use-PAM.patch
|
||||
b94ab78874ef7cfe67cc5dc6c9c4fbc746c1c83e7c44199c4d9a500ec4b042fd4aac767e7bb84070da31959ed80c7c79b6095546d3e71559dc8c4319df716f55 0003-reintroduce-ConsoleKit-support.patch"
|
||||
Loading…
x
Reference in New Issue
Block a user