pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
consolekit: Remove obsolete package.
Module Name: pkgsrc-wip
Committed By: youri <youri%NetBSD.org@localhost>
Pushed By: youri
Date: Mon Jun 6 22:38:34 2016 +0200
Changeset: 9e7c6e27aebfa73bea401491abb8f8ae400c476f
Removed Files:
consolekit/DESCR
consolekit/Makefile
consolekit/PLIST
consolekit/buildlink3.mk
consolekit/distinfo
consolekit/files/ck-get-x11-display-device.FreeBSD
consolekit/files/ck-get-x11-server-pid.FreeBSD
consolekit/files/ck-sysdeps-netbsd.c
consolekit/files/ck-sysdeps-openbsd.c
consolekit/options.mk
consolekit/patches/patch-aa
consolekit/patches/patch-ab
consolekit/patches/patch-ac
consolekit/patches/patch-ad
consolekit/patches/patch-ae
consolekit/patches/patch-af
consolekit/patches/patch-src_ck-manager.c
consolekit/patches/patch-tools_ck-collect-session-info.c
consolekit/patches/patch-tools_ck-history.c
consolekit/patches/patch-tools_ck-log-system-start.c
Log Message:
consolekit: Remove obsolete package.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=9e7c6e27aebfa73bea401491abb8f8ae400c476f
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
consolekit/DESCR | 4 -
consolekit/Makefile | 69 ---
consolekit/PLIST | 25 --
consolekit/buildlink3.mk | 16 -
consolekit/distinfo | 15 -
consolekit/files/ck-get-x11-display-device.FreeBSD | 35 --
consolekit/files/ck-get-x11-server-pid.FreeBSD | 17 -
consolekit/files/ck-sysdeps-netbsd.c | 450 --------------------
consolekit/files/ck-sysdeps-openbsd.c | 471 ---------------------
consolekit/options.mk | 18 -
consolekit/patches/patch-aa | 38 --
consolekit/patches/patch-ab | 32 --
consolekit/patches/patch-ac | 21 -
consolekit/patches/patch-ad | 18 -
consolekit/patches/patch-ae | 127 ------
consolekit/patches/patch-af | 231 ----------
consolekit/patches/patch-src_ck-manager.c | 207 ---------
.../patches/patch-tools_ck-collect-session-info.c | 32 --
consolekit/patches/patch-tools_ck-history.c | 79 ----
.../patches/patch-tools_ck-log-system-start.c | 34 --
20 files changed, 1939 deletions(-)
diffs:
diff --git a/consolekit/DESCR b/consolekit/DESCR
deleted file mode 100644
index f8b1442..0000000
--- a/consolekit/DESCR
+++ /dev/null
@@ -1,4 +0,0 @@
-ConsoleKit is a framework for keeping track of the various users, sessions,
-and seats present on a system. It provides a mechanism for software to react
-to changes of any of these items or of any of the metadata associated with
-them.
diff --git a/consolekit/Makefile b/consolekit/Makefile
deleted file mode 100644
index 5950cf7..0000000
--- a/consolekit/Makefile
+++ /dev/null
@@ -1,69 +0,0 @@
-# $NetBSD: Makefile,v 1.5 2015/04/09 13:56:04 krytarowski Exp $
-
-DISTNAME= ConsoleKit-0.4.5
-PKGNAME= ${DISTNAME:tl}
-PKGREVISION= 1
-CATEGORIES= sysutils
-MASTER_SITES= http://www.freedesktop.org/software/ConsoleKit/dist/
-EXTRACT_SUFX= .tar.bz2
-
-MAINTAINER= pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE= http://www.freedesktop.org/wiki/Software/ConsoleKit
-COMMENT= Framework for defining and tracking users, login sessions, and seats
-LICENSE= gnu-gpl-v2
-
-PKG_SYSCONFSUBDIR= ConsoleKit
-
-EGDIR= ${PREFIX}/share/examples/consolekit
-CONF_FILES+= ${EGDIR}/00-primary.seat ${PKG_SYSCONFDIR}/seats.d/00-primary.seat
-CONF_FILES+= ${EGDIR}/ConsoleKit.conf ${PKG_SYSCONFBASE}/dbus-1/system.d/ConsoleKit.conf
-
-OWN_DIRS+= ${PREFIX}/lib/ConsoleKit/run-session.d
-OWN_DIRS+= ${PREFIX}/lib/ConsoleKit/run-seat.d
-OWN_DIRS+= ${PKG_SYSCONFDIR}/seats.d
-OWN_DIRS+= ${PKG_SYSCONFDIR}/run-seat.d
-
-BUILD_DEFS+= VARBASE
-BUILD_DEFS+= PKG_SYSCONFBASE
-
-GNU_CONFIGURE= YES
-USE_PKGLOCALEDIR= YES
-USE_TOOLS+= gmake intltool msgfmt perl pkg-config gettext-m4
-USE_TOOLS+= autoconf automake autoreconf
-USE_LIBTOOL= YES
-
-CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASE:Q}
-CONFIGURE_ARGS+= --localstatedir=${VARBASE}
-
-.include "options.mk"
-
-post-extract:
- ${CP} ${FILESDIR}/ck-sysdeps-netbsd.c ${WRKSRC}/src/
- ${CP} ${FILESDIR}/ck-sysdeps-openbsd.c ${WRKSRC}/src/
-
-pre-configure:
- cd ${WRKSRC} && autoreconf -vi ${AUTORECONF_ARGS}
-
-.include "../../mk/bsd.prefs.mk"
-.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
-post-install:
- ${INSTALL_SCRIPT} ${FILESDIR}/ck-get-x11-display-device.FreeBSD \
- ${DESTDIR}${PREFIX}/libexec/ck-get-x11-display-device
- ${INSTALL_SCRIPT} ${FILESDIR}/ck-get-x11-server-pid.FreeBSD \
- ${DESTDIR}${PREFIX}/libexec/ck-get-x11-server-pid
-.endif
-
-.if ${OPSYS} == "SunOS"
-CONFIGURE_ARGS+= --enable-rbac-shutdown=solaris.system.shutdown
-.endif
-
-OWN_DIRS+= ${VARBASE}/log/ConsoleKit
-CONF_FILES+= /dev/null ${VARBASE}/log/ConsoleKit/history
-
-.include "../../devel/zlib/buildlink3.mk"
-.include "../../security/polkit/buildlink3.mk"
-.include "../../sysutils/dbus/buildlink3.mk"
-.include "../../sysutils/dbus-glib/buildlink3.mk"
-.include "../../x11/libX11/buildlink3.mk"
-.include "../../mk/pam.buildlink3.mk"
-.include "../../mk/bsd.pkg.mk"
diff --git a/consolekit/PLIST b/consolekit/PLIST
deleted file mode 100644
index 10bd6d7..0000000
--- a/consolekit/PLIST
+++ /dev/null
@@ -1,25 +0,0 @@
-@comment $NetBSD: PLIST,v 1.5 2015/04/09 13:56:04 krytarowski Exp $
-bin/ck-history
-bin/ck-launch-session
-bin/ck-list-sessions
-include/ConsoleKit/ck-connector/ck-connector.h
-lib/ConsoleKit/scripts/ck-system-restart
-lib/ConsoleKit/scripts/ck-system-stop
-lib/libck-connector.la
-lib/pkgconfig/ck-connector.pc
-${PLIST.pam}lib/security/pam_ck_connector.la
-libexec/ck-collect-session-info
-libexec/ck-get-x11-display-device
-libexec/ck-get-x11-server-pid
-${PLIST.pam}man/man8/pam_ck_connector.8
-sbin/ck-log-system-restart
-sbin/ck-log-system-start
-sbin/ck-log-system-stop
-sbin/console-kit-daemon
-share/dbus-1/interfaces/org.freedesktop.ConsoleKit.Manager.xml
-share/dbus-1/interfaces/org.freedesktop.ConsoleKit.Seat.xml
-share/dbus-1/interfaces/org.freedesktop.ConsoleKit.Session.xml
-share/dbus-1/system-services/org.freedesktop.ConsoleKit.service
-share/examples/consolekit/00-primary.seat
-share/examples/consolekit/ConsoleKit.conf
-share/polkit-1/actions/org.freedesktop.consolekit.policy
diff --git a/consolekit/buildlink3.mk b/consolekit/buildlink3.mk
deleted file mode 100644
index a382d91..0000000
--- a/consolekit/buildlink3.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# $NetBSD: buildlink3.mk,v 1.3 2015/04/09 13:56:04 krytarowski Exp $
-
-BUILDLINK_TREE+= consolekit
-
-.if !defined(CONSOLEKIT_BUILDLINK3_MK)
-CONSOLEKIT_BUILDLINK3_MK:=
-
-BUILDLINK_API_DEPENDS.consolekit+= consolekit>=0.3.0
-BUILDLINK_ABI_DEPENDS.consolekit+= consolekit>=0.3.0nb9
-BUILDLINK_PKGSRCDIR.consolekit?= ../../sysutils/consolekit
-
-.include "../../sysutils/dbus/buildlink3.mk"
-.include "../../sysutils/dbus-glib/buildlink3.mk"
-.endif # CONSOLEKIT_BUILDLINK3_MK
-
-BUILDLINK_TREE+= -consolekit
diff --git a/consolekit/distinfo b/consolekit/distinfo
deleted file mode 100644
index 4278891..0000000
--- a/consolekit/distinfo
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: distinfo,v 1.6 2015/04/09 13:56:04 krytarowski Exp $
-
-SHA1 (ConsoleKit-0.4.5.tar.bz2) = 6f090c1ce0d459dd6904854532554323755bdeca
-RMD160 (ConsoleKit-0.4.5.tar.bz2) = 2eba158e321778a4c17bf765d0106d214b93fe53
-Size (ConsoleKit-0.4.5.tar.bz2) = 425423 bytes
-SHA1 (patch-aa) = baafe5aa4c99279d85edb0e4bc76491e80314950
-SHA1 (patch-ab) = 24036207cc59ccd97f8ed9a53cc588ff94b8c2fe
-SHA1 (patch-ac) = 3ef09f16ee039da7cea0c020c2aeccfe5d88c57c
-SHA1 (patch-ad) = c0cf170a85e04e2dadfd490f303a40e8d62cc626
-SHA1 (patch-ae) = dcb689861f8ee425b94a8acf1cb344a782b4328b
-SHA1 (patch-af) = 9c7febd3a1e995060e5755b205c5d4a7217bc1b8
-SHA1 (patch-src_ck-manager.c) = 884263af0dbacfb27132ec2cedb6bb6cf1382891
-SHA1 (patch-tools_ck-collect-session-info.c) = 15e310b8278269371002e3392983792c74463e00
-SHA1 (patch-tools_ck-history.c) = 58f2244b5f09645f16b0f00e1173e7a2784034c0
-SHA1 (patch-tools_ck-log-system-start.c) = 916e529bfcc454ac1b00a3e360527332ebea326b
diff --git a/consolekit/files/ck-get-x11-display-device.FreeBSD b/consolekit/files/ck-get-x11-display-device.FreeBSD
deleted file mode 100644
index 6fc5083..0000000
--- a/consolekit/files/ck-get-x11-display-device.FreeBSD
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-FSTAT="/usr/bin/fstat"
-GREP="/usr/bin/grep"
-AWK="/usr/bin/awk"
-SED="/usr/bin/sed"
-CAT="/bin/cat"
-HEAD="/usr/bin/head"
-
-dispnum=0
-if [ x"$1" = x"--display" ]; then
- if [ $# != 2 ]; then
- echo "usage: $0 [--display DISPLAY]"
- exit 1
- fi
- DISPLAY=$2
-fi
-if [ ! -z "${DISPLAY}" ]; then
- dispnum=$(echo ${DISPLAY} | ${SED} -E -e 's|:([0-9]+).*|\1|')
-fi
-
-if [ ! -f "/tmp/.X${dispnum}-lock" ]; then
- echo "ERROR: Failed to find X lock file for display ${dispnum}"
- exit 1
-fi
-pid=$(${CAT} "/tmp/.X${dispnum}-lock")
-
-device=$(${FSTAT} -p ${pid} | ${GREP} ttyv | ${HEAD} -1 | ${AWK} '{print $8}')
-
-if [ -z "${device}" ]; then
- echo "ERROR: Failed to find TTY device for X server on display ${dispnum}"
- exit 1
-fi
-
-echo "/dev/${device}"
diff --git a/consolekit/files/ck-get-x11-server-pid.FreeBSD b/consolekit/files/ck-get-x11-server-pid.FreeBSD
deleted file mode 100644
index 05c433e..0000000
--- a/consolekit/files/ck-get-x11-server-pid.FreeBSD
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-SED="/usr/bin/sed"
-CAT="/bin/cat"
-
-dispnum=0
-if [ ! -z "${DISPLAY}" ]; then
- dispnum=$(echo ${DISPLAY} | ${SED} -E -e 's|:([0-9]+).*|\1|')
-fi
-
-if [ ! -f "/tmp/.X${dispnum}-lock" ]; then
- echo "ERROR: Failed to find X lock file for display ${dispnum}"
- exit 1
-fi
-pid=$(${CAT} "/tmp/.X${dispnum}-lock")
-
-echo ${pid}
diff --git a/consolekit/files/ck-sysdeps-netbsd.c b/consolekit/files/ck-sysdeps-netbsd.c
deleted file mode 100644
index f7c6ee0..0000000
--- a/consolekit/files/ck-sysdeps-netbsd.c
+++ /dev/null
@@ -1,450 +0,0 @@
-/* $NetBSD: ck-sysdeps-netbsd.c,v 1.3 2015/04/09 13:56:04 krytarowski Exp $ */
-
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2006 William Jon McCann <mccann%jhu.edu@localhost>
- * Copyright (C) 2007 Joe Marcus Clarke <marcus%FreeBSD.org@localhost>
- * Copyright (C) 2008 Jared D. McNeill <jmcneill%NetBSD.org@localhost>
- * Copyright (C) 2009 Robert Nagy <robert%openbsd.org@localhost>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <paths.h>
-#include <ttyent.h>
-#include <kvm.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-
-#include <dev/wscons/wsdisplay_usl_io.h>
-
-#define DEV_ENCODE(M,m) ( \
- ( (M&0xfff) << 8) | ( (m&0xfff00) << 12) | (m&0xff) \
-)
-
-#include "ck-sysdeps.h"
-
-#ifndef ERROR
-#define ERROR -1
-#endif
-
-/* adapted from procps */
-struct _CkProcessStat
-{
- int pid;
- int ppid; /* stat,status pid of parent process */
- char state; /* stat,status single-char code for process state (S=sleeping) */
- char cmd[16]; /* stat,status basename of executable file in call to exec(2) */
- unsigned long long utime; /* stat user-mode CPU time accumulated by process */
- unsigned long long stime; /* stat kernel-mode CPU time accumulated by process */
- unsigned long long cutime; /* stat cumulative utime of process and reaped children */
- unsigned long long cstime; /* stat cumulative stime of process and reaped children */
- unsigned long long start_time; /* stat start time of process -- seconds since 1-1-70 */
- unsigned long start_code; /* stat address of beginning of code segment */
- unsigned long end_code; /* stat address of end of code segment */
- unsigned long start_stack; /* stat address of the bottom of stack for the process */
- unsigned long kstk_esp; /* stat kernel stack pointer */
- unsigned long kstk_eip; /* stat kernel instruction pointer */
- unsigned long wchan; /* stat (special) address of kernel wait channel proc is sleeping in */
- long priority; /* stat kernel scheduling priority */
- long nice; /* stat standard unix nice level of process */
- long rss; /* stat resident set size from /proc/#/stat (pages) */
- long alarm; /* stat ? */
- unsigned long rtprio; /* stat real-time priority */
- unsigned long sched; /* stat scheduling class */
- unsigned long vsize; /* stat number of pages of virtual memory ... */
- unsigned long rss_rlim; /* stat resident set size limit? */
- unsigned long flags; /* stat kernel flags for the process */
- unsigned long min_flt; /* stat number of minor page faults since process start */
- unsigned long maj_flt; /* stat number of major page faults since process start */
- unsigned long cmin_flt; /* stat cumulative min_flt of process and child processes */
- unsigned long cmaj_flt; /* stat cumulative maj_flt of process and child processes */
- int pgrp; /* stat process group id */
- int session; /* stat session id */
- int nlwp; /* stat number of threads, or 0 if no clue */
- int tty; /* stat full device number of controlling terminal */
- int tpgid; /* stat terminal process group id */
- int exit_signal; /* stat might not be SIGCHLD */
- int processor; /* stat current (or most recent?) CPU */
- uintptr_t penv; /* stat address of initial environment vector */
- char tty_text[16]; /* stat device name */
-
-};
-
-pid_t
-ck_process_stat_get_ppid (CkProcessStat *stat)
-{
- g_return_val_if_fail (stat != NULL, -1);
-
- return stat->ppid;
-}
-
-char *
-ck_process_stat_get_cmd (CkProcessStat *stat)
-{
- g_return_val_if_fail (stat != NULL, NULL);
-
- return g_strdup (stat->cmd);
-}
-
-char *
-ck_process_stat_get_tty (CkProcessStat *stat)
-{
- g_return_val_if_fail (stat != NULL, NULL);
-
- return g_strdup (stat->tty_text);
-}
-
-static gboolean
-get_kinfo_proc (pid_t pid,
- struct kinfo_proc2 *p)
-{
- int name[6];
- u_int namelen;
- size_t sz;
-
- sz = sizeof(*p);
- namelen = 0;
- name[namelen++] = CTL_KERN;
- name[namelen++] = KERN_PROC2;
- name[namelen++] = KERN_PROC_PID;
- name[namelen++] = pid;
- name[namelen++] = sz;
- name[namelen++] = 1;
-
- if (sysctl (name, namelen, p, &sz, NULL, 0) == -1) {
- perror("sysctl kern.proc2.pid");
- return FALSE;
- }
-
- return TRUE;
-}
-
-/* return 1 if it works, or 0 for failure */
-static gboolean
-stat2proc (pid_t pid,
- CkProcessStat *P)
-{
- struct kinfo_proc2 p;
- char *ttname;
- int num;
- int tty_maj;
- int tty_min;
-
- if (! get_kinfo_proc (pid, &p)) {
- return FALSE;
- }
-
- num = KI_MAXCOMLEN;
- if (num >= sizeof(P->cmd)) {
- num = sizeof(P->cmd) - 1;
- }
-
- memcpy (P->cmd, p.p_comm, num);
-
- P->cmd[num] = '\0';
- P->pid = p.p_pid;
- P->ppid = p.p_ppid;
- P->pgrp = p.p__pgid;
- P->session = p.p_sid;
- P->rss = p.p_vm_rssize;
- P->vsize = p.p_vm_dsize + p.p_vm_dsize + p.p_vm_ssize; /* XXX */
- P->start_time = p.p_ustart_sec;
- P->wchan = (unsigned long) p.p_wchan;
- P->state = p.p_stat;
- P->nice = p.p_nice;
- P->flags = p.p_realflag;
- P->tpgid = p.p_tpgid;
- P->processor = p.p_cpuid;
- P->nlwp = p.p_nlwps;
-
- /* we like it Linux-encoded :-) */
- tty_maj = major (p.p_tdev);
- tty_min = minor (p.p_tdev);
- P->tty = DEV_ENCODE (tty_maj,tty_min);
-
- snprintf (P->tty_text, sizeof(P->tty_text), "%3d,%-3d", tty_maj, tty_min);
-
- if (p.p_tdev != NODEV && (ttname = devname (p.p_tdev, S_IFCHR)) != NULL) {
- memcpy (P->tty_text, ttname, sizeof(P->tty_text));
- }
-
- if (p.p_tdev == NODEV) {
- /* XXXJDM nasty hack */
- memcpy (P->tty_text, "/dev/ttyE4", sizeof(P->tty_text));
- }
-
- if (P->pid != pid) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-gboolean
-ck_process_stat_new_for_unix_pid (pid_t pid,
- CkProcessStat **stat,
- GError **error)
-{
- gboolean res;
- CkProcessStat *proc;
-
- g_return_val_if_fail (pid > 1, FALSE);
-
- if (stat == NULL) {
- return FALSE;
- }
-
- proc = g_new0 (CkProcessStat, 1);
- proc->pid = pid;
- res = stat2proc (pid, proc);
- if (res) {
- *stat = proc;
- } else {
- *stat = NULL;
- }
-
- return res;
-}
-
-void
-ck_process_stat_free (CkProcessStat *stat)
-{
- g_free (stat);
-}
-
-GHashTable *
-ck_unix_pid_get_env_hash (pid_t pid)
-{
- GHashTable *hash = NULL;
- char **penv;
- char errbuf[_POSIX2_LINE_MAX];
- kvm_t *kd;
- struct kinfo_proc2 p;
- int i;
-
- kd = kvm_openfiles (_PATH_DEVNULL, _PATH_DEVNULL, NULL, O_RDONLY, errbuf);
- if (kd == NULL) {
- g_warning ("kvm_openfiles failed: %s", errbuf);
- return NULL;
- }
-
- if (! get_kinfo_proc (pid, &p)) {
- g_warning ("get_kinfo_proc failed: %s", g_strerror (errno));
- goto fail;
- }
-
- penv = kvm_getenvv2 (kd, &p, 0);
- if (penv == NULL) {
- g_warning ("kvm_getenvv2 failed: %s", g_strerror (errno));
- goto fail;
- }
-
- hash = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- g_free);
-
- for (i = 0; penv[i] != NULL; i++) {
- char **vals;
-
- if (!penv[i][0]) continue;
-
- vals = g_strsplit (penv[i], "=", 2);
- if (vals != NULL) {
- g_hash_table_insert (hash,
- g_strdup (vals[0]),
- g_strdup (vals[1]));
- g_strfreev (vals);
- }
- }
-
-fail:
- kvm_close (kd);
-
- return hash;
-}
-
-char *
-ck_unix_pid_get_env (pid_t pid,
- const char *var)
-{
- GHashTable *hash;
- char *val = NULL;
-
- /*
- * Would probably be more efficient to just loop through the
- * environment and return the value, avoiding building the hash
- * table, but this works for now.
- */
- hash = ck_unix_pid_get_env_hash (pid);
- if (hash == NULL)
- return val;
- val = g_strdup (g_hash_table_lookup (hash, var));
- g_hash_table_destroy (hash);
-
- return val;
-}
-
-uid_t
-ck_unix_pid_get_uid (pid_t pid)
-{
- uid_t uid;
- gboolean res;
- struct kinfo_proc2 p;
-
- g_return_val_if_fail (pid > 1, 0);
-
- uid = -1;
-
- res = get_kinfo_proc (pid, &p);
-
- if (res) {
- uid = p.p_uid;
- }
-
- return uid;
-}
-
-gboolean
-ck_unix_pid_get_login_session_id (pid_t pid,
- char **idp)
-{
- g_return_val_if_fail (pid > 1, FALSE);
-
- return FALSE;
-}
-
-gboolean
-ck_get_max_num_consoles (guint *num)
-{
- int max_consoles;
- int res;
- gboolean ret;
- struct ttyent *t;
-
- ret = FALSE;
- max_consoles = 0;
-
- res = setttyent ();
- if (res == 0) {
- goto done;
- }
-
- while ((t = getttyent ()) != NULL) {
- if (t->ty_status & TTY_ON && strncmp (t->ty_name, "ttyE", 4) == 0)
- max_consoles++;
- }
-
- ret = TRUE;
-
- endttyent ();
-
-done:
- if (num != NULL) {
- *num = max_consoles;
- }
-
- return ret;
-}
-
-gboolean
-ck_supports_activatable_consoles (void)
-{
- return TRUE;
-}
-
-char *
-ck_get_console_device_for_num (guint num)
-{
- char *device;
-
- /* The device number is always one less than the VT number. */
- num--;
-
- device = g_strdup_printf ("/dev/ttyE%u", num);
-
- return device;
-}
-
-gboolean
-ck_get_console_num_from_device (const char *device,
- guint *num)
-{
- guint n;
- gboolean ret;
-
- n = 0;
- ret = FALSE;
-
- if (device == NULL) {
- return FALSE;
- }
-
- if (sscanf (device, "/dev/ttyE%u", &n) == 1) {
- /* The VT number is always one more than the device number. */
- n++;
- ret = TRUE;
- }
-
- if (num != NULL) {
- *num = n;
- }
-
- return ret;
-}
-
-gboolean
-ck_get_active_console_num (int console_fd,
- guint *num)
-{
- gboolean ret;
- int res;
- int active;
-
- g_assert (console_fd != -1);
-
- active = 0;
- ret = FALSE;
-
- res = ioctl (console_fd, VT_GETACTIVE, &active);
- if (res == ERROR) {
- perror ("ioctl VT_GETACTIVE");
- goto out;
- }
-
- g_debug ("Active VT is: %d (ttyE%d)", active, active - 1);
- ret = TRUE;
-
- out:
- if (num != NULL) {
- *num = active;
- }
-
- return ret;
-}
diff --git a/consolekit/files/ck-sysdeps-openbsd.c b/consolekit/files/ck-sysdeps-openbsd.c
deleted file mode 100644
index 067e0f0..0000000
--- a/consolekit/files/ck-sysdeps-openbsd.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2006 William Jon McCann <mccann%jhu.edu@localhost>
- * Copyright (C) 2007 Joe Marcus Clarke <marcus%FreeBSD.org@localhost>
- * Copyright (C) 2008 Jared D. McNeill <jmcneill%NetBSD.org@localhost>
- * Copyright (C) 2009 Robert Nagy <robert%openbsd.org@localhost>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <paths.h>
-#include <ttyent.h>
-#include <kvm.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-
-#ifdef __OpenBSD__
-#include <sys/stdint.h>
-#endif
-
-#include <dev/wscons/wsdisplay_usl_io.h>
-
-#define DEV_ENCODE(M,m) ( \
- ( (M&0xfff) << 8) | ( (m&0xfff00) << 12) | (m&0xff) \
-)
-
-#include "ck-sysdeps.h"
-
-#ifndef ERROR
-#define ERROR -1
-#endif
-
-/* adapted from procps */
-struct _CkProcessStat
-{
- int pid;
- int ppid; /* stat,status pid of parent process */
- char state; /* stat,status single-char code for process state (S=sleeping) */
- char cmd[16]; /* stat,status basename of executable file in call to exec(2) */
- unsigned long long utime; /* stat user-mode CPU time accumulated by process */
- unsigned long long stime; /* stat kernel-mode CPU time accumulated by process */
- unsigned long long cutime; /* stat cumulative utime of process and reaped children */
- unsigned long long cstime; /* stat cumulative stime of process and reaped children */
- unsigned long long start_time; /* stat start time of process -- seconds since 1-1-70 */
- unsigned long start_code; /* stat address of beginning of code segment */
- unsigned long end_code; /* stat address of end of code segment */
- unsigned long start_stack; /* stat address of the bottom of stack for the process */
- unsigned long kstk_esp; /* stat kernel stack pointer */
- unsigned long kstk_eip; /* stat kernel instruction pointer */
- unsigned long wchan; /* stat (special) address of kernel wait channel proc is sleeping in */
- long priority; /* stat kernel scheduling priority */
- long nice; /* stat standard unix nice level of process */
- long rss; /* stat resident set size from /proc/#/stat (pages) */
- long alarm; /* stat ? */
- unsigned long rtprio; /* stat real-time priority */
- unsigned long sched; /* stat scheduling class */
- unsigned long vsize; /* stat number of pages of virtual memory ... */
- unsigned long rss_rlim; /* stat resident set size limit? */
- unsigned long flags; /* stat kernel flags for the process */
- unsigned long min_flt; /* stat number of minor page faults since process start */
- unsigned long maj_flt; /* stat number of major page faults since process start */
- unsigned long cmin_flt; /* stat cumulative min_flt of process and child processes */
- unsigned long cmaj_flt; /* stat cumulative maj_flt of process and child processes */
- int pgrp; /* stat process group id */
- int session; /* stat session id */
- int nlwp; /* stat number of threads, or 0 if no clue */
- int tty; /* stat full device number of controlling terminal */
- int tpgid; /* stat terminal process group id */
- int exit_signal; /* stat might not be SIGCHLD */
- int processor; /* stat current (or most recent?) CPU */
- uintptr_t penv; /* stat address of initial environment vector */
- char tty_text[11]; /* stat device name */
-
-};
-
-pid_t
-ck_process_stat_get_ppid (CkProcessStat *stat)
-{
- g_return_val_if_fail (stat != NULL, -1);
-
- return stat->ppid;
-}
-
-char *
-ck_process_stat_get_cmd (CkProcessStat *stat)
-{
- g_return_val_if_fail (stat != NULL, NULL);
-
- return g_strdup (stat->cmd);
-}
-
-char *
-ck_process_stat_get_tty (CkProcessStat *stat)
-{
- g_return_val_if_fail (stat != NULL, NULL);
-
- return g_strdup (stat->tty_text);
-}
-
-static gboolean
-get_kinfo_proc (pid_t pid,
- struct kinfo_proc *p)
-{
- size_t len;
-
- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid,
- sizeof(struct kinfo_proc), 0 };
-
-#ifndef nitems
-#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
-#endif
-
- if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0)
- return FALSE;
-
- mib[5] = (len / sizeof(struct kinfo_proc));
-
- if (sysctl(mib, nitems(mib), p, &len, NULL, 0) < 0)
- return FALSE;
-
- return TRUE;
-}
-
-/* return 1 if it works, or 0 for failure */
-static gboolean
-stat2proc (pid_t pid,
- CkProcessStat *P)
-{
- struct kinfo_proc p;
- char *ttname;
- int num;
- int tty_maj;
- int tty_min;
-
- if (! get_kinfo_proc (pid, &p)) {
- return FALSE;
- }
-
- num = KI_MAXCOMLEN;
- if (num >= sizeof P->cmd) {
- num = sizeof P->cmd - 1;
- }
-
- memcpy (P->cmd, p.p_comm, num);
-
- P->cmd[num] = '\0';
- P->pid = p.p_pid;
- P->ppid = p.p_ppid;
- P->pgrp = p.p__pgid;
- P->session = p.p_sid;
- P->rss = p.p_vm_rssize;
- P->vsize = p.p_vm_dsize + p.p_vm_dsize + p.p_vm_ssize; /* XXX */
- P->start_time = p.p_ustart_sec;
- P->wchan = (unsigned long) p.p_wchan;
- P->state = p.p_stat;
- P->nice = p.p_nice;
- P->flags = p.p_psflags;
- P->tpgid = p.p_tpgid;
- P->processor = p.p_cpuid;
-
- /* we like it Linux-encoded :-) */
- tty_maj = major (p.p_tdev);
- tty_min = minor (p.p_tdev);
- P->tty = DEV_ENCODE (tty_maj,tty_min);
-
- snprintf (P->tty_text, sizeof P->tty_text, "%3d,%-3d", tty_maj, tty_min);
-
- if (p.p_tdev != NODEV && (ttname = devname (p.p_tdev, S_IFCHR)) != NULL) {
- memcpy (P->tty_text, ttname, sizeof P->tty_text);
- }
-
- if (p.p_tdev == NODEV) {
- /* XXX how do we associate X with its tty? */
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
- memcpy (P->tty_text, "/dev/ttyC4", sizeof P->tty_text);
-#else
- memcpy (P->tty_text, "/dev/ttyC0", sizeof P->tty_text);
-#endif
- }
-
- if (P->pid != pid) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-gboolean
-ck_process_stat_new_for_unix_pid (pid_t pid,
- CkProcessStat **stat,
- GError **error)
-{
- gboolean res;
- CkProcessStat *proc;
-
- g_return_val_if_fail (pid > 1, FALSE);
-
- if (stat == NULL) {
- return FALSE;
- }
-
- proc = g_new0 (CkProcessStat, 1);
- proc->pid = pid;
- res = stat2proc (pid, proc);
- if (res) {
- *stat = proc;
- } else {
- *stat = NULL;
- }
-
- return res;
-}
-
-void
-ck_process_stat_free (CkProcessStat *stat)
-{
- g_free (stat);
-}
-
-GHashTable *
-ck_unix_pid_get_env_hash (pid_t pid)
-{
- GHashTable *hash = NULL;
- char **penv;
- char errbuf[_POSIX2_LINE_MAX];
- kvm_t *kd;
- struct kinfo_proc p;
- int i;
-
- kd = kvm_openfiles (NULL, NULL, NULL, O_RDONLY, errbuf);
- if (kd == NULL) {
- g_warning ("kvm_openfiles failed: %s", errbuf);
- return NULL;
- }
-
- if (! get_kinfo_proc (pid, &p)) {
- g_warning ("get_kinfo_proc failed: %s", g_strerror (errno));
- goto fail;
- }
-
- penv = kvm_getenvv (kd, &p, 0);
- if (penv == NULL) {
- g_warning ("kvm_getenvv failed: %s", kvm_geterr (kd));
- goto fail;
- }
-
- hash = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- g_free);
-
- for (i = 0; penv[i] != NULL; i++) {
- char **vals;
-
- if (!penv[i][0]) continue;
-
- vals = g_strsplit (penv[i], "=", 2);
- if (vals != NULL) {
- g_hash_table_insert (hash,
- g_strdup (vals[0]),
- g_strdup (vals[1]));
- g_strfreev (vals);
- }
- }
-
-fail:
- kvm_close (kd);
-
- return hash;
-}
-
-char *
-ck_unix_pid_get_env (pid_t pid,
- const char *var)
-{
- GHashTable *hash;
- char *val = NULL;
-
- /*
- * Would probably be more efficient to just loop through the
- * environment and return the value, avoiding building the hash
- * table, but this works for now.
- */
- hash = ck_unix_pid_get_env_hash (pid);
- if (hash == NULL)
- return val;
- val = g_strdup (g_hash_table_lookup (hash, var));
- g_hash_table_destroy (hash);
-
- return val;
-}
-
-uid_t
-ck_unix_pid_get_uid (pid_t pid)
-{
- uid_t uid;
- gboolean res;
- struct kinfo_proc p;
-
- g_return_val_if_fail (pid > 1, 0);
-
- uid = -1;
-
- res = get_kinfo_proc (pid, &p);
-
- if (res) {
- uid = p.p_uid;
- }
-
- return uid;
-}
-
-gboolean
-ck_unix_pid_get_login_session_id (pid_t pid,
- char **idp)
-{
- g_return_val_if_fail (pid > 1, FALSE);
-
- return FALSE;
-}
-
-gboolean
-ck_get_max_num_consoles (guint *num)
-{
- int max_consoles;
- int res;
- gboolean ret;
- struct ttyent *t;
-
- ret = FALSE;
- max_consoles = 0;
-
- res = setttyent ();
- if (res == 0) {
- goto done;
- }
-
- while ((t = getttyent ()) != NULL) {
- if (t->ty_status & TTY_ON && strncmp (t->ty_name, "ttyC", 4) == 0)
- max_consoles++;
- }
-
- /* Increment one more so that all consoles are properly counted
- * this is arguable a bug in vt_add_watches().
- */
- max_consoles++;
-
- ret = TRUE;
-
- endttyent ();
-
-done:
- if (num != NULL) {
- *num = max_consoles;
- }
-
- return ret;
-}
-
-gboolean
-ck_supports_activatable_consoles (void)
-{
- return TRUE;
-}
-
-char *
-ck_get_console_device_for_num (guint num)
-{
- char *device;
-
-/* VT are only available on i386, amd64 and macppc */
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
- /* The device number is always one less than the VT number. */
- num--;
-#endif
-
- device = g_strdup_printf ("/dev/ttyC%u", num);
-
- return device;
-}
-
-gboolean
-ck_get_console_num_from_device (const char *device,
- guint *num)
-{
- guint n;
- gboolean ret;
-
- n = 0;
- ret = FALSE;
-
- if (device == NULL) {
- return FALSE;
- }
-
- if (sscanf (device, "/dev/ttyC%u", &n) == 1) {
-/* VT are only available on i386, amd64 and macppc */
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
- /* The VT number is always one more than the device number. */
- n++;
-#endif
- ret = TRUE;
- }
-
- if (num != NULL) {
- *num = n;
- }
-
- return ret;
-}
-
-gboolean
-ck_get_active_console_num (int console_fd,
- guint *num)
-{
- gboolean ret;
- int res;
- int active;
-
- g_assert (console_fd != -1);
-
- active = 0;
- ret = FALSE;
-
-/* VT are only available on i386, amd64 and macppc */
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
- res = ioctl (console_fd, VT_GETACTIVE, &active);
- if (res == ERROR) {
- perror ("ioctl VT_GETACTIVE");
- goto out;
- }
-
- g_debug ("Active VT is: %d (ttyC%d)", active, active - 1);
-#else
- res = 0;
- g_debug ("Active console is: ttyC%d", active);
-#endif
- ret = TRUE;
-
- out:
- if (num != NULL) {
- *num = active;
- }
-
- return ret;
-}
diff --git a/consolekit/options.mk b/consolekit/options.mk
deleted file mode 100644
index 7622d47..0000000
--- a/consolekit/options.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-# $NetBSD: options.mk,v 1.3 2015/04/09 13:56:04 krytarowski Exp $
-
-PKG_OPTIONS_VAR= PKG_OPTIONS.consolekit
-PKG_SUPPORTED_OPTIONS= pam
-PKG_SUGGESTED_OPTIONS= pam
-
-.include "../../mk/bsd.options.mk"
-
-PLIST_VARS+= pam
-
-.if !empty(PKG_OPTIONS:Mpam)
-.include "../../mk/pam.buildlink3.mk"
-CONFIGURE_ARGS+= --enable-pam-module
-CONFIGURE_ARGS+= --with-pam-module-dir=${PREFIX}/lib/security
-PLIST.pam= yes
-.else
-CONFIGURE_ARGS+= --disable-pam-module
-.endif
diff --git a/consolekit/patches/patch-aa b/consolekit/patches/patch-aa
deleted file mode 100644
index 2add9bd..0000000
--- a/consolekit/patches/patch-aa
+++ /dev/null
@@ -1,38 +0,0 @@
-$NetBSD: patch-aa,v 1.3 2015/04/09 13:56:05 krytarowski Exp $
-
-Add backends for NetBSD, Dragonfly, and OpenBSD.
-
---- configure.ac.orig 2011-02-17 00:37:16.000000000 +0000
-+++ configure.ac
-@@ -190,6 +201,21 @@ case "$host" in
- *-*-solaris*)
- CK_BACKEND="solaris"
- ;;
-+ *-*-netbsd*)
-+ CK_BACKEND="netbsd"
-+ ;;
-+ *-*-dragonfly*)
-+ CK_BACKEND="freebsd"
-+ KVM_LIBS="-lkvm"
-+ ;;
-+ *-*-openbsd*)
-+ CK_BACKEND="openbsd"
-+ AC_CHECK_LIB(kvm, kvm_openfiles, have_kvm=yes,
-+ AC_MSG_ERROR([Unable to find libkvm which is needed on OpenBSD]))
-+ if test "x$have_kvm" = "xyes"; then
-+ KVM_LIBS="-lkvm"
-+ fi
-+ ;;
- *)
- AC_MSG_ERROR([No sysdeps back-end implemented for host $host])
- ;;
-@@ -199,7 +225,9 @@ AC_SUBST(KVM_LIBS)
-
- AM_CONDITIONAL(CK_COMPILE_LINUX, test x$CK_BACKEND = xlinux, [Compiling for Linux])
- AM_CONDITIONAL(CK_COMPILE_FREEBSD, test x$CK_BACKEND = xfreebsd, [Compiling for FreeBSD])
-+AM_CONDITIONAL(CK_COMPILE_NETBSD, test x$CK_BACKEND = xnetbsd, [Compiling for NetBSD])
- AM_CONDITIONAL(CK_COMPILE_SOLARIS, test x$CK_BACKEND = xsolaris, [Compiling for Solaris])
-+AM_CONDITIONAL(CK_COMPILE_OPENBSD, test x$CK_BACKEND = xopenbsd, [Compiling for OpenBSD])
- AC_SUBST(CK_BACKEND)
-
- dnl ---------------------------------------------------------------------------
diff --git a/consolekit/patches/patch-ab b/consolekit/patches/patch-ab
deleted file mode 100644
index 40375ce..0000000
--- a/consolekit/patches/patch-ab
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-ab,v 1.3 2015/04/09 13:56:05 krytarowski Exp $
-
-Add backends for NetBSD and OpenBSD.
-
---- src/Makefile.am.orig 2008-07-25 18:38:56.000000000 +0000
-+++ src/Makefile.am
-@@ -56,11 +56,25 @@ libck_la_SOURCES += \
- $(NULL)
- libck_la_LIBADD = $(KVM_LIBS)
- endif
-+if CK_COMPILE_NETBSD
-+libck_la_SOURCES += \
-+ ck-sysdeps-netbsd.c \
-+ $(NULL)
-+libck_la_LIBADD = -lkvm
-+endif
-+if CK_COMPILE_OPENBSD
-+libck_la_SOURCES += \
-+ ck-sysdeps-openbsd.c \
-+ $(NULL)
-+libck_la_LIBADD = $(KVM_LIBS)
-+endif
-
- EXTRA_libck_la_SOURCES = \
- ck-sysdeps-linux.c \
- ck-sysdeps-solaris.c \
- ck-sysdeps-freebsd.c \
-+ ck-sysdeps-netbsd.c \
-+ ck-sysdeps-openbsd.c \
- $(NULL)
-
- sbin_PROGRAMS = \
diff --git a/consolekit/patches/patch-ac b/consolekit/patches/patch-ac
deleted file mode 100644
index 8e652fd..0000000
--- a/consolekit/patches/patch-ac
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-ac,v 1.3 2015/04/09 13:56:05 krytarowski Exp $
-
-Add backends for NetBSD and OpenBSD.
-
---- tools/Makefile.am.orig 2008-02-13 03:46:39.000000000 +0000
-+++ tools/Makefile.am
-@@ -18,6 +18,14 @@ if CK_COMPILE_SOLARIS
- SUBDIRS += solaris
- endif
-
-+if CK_COMPILE_NETBSD
-+SUBDIRS += freebsd
-+endif
-+
-+if CK_COMPILE_OPENBSD
-+SUBDIRS += freebsd
-+endif
-+
- DIST_SUBDIRS = \
- linux \
- freebsd \
diff --git a/consolekit/patches/patch-ad b/consolekit/patches/patch-ad
deleted file mode 100644
index a14bdb7..0000000
--- a/consolekit/patches/patch-ad
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-ad,v 1.3 2015/04/09 13:56:05 krytarowski Exp $
-
-Install config files into pkgsrc example path.
-
---- data/Makefile.am.orig 2008-02-29 15:23:02.000000000 -0500
-+++ data/Makefile.am
-@@ -1,9 +1,9 @@
- NULL =
-
--dbusconfdir = $(DBUS_SYS_DIR)
-+dbusconfdir = $(PREFIX)/share/examples/consolekit
- dbusconf_DATA = ConsoleKit.conf
-
--seatdir = $(sysconfdir)/ConsoleKit/seats.d
-+seatdir = $(PREFIX)/share/examples/consolekit
- seat_DATA = 00-primary.seat
-
- if HAVE_POLKIT
diff --git a/consolekit/patches/patch-ae b/consolekit/patches/patch-ae
deleted file mode 100644
index 3d0b35c..0000000
--- a/consolekit/patches/patch-ae
+++ /dev/null
@@ -1,127 +0,0 @@
-$NetBSD: patch-ae,v 1.3 2015/04/09 13:56:05 krytarowski Exp $
-
-Fix UNIX backend for NetBSD, DragonFly, and OpenBSD.
-
---- src/ck-sysdeps-unix.c.orig 2008-01-23 14:30:44.000000000 +0000
-+++ src/ck-sysdeps-unix.c
-@@ -35,6 +35,11 @@
- #include <linux/kd.h>
- #endif
-
-+#ifdef __NetBSD__
-+#include <dev/wscons/wsdisplay_usl_io.h>
-+#include <sys/un.h>
-+#endif
-+
- #ifdef HAVE_SYS_VT_H
- #include <sys/vt.h>
- #endif
-@@ -53,6 +58,25 @@
- #define ERROR -1
- #endif
-
-+#ifdef LOCAL_PEEREID
-+static gboolean
-+ck_nb_getpeeruucred(int socket_fd, pid_t *pid, uid_t *uid)
-+{
-+ struct unpcbid cred;
-+ socklen_t len = sizeof(cred);
-+
-+ if (getsockopt(socket_fd, 0, LOCAL_PEEREID, &cred, &len) < 0)
-+ return FALSE;
-+
-+ if (pid)
-+ *pid = cred.unp_pid;
-+ if (uid)
-+ *uid = cred.unp_euid;
-+
-+ return TRUE;
-+}
-+#endif
-+
- /* Adapted from dbus-sysdeps-unix.c:_dbus_read_credentials_socket() */
- gboolean
- ck_get_socket_peer_credentials (int socket_fd,
-@@ -69,7 +93,11 @@ ck_get_socket_peer_credentials (int
- ret = FALSE;
-
- #ifdef SO_PEERCRED
-+#if !defined(__OpenBSD__)
- struct ucred cr;
-+#else
-+ struct sockpeercred cr;
-+#endif
- socklen_t cr_len;
-
- cr_len = sizeof (cr);
-@@ -99,7 +127,16 @@ ck_get_socket_peer_credentials (int
- if (ucred != NULL) {
- ucred_free (ucred);
- }
--#else /* !SO_PEERCRED && !HAVE_GETPEERUCRED */
-+#elif defined(LOCAL_PEEREID)
-+ pid_t sockpid = -1, sockuid = -1;
-+ if (ck_nb_getpeeruucred(socket_fd, &sockpid, &sockuid) == TRUE) {
-+ pid_read = sockpid;
-+ uid_read = sockuid;
-+ ret = TRUE;
-+ } else {
-+ g_warning ("Failed to ck_nb_getpeeruucred() credentials\n");
-+ }
-+#else /* !SO_PEERCRED && !HAVE_GETPEERUCRED && !LOCAL_PEEREID*/
- g_warning ("Socket credentials not supported on this OS\n");
- #endif
-
-@@ -126,17 +163,17 @@ ck_get_socket_peer_credentials (int
- gboolean
- ck_fd_is_a_console (int fd)
- {
--#ifdef __linux__
-+#if defined(__linux__) || defined(__NetBSD__)
- struct vt_stat vts;
--#elif defined(__FreeBSD__)
-+#elif defined(__FreeBSD__) || defined(__DragonFly__)
- int vers;
- #endif
- int kb_ok;
-
- errno = 0;
--#ifdef __linux__
-+#if defined(__linux__) || defined(__NetBSD__)
- kb_ok = (ioctl (fd, VT_GETSTATE, &vts) == 0);
--#elif defined(__FreeBSD__)
-+#elif defined(__FreeBSD__) || defined(__DragonFly__)
- kb_ok = (ioctl (fd, CONS_GETVERS, &vers) == 0);
- #else
- kb_ok = 1;
-@@ -172,6 +209,15 @@ ck_get_a_console_fd (void)
-
- fd = -1;
-
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
-+ /* On FreeBSD, try /dev/consolectl first as this will survive
-+ * /etc/ttys initialization. */
-+ fd = open_a_console ("/dev/consolectl");
-+ if (fd >= 0) {
-+ goto done;
-+ }
-+#endif
-+
- #ifdef __sun
- /* On Solaris, first try Sun VT device. */
- fd = open_a_console ("/dev/vt/active");
-@@ -184,6 +230,14 @@ ck_get_a_console_fd (void)
- }
- #endif
-
-+#ifdef __NetBSD__
-+ /* On NetBSD, first try wsdisplay device. */
-+ fd = open_a_console ("/dev/ttyE0");
-+ if (fd >= 0) {
-+ goto done;
-+ }
-+#endif
-+
- #ifdef _PATH_TTY
- fd = open_a_console (_PATH_TTY);
- if (fd >= 0) {
diff --git a/consolekit/patches/patch-af b/consolekit/patches/patch-af
deleted file mode 100644
index 5cf8b40..0000000
--- a/consolekit/patches/patch-af
+++ /dev/null
@@ -1,231 +0,0 @@
-$NetBSD: patch-af,v 1.3 2015/04/09 13:56:05 krytarowski Exp $
-
-Adapt FreeBSD backend for DragonFly.
-
---- src/ck-sysdeps-freebsd.c.orig 2010-09-03 13:54:31.000000000 +0000
-+++ src/ck-sysdeps-freebsd.c
-@@ -27,6 +27,7 @@
- #include <unistd.h>
- #include <string.h>
- #include <errno.h>
-+#include <glob.h>
- #include <paths.h>
- #include <ttyent.h>
- #include <kvm.h>
-@@ -151,14 +152,38 @@ stat2proc (pid_t pid,
- return FALSE;
- }
-
-+#ifdef __DragonFly__
-+ num = MAXCOMLEN;
-+#else
- num = OCOMMLEN;
-+#endif
- if (num >= sizeof P->cmd) {
- num = sizeof P->cmd - 1;
- }
-
-+#ifdef __DragonFly__
-+ memcpy (P->cmd, p.kp_comm, num);
-+#else
- memcpy (P->cmd, p.ki_ocomm, num);
-+#endif
-
- P->cmd[num] = '\0';
-+#ifdef __DragonFly__
-+ P->pid = p.kp_pid;
-+ P->ppid = p.kp_ppid;
-+ P->pgrp = p.kp_pgid;
-+ P->session = p.kp_sid;
-+ P->rss = p.kp_vm_rssize;
-+ P->vsize = p.kp_vm_map_size;
-+ P->start_time = p.kp_start.tv_sec;
-+ P->wchan = (unsigned long) p.kp_lwp.kl_wchan;
-+ P->state = p.kp_stat;
-+ P->nice = p.kp_nice;
-+ P->flags = p.kp_flags;
-+ P->tpgid = p.kp_tpgid;
-+ P->processor = p.kp_lwp.kl_cpuid;
-+ P->nlwp = p.kp_nthreads;
-+#else
- P->pid = p.ki_pid;
- P->ppid = p.ki_ppid;
- P->pgrp = p.ki_pgid;
-@@ -173,19 +198,33 @@ stat2proc (pid_t pid,
- P->tpgid = p.ki_tpgid;
- P->processor = p.ki_oncpu;
- P->nlwp = p.ki_numthreads;
-+#endif
-
- /* we like it Linux-encoded :-) */
-+#ifdef __DragonFly__
-+ tty_maj = major (p.kp_tdev);
-+ tty_min = minor (p.kp_tdev);
-+#else
- tty_maj = major (p.ki_tdev);
- tty_min = minor (p.ki_tdev);
-+#endif
- P->tty = DEV_ENCODE (tty_maj,tty_min);
-
- snprintf (P->tty_text, sizeof P->tty_text, "%3d,%-3d", tty_maj, tty_min);
-
-+#ifdef __DragonFly__
-+ if (p.kp_tdev != NODEV && (ttname = devname (p.kp_tdev, S_IFCHR)) != NULL) {
-+#else
- if (p.ki_tdev != NODEV && (ttname = devname (p.ki_tdev, S_IFCHR)) != NULL) {
-+#endif
- memcpy (P->tty_text, ttname, sizeof P->tty_text);
- }
-
-+#ifdef __DragonFly__
-+ if (p.kp_tdev == NODEV) {
-+#else
- if (p.ki_tdev == NODEV) {
-+#endif
- memcpy (P->tty_text, " ? ", sizeof P->tty_text);
- }
-
-@@ -202,7 +241,6 @@ ck_process_stat_new_for_unix_pid (pid_t
- GError **error)
- {
- gboolean res;
-- GError *local_error;
- CkProcessStat *proc;
-
- g_return_val_if_fail (pid > 1, FALSE);
-@@ -217,7 +255,6 @@ ck_process_stat_new_for_unix_pid (pid_t
- if (res) {
- *stat = proc;
- } else {
-- g_propagate_error (error, local_error);
- *stat = NULL;
- }
-
-@@ -308,7 +345,11 @@ ck_unix_pid_get_uid (pid_t pid)
- res = get_kinfo_proc (pid, &p);
-
- if (res) {
-+#ifdef __DragonFly__
-+ uid = p.kp_uid;
-+#else
- uid = p.ki_uid;
-+#endif
- }
-
- return uid;
-@@ -327,38 +368,40 @@ gboolean
- ck_get_max_num_consoles (guint *num)
- {
- int max_consoles;
-- int res;
-- gboolean ret;
-- struct ttyent *t;
-+ int i;
-+ glob_t g;
-
-- ret = FALSE;
- max_consoles = 0;
-
-- res = setttyent ();
-- if (res == 0) {
-- goto done;
-- }
--
-- while ((t = getttyent ()) != NULL) {
-- if (t->ty_status & TTY_ON && strncmp (t->ty_name, "ttyv", 4) == 0)
-+ g.gl_offs = 0;
-+ glob ("/dev/ttyv*", GLOB_DOOFFS, NULL, &g);
-+ for (i = 0; i < g.gl_pathc && g.gl_pathv[i] != NULL; i++) {
-+ int fd;
-+ char *cdev;
-+
-+ cdev = g.gl_pathv[i];
-+ fd = open (cdev, O_RDONLY | O_NOCTTY);
-+ if (fd > -1) {
-+ close (fd);
- max_consoles++;
-+ } else {
-+ break;
-+ }
- }
-
-- /* Increment one more so that all consoles are properly counted
-+ globfree (&g);
-+
-+ /*
-+ * Increment one more so that all consoles are properly counted
- * this is arguable a bug in vt_add_watches().
- */
- max_consoles++;
-
-- ret = TRUE;
--
-- endttyent ();
--
--done:
- if (num != NULL) {
- *num = max_consoles;
- }
-
-- return ret;
-+ return TRUE;
- }
-
- gboolean
-@@ -375,7 +418,12 @@ ck_get_console_device_for_num (guint num
- /* The device number is always one less than the VT number. */
- num--;
-
-- device = g_strdup_printf ("/dev/ttyv%u", num);
-+ if (num < 10)
-+ device = g_strdup_printf ("/dev/ttyv%i", num);
-+ else if (num < 32)
-+ device = g_strdup_printf ("/dev/ttyv%c", num - 10 + 'a');
-+ else
-+ device = NULL;
-
- return device;
- }
-@@ -385,6 +433,7 @@ ck_get_console_num_from_device (const ch
- guint *num)
- {
- guint n;
-+ char c;
- gboolean ret;
-
- n = 0;
-@@ -394,7 +443,11 @@ ck_get_console_num_from_device (const ch
- return FALSE;
- }
-
-- if (sscanf (device, "/dev/ttyv%u", &n) == 1) {
-+ if (sscanf (device, "/dev/ttyv%c", &c) == 1) {
-+ if (c < 58)
-+ n = c - 48;
-+ else
-+ n = c - 'a' + 10;
- /* The VT number is always one more than the device number. */
- n++;
- ret = TRUE;
-@@ -414,6 +467,7 @@ ck_get_active_console_num (int consol
- gboolean ret;
- int res;
- int active;
-+ char ttyn;
-
- g_assert (console_fd != -1);
-
-@@ -426,7 +480,12 @@ ck_get_active_console_num (int consol
- goto out;
- }
-
-- g_debug ("Active VT is: %d (ttyv%d)", active, active - 1);
-+ if (active - 1 < 10)
-+ ttyn = active - 1 + '0';
-+ else
-+ ttyn = active - 11 + 'a';
-+
-+ g_debug ("Active VT is: %d (ttyv%c)", active, ttyn);
- ret = TRUE;
-
- out:
diff --git a/consolekit/patches/patch-src_ck-manager.c b/consolekit/patches/patch-src_ck-manager.c
deleted file mode 100644
index 5b355d7..0000000
--- a/consolekit/patches/patch-src_ck-manager.c
+++ /dev/null
@@ -1,207 +0,0 @@
-$NetBSD: patch-src_ck-manager.c,v 1.5 2015/04/09 13:56:05 krytarowski Exp $
-
-XXX revert 4f88228f31a63c026c424a92827f26ad7535275c
-The Kit people assume the world runs Linux and PAM, see
-https://bugs.freedesktop.org/show_bug.cgi?id=28377
-
-Fix deprecated use of polkit_authority_get().
-
---- src/ck-manager.c.orig 2010-10-26 14:34:03.000000000 +0000
-+++ src/ck-manager.c
-@@ -1659,175 +1659,13 @@ open_session_for_leader (CkManager
- dbus_g_method_return (context, cookie);
- }
-
--enum {
-- PROP_STRING,
-- PROP_BOOLEAN,
--};
--
--#define CK_TYPE_PARAMETER_STRUCT (dbus_g_type_get_struct ("GValueArray", \
-- G_TYPE_STRING, \
-- G_TYPE_VALUE, \
-- G_TYPE_INVALID))
--
--static gboolean
--_get_parameter (GPtrArray *parameters,
-- const char *name,
-- int prop_type,
-- gpointer *value)
--{
-- gboolean ret;
-- int i;
--
-- if (parameters == NULL) {
-- return FALSE;
-- }
--
-- ret = FALSE;
--
-- for (i = 0; i < parameters->len && ret == FALSE; i++) {
-- gboolean res;
-- GValue val_struct = { 0, };
-- char *prop_name;
-- GValue *prop_val;
--
-- g_value_init (&val_struct, CK_TYPE_PARAMETER_STRUCT);
-- g_value_set_static_boxed (&val_struct, g_ptr_array_index (parameters, i));
--
-- res = dbus_g_type_struct_get (&val_struct,
-- 0, &prop_name,
-- 1, &prop_val,
-- G_MAXUINT);
-- if (! res) {
-- g_debug ("Unable to extract parameter input");
-- goto cont;
-- }
--
-- if (prop_name == NULL) {
-- g_debug ("Skipping NULL parameter");
-- goto cont;
-- }
--
-- if (strcmp (prop_name, name) != 0) {
-- goto cont;
-- }
--
-- switch (prop_type) {
-- case PROP_STRING:
-- if (value != NULL) {
-- *value = g_value_dup_string (prop_val);
-- }
-- break;
-- case PROP_BOOLEAN:
-- if (value != NULL) {
-- *(gboolean *)value = g_value_get_boolean (prop_val);
-- }
-- break;
-- default:
-- g_assert_not_reached ();
-- break;
-- }
--
-- ret = TRUE;
--
-- cont:
-- g_free (prop_name);
-- if (prop_val != NULL) {
-- g_value_unset (prop_val);
-- g_free (prop_val);
-- }
-- }
--
-- return ret;
--}
--
--static gboolean
--_verify_login_session_id_is_local (CkManager *manager,
-- const char *login_session_id)
--{
-- GHashTableIter iter;
-- const char *id;
-- CkSession *session;
--
-- g_return_val_if_fail (CK_IS_MANAGER (manager), FALSE);
--
-- /* If any local session exists for the given login session id
-- then that means a trusted party has vouched for the
-- original login */
--
-- g_debug ("Looking for local sessions for login-session-id=%s", login_session_id);
--
-- session = NULL;
-- g_hash_table_iter_init (&iter, manager->priv->sessions);
-- while (g_hash_table_iter_next (&iter, (gpointer *)&id, (gpointer *)&session)) {
-- if (session != NULL) {
-- gboolean is_local;
-- char *sessid;
--
-- sessid = NULL;
-- g_object_get (session,
-- "login-session-id", &sessid,
-- "is-local", &is_local,
-- NULL);
-- if (g_strcmp0 (sessid, login_session_id) == 0 && is_local) {
-- g_debug ("CkManager: found is-local=true on %s", id);
-- return TRUE;
-- }
-- }
-- }
--
-- return FALSE;
--}
--
--static void
--add_param_boolean (GPtrArray *parameters,
-- const char *key,
-- gboolean value)
--{
-- GValue val = { 0, };
-- GValue param_val = { 0, };
--
-- g_value_init (&val, G_TYPE_BOOLEAN);
-- g_value_set_boolean (&val, value);
-- g_value_init (¶m_val, CK_TYPE_PARAMETER_STRUCT);
-- g_value_take_boxed (¶m_val,
-- dbus_g_type_specialized_construct (CK_TYPE_PARAMETER_STRUCT));
-- dbus_g_type_struct_set (¶m_val,
-- 0, key,
-- 1, &val,
-- G_MAXUINT);
-- g_value_unset (&val);
--
-- g_ptr_array_add (parameters, g_value_get_boxed (¶m_val));
--}
--
- static void
- verify_and_open_session_for_leader (CkManager *manager,
- CkSessionLeader *leader,
-- GPtrArray *parameters,
-+ const GPtrArray *parameters,
- DBusGMethodInvocation *context)
- {
-- /* Only allow a local session if originating from an existing
-- local session. Effectively this means that only trusted
-- parties can create local sessions. */
--
-- g_debug ("CkManager: verifying session for leader");
--
-- if (parameters != NULL && ! _get_parameter (parameters, "is-local", PROP_BOOLEAN, NULL)) {
-- gboolean is_local;
-- char *login_session_id;
--
-- g_debug ("CkManager: is-local has not been set, will inherit from existing login-session-id if available");
--
-- is_local = FALSE;
--
-- if (_get_parameter (parameters, "login-session-id", PROP_STRING, (gpointer *) &login_session_id)) {
-- is_local = _verify_login_session_id_is_local (manager, login_session_id);
-- g_debug ("CkManager: found is-local=%s", is_local ? "true" : "false");
-- }
--
-- add_param_boolean (parameters, "is-local", is_local);
-- }
--
-+ /* for now don't bother verifying since we protect Open SessionWithParameters */
- open_session_for_leader (manager,
- leader,
- parameters,
-@@ -2423,10 +2261,16 @@ register_manager (CkManager *manager)
- GError *error = NULL;
-
- #ifdef HAVE_POLKIT
-- manager->priv->pol_ctx = polkit_authority_get ();
-+ manager->priv->pol_ctx = polkit_authority_get_sync (NULL, &error);
-+ if (manager->priv->pol_ctx == NULL) {
-+ if (error != NULL) {
-+ g_critical ("error getting polkit authority: %s", error->message);
-+ g_error_free (error);
-+ }
-+ exit (1);
-+ }
- #endif
-
-- error = NULL;
- manager->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
- if (manager->priv->connection == NULL) {
- if (error != NULL) {
diff --git a/consolekit/patches/patch-tools_ck-collect-session-info.c b/consolekit/patches/patch-tools_ck-collect-session-info.c
deleted file mode 100644
index af7ee06..0000000
--- a/consolekit/patches/patch-tools_ck-collect-session-info.c
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-tools_ck-collect-session-info.c,v 1.3 2015/04/09 13:56:05 krytarowski Exp $
-
-XXX revert 4f88228f31a63c026c424a92827f26ad7535275c
-The Kit people assume the world runs Linux and PAM, see
-https://bugs.freedesktop.org/show_bug.cgi?id=28377
-
---- tools/ck-collect-session-info.c.orig 2010-09-03 13:54:31.000000000 +0000
-+++ tools/ck-collect-session-info.c
-@@ -274,7 +274,8 @@ fill_x11_info (SessionInfo *si)
- si->x11_display_device = ck_process_stat_get_tty (xorg_stat);
- ck_process_stat_free (xorg_stat);
-
-- /* don't set is-local here - let the daemon do that */
-+ si->is_local = TRUE;
-+ si->is_local_is_set = TRUE;
-
- g_free (si->remote_host_name);
- si->remote_host_name = NULL;
-@@ -303,6 +304,13 @@ fill_session_info (SessionInfo *si)
-
- fill_x11_info (si);
-
-+ if (! si->is_local_is_set) {
-+ /* FIXME: how should we set this? */
-+ /* non x11 sessions must be local I guess */
-+ si->is_local = TRUE;
-+ si->is_local_is_set = TRUE;
-+ }
-+
- res = ck_unix_pid_get_login_session_id (si->pid, &si->login_session_id);
- if (! res) {
- si->login_session_id = NULL;
diff --git a/consolekit/patches/patch-tools_ck-history.c b/consolekit/patches/patch-tools_ck-history.c
deleted file mode 100644
index 28a4215..0000000
--- a/consolekit/patches/patch-tools_ck-history.c
+++ /dev/null
@@ -1,79 +0,0 @@
-$NetBSD: patch-tools_ck-history.c,v 1.3 2015/04/09 13:56:05 krytarowski Exp $
-
-Fix uninitialised variable.
-
-64-bit time_t
-GLib's struct GTimeVal declares tv_sec as glong (will break around 2038).
-Our struct timeval declares tv_sec as time_t...
-warning: passing argument 1 of 'ctime' from incompatible pointer type
-
---- tools/ck-history.c.orig 2010-09-03 13:54:31.000000000 +0000
-+++ tools/ck-history.c
-@@ -511,9 +511,10 @@ print_last_report_record (GList *li
- char *session_type;
- char *session_id;
- char *seat_id;
-- CkLogSeatSessionAddedEvent *e;
-+ CkLogSeatSessionAddedEvent *e = NULL;
- CkLogEvent *remove_event;
- RecordStatus status;
-+ time_t added_t, removed_t;
-
- if (event->type != CK_LOG_EVENT_SEAT_SESSION_ADDED
- && event->type != CK_LOG_EVENT_SYSTEM_START) {
-@@ -546,7 +547,8 @@ print_last_report_record (GList *li
- utline = get_utline_for_event (event);
- host = get_host_for_event (event);
-
-- addedtime = g_strndup (ctime (&event->timestamp.tv_sec), 16);
-+ added_t = &event->timestamp.tv_sec;
-+ addedtime = g_strndup (ctime (&added_t), 16);
-
- if (legacy_compat) {
- g_string_printf (str,
-@@ -602,7 +604,8 @@ print_last_report_record (GList *li
- break;
- case RECORD_STATUS_NORMAL:
- duration = get_duration (event, remove_event);
-- removedtime = g_strdup_printf ("- %s", ctime (&remove_event->timestamp.tv_sec) + 11);
-+ removed_t = remove_event->timestamp.tv_sec;
-+ removedtime = g_strdup_printf ("- %s", ctime (&removed_t) + 11);
- removedtime[7] = 0;
- break;
- default:
-@@ -629,6 +632,7 @@ generate_report_last (int uid,
- GList *oldest;
- CkLogEvent *oldest_event;
- GList *l;
-+ time_t oldest_e;
-
- /* print events in reverse time order */
-
-@@ -660,7 +664,8 @@ generate_report_last (int uid,
- oldest = g_list_first (all_events);
- if (oldest != NULL) {
- oldest_event = oldest->data;
-- g_print ("\nLog begins %s", ctime (&oldest_event->timestamp.tv_sec));
-+ oldest_e = oldest_event->timestamp.tv_sec;
-+ g_print ("\nLog begins %s", ctime (&oldest_e));
- }
- }
-
-@@ -672,6 +677,7 @@ generate_report_last_compat (int
- GList *oldest;
- CkLogEvent *oldest_event;
- GList *l;
-+ time_t oldest_e;
-
- /* print events in reverse time order */
-
-@@ -703,7 +709,8 @@ generate_report_last_compat (int
- oldest = g_list_first (all_events);
- if (oldest != NULL) {
- oldest_event = oldest->data;
-- g_print ("\nLog begins %s", ctime (&oldest_event->timestamp.tv_sec));
-+ oldest_e = oldest_event->timestamp.tv_sec;
-+ g_print ("\nLog begins %s", ctime (&oldest_e));
- }
- }
-
diff --git a/consolekit/patches/patch-tools_ck-log-system-start.c b/consolekit/patches/patch-tools_ck-log-system-start.c
deleted file mode 100644
index 400ca80..0000000
--- a/consolekit/patches/patch-tools_ck-log-system-start.c
+++ /dev/null
@@ -1,34 +0,0 @@
-$NetBSD: patch-tools_ck-log-system-start.c,v 1.3 2015/04/09 13:56:05 krytarowski Exp $
-
-XXX: only for Linux
-
---- tools/ck-log-system-start.c.orig 2010-09-03 13:54:31.000000000 +0000
-+++ tools/ck-log-system-start.c
-@@ -41,7 +41,9 @@
-
- #define DEFAULT_LOG_FILENAME LOCALSTATEDIR "/log/ConsoleKit/history"
-
-+#ifdef __linux__
- #define LINUX_KERNEL_CMDLINE "/proc/cmdline"
-+#endif /* __linux__ */
-
- /* Adapted from auditd auditd-event.c */
- static gboolean
-@@ -162,6 +164,7 @@ write_log_for_event (CkLogEvent *event)
- static char *
- get_boot_arguments (void)
- {
-+#ifdef __linux__
- char *contents;
- gboolean res;
-
-@@ -178,6 +181,9 @@ get_boot_arguments (void)
- }
-
- return contents;
-+#else
-+ return NULL;
-+#endif
- }
-
- int
Home |
Main Index |
Thread Index |
Old Index