diff options
author | Michael Biebl <biebl@debian.org> | 2009-07-14 17:40:56 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2009-07-14 17:40:56 +0200 |
commit | 517ae9bab3e1aeda58ef4f042fa1346d411a9a4c (patch) | |
tree | 450b1355a1f8138ea9a031bd0653f2c1da9e18d7 | |
parent | b4c56fb4b5f0c496b544080c5dd38d3cf93c10e8 (diff) | |
download | consolekit-517ae9bab3e1aeda58ef4f042fa1346d411a9a4c.tar.gz |
Imported Upstream version 0.2.3upstream/0.2.3
50 files changed, 3796 insertions, 1102 deletions
@@ -1,6 +1,571 @@ +commit f35dee9696d81630216e283bcd91ca491febe153 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Sep 18 01:09:04 2007 -0400 + + use unix-user instead of user + + pam-ck-connector/pam-ck-connector.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 6b8dc7403c105dc12dbe93616321850b8f160a8e +Author: William Jon McCann <mccann@jhu.edu> +Date: Mon Sep 17 18:27:54 2007 -0400 + + post release version bump + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e9c5548af759cb9968acb11e1b09dfc34fe13781 +Author: William Jon McCann <mccann@jhu.edu> +Date: Mon Sep 17 18:24:11 2007 -0400 + + update NEWS for release + + NEWS | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +commit 3708b8b25a8e48b627920eb0876203cac81eb36e +Author: William Jon McCann <mccann@jhu.edu> +Date: Wed Aug 29 15:56:06 2007 -0400 + + remove policy for gdm user + + data/ConsoleKit.conf | 15 --------------- + 1 files changed, 0 insertions(+), 15 deletions(-) + +commit 1c9456a82126f56f4bebca0e7b6671ca844db322 +Author: Joe Marcus Clarke <marcus@FreeBSD.org> +Date: Wed Aug 29 10:10:17 2007 -0400 + + fix FreeBSD issues translating VT numbers to devices + + In FreeBSD the device number is always one less than the VT number + (e.g. + VT 1 is /dev/ttyv0). Account for this. Also, fix up reading console + entries from /etc/ttys, and make sure the full TTY device name + is returned + for a given process stat. + + src/ck-sysdeps-freebsd.c | 22 ++++++++++++++-------- + 1 files changed, 14 insertions(+), 8 deletions(-) + +commit b508cf9b49ecd1f4810f69e785ebf40a2e5d5677 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 28 13:20:35 2007 -0400 + + untabify + + src/ck-file-monitor-inotify.c | 2 +- + src/ck-manager.c | 16 ++++++++-------- + src/ck-session.c | 8 ++++---- + src/ck-sysdeps-unix.c | 6 +++--- + src/main.c | 12 ++++++------ + 5 files changed, 22 insertions(+), 22 deletions(-) + +commit 1523b599eeba119c1258e887b7df9b018ce10351 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 28 11:48:11 2007 -0400 + + fix some compiler warnings, untabify + + Based on patch from Joe Marcus Clarke + + src/ck-sysdeps-freebsd.c | 188 + +++++++++++++++++++--------------------------- + src/ck-sysdeps-solaris.c | 8 +- + 2 files changed, 81 insertions(+), 115 deletions(-) + +commit 5e0f4848e5bfd325840d405582bdedf3a27b98f8 +Author: William Jon McCann <mccann@jhu.edu> +Date: Mon Aug 27 16:34:45 2007 -0400 + + move some of the freebsd specific stuff into sysdeps + + src/ck-sysdeps-freebsd.c | 37 ++++++++++++++++ + src/ck-sysdeps-linux.c | 49 ++++++++++++++++++++++ + src/ck-sysdeps-solaris.c | 48 +++++++++++++++++++++ + src/ck-sysdeps-unix.c | 69 +++++++++++++++++++++++++++++++ + src/ck-sysdeps.h | 6 +++ + src/ck-vt-monitor.c | 96 + ++++++++---------------------------------- + src/test-tty-idle-monitor.c | 14 +------ + 7 files changed, 229 insertions(+), 90 deletions(-) + +commit 54b545beb4b7e65f852f03dd5da025d5eae7ef8f +Author: Florent Thoumie <flz@FreeBSD.org> +Date: Mon Aug 27 14:31:53 2007 +0100 + + Don't create rc.d/init.d directory on FreeBSD. + + Move the initdir variable inside the if-block so that + it's not created on FreeBSD. + + Signed-off-by: Florent Thoumie <flz@FreeBSD.org> + + data/Makefile.am | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +commit d6fa350994ac2c56644332fd5931a4a56d2f32d9 +Author: Florent Thoumie <flz@FreeBSD.org> +Date: Sun Aug 26 13:25:23 2007 +0100 + + Disconnect init.d script on FreeBSD. + + Don't install ConsoleKit script in init.d/rc.d/ as it is + unusable on FreeBSD. + + Signed-off-by: Florent Thoumie <flz@FreeBSD.org> + + data/Makefile.am | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit a0a4451df57693a7cd4f69befd4cf17239013161 +Author: Joe Marcus Clarke <marcus@shumai.marcuscom.com> +Date: Sat Aug 25 20:23:36 2007 -0400 + + Add support for FreeBSD + + Allow this test to properly determine the current tty device. + + Signed-off-by: Florent Thoumie <flz@FreeBSD.org> + + src/test-tty-idle-monitor.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit d643acbb50eb2cccc50df8b27bd2c08bdc405622 +Author: Joe Marcus Clarke <marcus@shumai.marcuscom.com> +Date: Sat Aug 25 20:10:37 2007 -0400 + + Add ck-sysdeps-freebsd.c to the list of dist sources + + Fix make dist by making sure ck-sysdeps-freebsd.c is available on all + platforms. + + Signed-off-by: Florent Thoumie <flz@FreeBSD.org> + + src/Makefile.am | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit a2426fc2791a896c79d5eb14c2b518df7aca3dcf +Author: Florent Thoumie <flz@FreeBSD.org> +Date: Sat Aug 25 21:05:32 2007 +0100 + + Restore copyright. + + Restore copyright in ck-sysdeps-freebsd.c since Marcus + "used a lot of the existing functions". + + Submitted by: marcus + + Signed-off-by: Florent Thoumie <flz@FreeBSD.org> + + src/ck-sysdeps-freebsd.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 59d8b48dc3358057859c22588580e926aa68a3ee +Author: Florent Thoumie <flz@FreeBSD.org> +Date: Sat Aug 25 19:50:54 2007 +0100 + + Some more fixes, Now test-vt-monitor works correctly. + + Submitted by: marcus + + Signed-off-by: Florent Thoumie <flz@FreeBSD.org> + + src/ck-sysdeps-unix.c | 14 +++++++++++--- + src/ck-vt-monitor.c | 35 ++++++++++++++++++++++------------- + 2 files changed, 33 insertions(+), 16 deletions(-) + +commit 1a16c740e0eab279eeca443c1a1c276e5e125852 +Author: Florent Thoumie <flz@FreeBSD.org> +Date: Sat Aug 25 18:22:02 2007 +0100 + + Add FreeBSD native backend (untested) + + - Add Marcus' FreeBSD backend for ConsoleKit. Compiles fine but + test-vt-monitor doesn't seem to work correctly. + - Remove TODO entry. + + Submitted by: marcus + + Signed-off-by: Florent Thoumie <flz@FreeBSD.org> + + TODO | 2 - + configure.ac | 8 + + src/Makefile.am | 1 + + src/ck-sysdeps-freebsd.c | 592 + ++++++++++++++-------------------------------- + 4 files changed, 182 insertions(+), 421 deletions(-) + +commit a910e8cc1ad8df738a8160c4f710b04810dfe99d +Author: Florent Thoumie <flz@FreeBSD.org> +Date: Sat Aug 25 17:19:09 2007 +0100 + + Add a note about native FreeBSD backend in TODO. + + At the moment, we rely on linprocfs being mounted, we need a + native backend on FreeBSD. + + Signed-off-by: Florent Thoumie <flz@FreeBSD.org> + + TODO | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 342f4d1b60850daad422bd683978a88cb6a7eed7 +Author: Florent Thoumie <flz@FreeBSD.org> +Date: Sat Aug 25 17:08:20 2007 +0100 + + First attempt a making ConsoleKit work on FreeBSD + + - Add some ifdef's to make the code compile. + - Add ck-sysdeps-freebsd.c, based on the Linux version, which + means it's using linprocfs right now. + + Signed-off-by: Florent Thoumie <flz@FreeBSD.org> + + src/Makefile.am | 5 + + src/ck-job.c | 1 + + src/ck-sysdeps-freebsd.c | 659 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/ck-vt-monitor.c | 16 +- + 4 files changed, 679 insertions(+), 2 deletions(-) + +commit f19761b0e2e6649836d3514fbd007b9365756f32 +Author: Brian Cameron <brian.cameron@sun.com> +Date: Wed Aug 22 09:48:30 2007 -0400 + + more build fixes for solaris + + src/ck-sysdeps-linux.c | 5 ++++- + src/ck-sysdeps-solaris.c | 9 +++++++-- + 2 files changed, 11 insertions(+), 3 deletions(-) + +commit de3718f03a6e1a83c1024dad0dea5b070b1b27b4 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 21 11:50:08 2007 -0400 + + abstract out the tty device basename stuff + + src/ck-seat.c | 15 ++++++--------- + src/ck-sysdeps-linux.c | 35 +++++++++++++++++++++++++++++++++++ + src/ck-sysdeps-solaris.c | 35 +++++++++++++++++++++++++++++++++++ + src/ck-sysdeps.h | 8 ++++---- + 4 files changed, 80 insertions(+), 13 deletions(-) + +commit 0145691112f14352ef15b49c1ea3079a8e80f6e8 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 21 11:27:04 2007 -0400 + + more solaris support + + based on patch from Brian Cameron. + + src/ck-sysdeps-linux.c | 14 ++++++ + src/ck-sysdeps-solaris.c | 109 + +++++++++++++++++++++++++++++++++++----------- + src/ck-sysdeps-unix.c | 40 ++++++++++++----- + src/ck-sysdeps.h | 2 + + src/ck-vt-monitor.c | 14 +++--- + 5 files changed, 136 insertions(+), 43 deletions(-) + +commit 3e6bbcaea6d441956c9c1173d7586bd346a8c77b +Author: William Jon McCann <mccann@jhu.edu> +Date: Fri Aug 17 13:09:34 2007 -0400 + + display the current vt + + src/test-vt-monitor.c | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +commit 3d907714c526c4c685bb8c5dc13f91df22331cdb +Author: William Jon McCann <mccann@jhu.edu> +Date: Fri Aug 17 13:00:16 2007 -0400 + + add test-vt-monitor + + src/.gitignore | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 3423ce3039033e8bf54860a2b955fdf8c1f21be7 +Author: William Jon McCann <mccann@jhu.edu> +Date: Fri Aug 17 12:59:41 2007 -0400 + + add a vt monitor test, move getfd to sysdeps, add a check for the + root user + + src/Makefile.am | 14 +++++- + src/ck-sysdeps-unix.c | 114 + ++++++++++++++++++++++++++++++++++++++++++- + src/ck-sysdeps.h | 11 ++++ + src/ck-vt-monitor.c | 5 +- + src/getfd.c | 97 ------------------------------------ + src/main.c | 6 ++ + src/test-tty-idle-monitor.c | 12 +---- + src/test-vt-monitor.c | 83 +++++++++++++++++++++++++++++++ + 8 files changed, 230 insertions(+), 112 deletions(-) + +commit bec4b4163ae65fa271845da6b748456346987c26 +Author: William Jon McCann <mccann@jhu.edu> +Date: Fri Aug 17 11:54:21 2007 -0400 + + oops add docs for new seat interfaces + + doc/spec/ck-seat.xml | 41 +++++++++++++++++++++++++++++++++++++++++ + doc/xml/ref-ck-seat.xml | 33 +++++++++++++++++++++++---------- + 2 files changed, 64 insertions(+), 10 deletions(-) + +commit c0c74f8064392598cd29401142804fcc241841ed +Author: William Jon McCann <mccann@jhu.edu> +Date: Fri Aug 17 10:52:19 2007 -0400 + + a few fixes for peer cred stuff + + src/ck-sysdeps-unix.c | 26 ++++++++++++++++++++------ + tools/ck-get-x11-display-device.c | 13 ++++++------- + tools/ck-get-x11-server-pid.c | 4 +++- + 3 files changed, 29 insertions(+), 14 deletions(-) + +commit 577099aea3ed75c1298d7a4cfa32784a1800bb09 +Author: William Jon McCann <mccann@jhu.edu> +Date: Thu Aug 16 23:09:44 2007 -0400 + + move peercred stuff into sysdeps. add solaris support. + + configure.ac | 2 + + src/Makefile.am | 1 + + src/ck-sysdeps-unix.c | 84 + +++++++++++++++++++++++++++++++++++++ + src/ck-sysdeps.h | 7 +++ + tools/ck-get-x11-display-device.c | 34 ++------------- + tools/ck-get-x11-server-pid.c | 31 ++++---------- + 6 files changed, 107 insertions(+), 52 deletions(-) + +commit fcb0f32632f74950c361a0a23128ebca05efdca0 +Author: William Jon McCann <mccann@jhu.edu> +Date: Thu Aug 16 22:29:18 2007 -0400 + + move all proc stuff into ck-sysdeps + + src/Makefile.am | 23 +- + src/ck-manager.c | 52 ++-- + src/ck-sysdeps-linux.c | 605 + +++++++++++++++++++++++++++++++++++++ + src/ck-sysdeps-solaris.c | 324 ++++++++++++++++++++ + src/ck-sysdeps.h | 49 +++ + src/proc-linux.c | 605 + ------------------------------------- + src/proc-solaris.c | 324 -------------------- + src/proc.h | 48 --- + tools/Makefile.am | 6 +- + tools/ck-collect-session-info.c | 36 ++-- + tools/ck-get-x11-display-device.c | 18 +- + 11 files changed, 1046 insertions(+), 1044 deletions(-) + +commit e56a95f64c9c9f57adebf6cb3e6c88790cec40e4 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 14 17:03:00 2007 -0400 + + move tools out of linux subdirectory since they apparently work + on solaris + + tools/.gitignore | 3 + + tools/Makefile.am | 36 +++ + tools/ck-collect-session-info.c | 410 + +++++++++++++++++++++++++++++++ + tools/ck-get-x11-display-device.c | 152 ++++++++++++ + tools/ck-get-x11-server-pid.c | 100 ++++++++ + tools/linux/Makefile.am | 32 --- + tools/linux/ck-collect-session-info.c | 410 + ------------------------------- + tools/linux/ck-get-x11-display-device.c | 152 ------------ + tools/linux/ck-get-x11-server-pid.c | 100 -------- + 9 files changed, 701 insertions(+), 694 deletions(-) + +commit dc97e6caabc9932922d26f3400424626462f5ad2 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 14 16:55:24 2007 -0400 + + make a lt library for proc stuff + + src/Makefile.am | 39 +++++++++++++++++++++++++-------------- + tools/linux/Makefile.am | 7 +++---- + 2 files changed, 28 insertions(+), 18 deletions(-) + +commit e6cf0e022d391154baed5ec30e857baffe52b437 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 14 12:30:34 2007 -0400 + + remove example device from seat config + + data/00-primary.seat | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d4033604529b64156d5dd0f03fbe733ec7ae8246 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 14 12:12:38 2007 -0400 + + make sure the device is a console and add some instructions + + src/test-tty-idle-monitor.c | 44 + +++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 44 insertions(+), 0 deletions(-) + +commit 396363e70765af215f7302964ac9543305733a2b +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 14 11:59:37 2007 -0400 + + don't bail if /proc/self/fd/0 is not a link + + src/test-tty-idle-monitor.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +commit 383ea823871bf3768e85d1a3ca061e775c6aedf1 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 14 11:50:54 2007 -0400 + + add some solaris support + + Based on a patch from Brian Cameron. + + configure.ac | 2 + + src/Makefile.am | 9 ++ + src/getfd.c | 20 +++- + src/proc-solaris.c | 324 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 352 insertions(+), 3 deletions(-) + +commit e054c0f8b86f27f94d9316bac065a94081f4be32 +Author: William Jon McCann <mccann@jhu.edu> +Date: Wed Aug 8 16:07:01 2007 -0400 + + print out tools libs after configure + + configure.ac | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 03590bfe7cc0346c9a36ee01fd3737aa009f0273 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 7 11:21:47 2007 -0400 + + don't use PERROR if not available + + src/ck-log.c | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +commit 90e87a110c648cb93c2bde0ace9626d5ce58167a +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Aug 7 11:21:31 2007 -0400 + + don't use stderr or stdout as variable names + + src/ck-job.c | 22 +++++++++++----------- + 1 files changed, 11 insertions(+), 11 deletions(-) + +commit 488520e5c0d7d3684f7c91f11da52e9ef08d42c9 +Author: William Jon McCann <mccann@jhu.edu> +Date: Wed Aug 1 10:44:21 2007 -0400 + + change user to unix-user + + libck-connector/test-connector.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d7d77af48ae9dbacde77d9337fe3a202d23467a6 +Author: William Jon McCann <mccann@jhu.edu> +Date: Wed Aug 1 10:42:44 2007 -0400 + + use unix-user instead of user + + libck-connector/ck-connector.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 289fff6aaaa206572efa768c4063111582d79f9d +Author: William Jon McCann <mccann@jhu.edu> +Date: Fri Jul 20 17:42:01 2007 -0400 + + Add preliminary support for seats with devices + + data/00-primary.seat | 5 + + data/Makefile.am | 4 + + src/ck-manager.c | 54 ++++++++++++- + src/ck-seat.c | 219 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/ck-seat.h | 36 +++++++-- + src/ck-seat.xml | 9 ++ + 6 files changed, 319 insertions(+), 8 deletions(-) + +commit f6027221567fcb9ead1823e2da4eb9783f2db9ce +Author: William Jon McCann <mccann@jhu.edu> +Date: Fri Jul 20 17:41:32 2007 -0400 + + Add --display option to tool. + + tools/linux/ck-get-x11-display-device.c | 22 ++++++++++++++++++---- + 1 files changed, 18 insertions(+), 4 deletions(-) + +commit a9aa00ff0fea79452a60a2448dd1f2714918884a +Author: William Jon McCann <mccann@jhu.edu> +Date: Wed Jul 18 17:24:00 2007 -0400 + + Add new helper for getting tty from DISPLAY + + tools/linux/Makefile.am | 11 +++ + tools/linux/ck-get-x11-display-device.c | 138 + +++++++++++++++++++++++++++++++ + 2 files changed, 149 insertions(+), 0 deletions(-) + +commit 17ff9ceb88e0b7f6dc5a7e6eac5ff98cb4a5cabe +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue May 15 11:15:12 2007 -0400 + + a few fixes for getfd suggested by Lennart + + I am currently investigating how to best integrate PulseAudio with + ConsoleKit/PolicyKit. While doing that I had a look on your code, and + found a few issues in getfd.c I'd like to report, before I forget + them. I couldn't find any bugzilla with at consolekit project (neither + fedora, nor fdo, nor gnome?) hence I am mailing you in person. + + In getfd.c in open_a_console() a close() is missing if is_a_console is + missing. + + The open() in open_a_console() should probably use O_NOCTTY. Otherwise + C-c on the console might end up in a SIGINT to your daemon process! + + Also I'd add an isatty() check to is_a_console(), to makes sure that + you're actually talking to a TTY before you issue KDGKBTYPE on + it. ioctl()s are unfortunately not unique, hence i'd recommend + that check. + + That's it, + + Lennart + + src/getfd.c | 16 ++++++++++++---- + 1 files changed, 12 insertions(+), 4 deletions(-) + +commit fe29cc406719428bcc73d980299e4639a9bb37f1 +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Apr 10 16:03:19 2007 -0400 + + bump version + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 2626a4405d19da40b98d526668bee7c92072e43b +Author: William Jon McCann <mccann@jhu.edu> +Date: Tue Apr 10 16:01:15 2007 -0400 + + update for release + + NEWS | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + commit c6cd8d7c66b2bd39edf7ca70948982a553128282 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Apr 10 15:54:31 2007 -0400 +Date: Tue Apr 10 15:54:31 2007 -0400 disable static libs @@ -9,20 +574,20 @@ Date: Tue Apr 10 15:54:31 2007 -0400 commit e0244a8f6dd0b7f8ebecc6bec52c013ce5286279 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Apr 5 15:21:14 2007 -0400 +Date: Thu Apr 5 15:21:14 2007 -0400 use inotify to detect activity on tty when possible - .gitignore | 3 +- - configure.ac | 26 ++- - doc/.gitignore | 1 + - src/.gitignore | 1 + - src/Makefile.am | 32 ++ + .gitignore | 3 +- + configure.ac | 26 ++- + doc/.gitignore | 1 + + src/.gitignore | 1 + + src/Makefile.am | 32 ++ src/ck-file-monitor-dummy.c | 118 ++++++++ src/ck-file-monitor-inotify.c | 669 +++++++++++++++++++++++++++++++++++++++++ - src/ck-file-monitor.h | 84 +++++ - src/ck-session.c | 82 ++---- + src/ck-file-monitor.h | 84 +++++ + src/ck-session.c | 82 ++---- src/ck-tty-idle-monitor.c | 389 ++++++++++++++++++++++++ src/ck-tty-idle-monitor.h | 71 +++++ src/test-tty-idle-monitor.c | 82 +++++ @@ -30,47 +595,47 @@ Date: Thu Apr 5 15:21:14 2007 -0400 commit 33dcd02c399e3255a7a64c1e90b258d79c14f2c4 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Apr 4 12:06:59 2007 -0400 +Date: Wed Apr 4 12:06:59 2007 -0400 fix typos - pam-ck-connector/pam_ck_connector.8 | 4 ++-- + pam-ck-connector/pam_ck_connector.8 | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit c012fdf98a19e9e3d67a64ed308943a04c355dc8 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Apr 4 12:04:16 2007 -0400 +Date: Wed Apr 4 12:04:16 2007 -0400 add support for CKCON_X11_DISPLAY_DEVICE environment variable In order to set the x11-display-device parameter on the new session. - pam-ck-connector/pam-ck-connector.c | 13 +++++++++++++ - pam-ck-connector/pam_ck_connector.8 | 19 ++++++++++--------- + pam-ck-connector/pam-ck-connector.c | 13 +++++++++++++ + pam-ck-connector/pam_ck_connector.8 | 19 ++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) commit 42f6afb560859bf0dab898ae4c8f6d23070ef268 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Apr 3 14:48:36 2007 -0400 +Date: Tue Apr 3 14:48:36 2007 -0400 make sure no values are NULL - pam-ck-connector/pam-ck-connector.c | 8 ++++++++ + pam-ck-connector/pam-ck-connector.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) commit bf9a5070a715f129e1182af149a46e55529edb61 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Apr 3 14:38:33 2007 -0400 +Date: Tue Apr 3 14:38:33 2007 -0400 check for empty string as well as null values - pam-ck-connector/pam-ck-connector.c | 17 +++++++++++------ + pam-ck-connector/pam-ck-connector.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) commit 8b1733abb942b4356485b4afcf1dc3bf04d1fedc Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Apr 3 12:25:41 2007 -0400 +Date: Tue Apr 3 12:25:41 2007 -0400 add some input validation @@ -79,58 +644,58 @@ Date: Tue Apr 3 12:25:41 2007 -0400 commit f073826f58541cbbe2b805f200a9d245d76c634c Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Apr 3 12:25:18 2007 -0400 +Date: Tue Apr 3 12:25:18 2007 -0400 daemonize a little earlier - src/main.c | 8 ++++---- + src/main.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) commit 80dc652115e275a95b05bb6809825cc324d9475a Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Apr 3 11:42:43 2007 -0400 +Date: Tue Apr 3 11:42:43 2007 -0400 add a glib message to syslog handler Also add ability to toggle debugging when SIGUSR1 is received. - src/Makefile.am | 4 +- - src/ck-debug.c | 153 --------------------------------------- - src/ck-debug.h | 72 ------------------- - src/ck-job.c | 21 +++--- - src/ck-log.c | 197 + src/Makefile.am | 4 +- + src/ck-debug.c | 153 --------------------------------------- + src/ck-debug.h | 72 ------------------- + src/ck-job.c | 21 +++--- + src/ck-log.c | 197 +++++++++++++++++++++++++++++++++++++++++++++++++++ - src/ck-log.h | 41 +++++++++++ - src/ck-manager.c | 41 +++++------ - src/ck-seat.c | 21 +++--- - src/ck-session.c | 31 ++++---- - src/ck-vt-monitor.c | 30 +++----- - src/main.c | 66 +++++++++++++++-- + src/ck-log.h | 41 +++++++++++ + src/ck-manager.c | 41 +++++------ + src/ck-seat.c | 21 +++--- + src/ck-session.c | 31 ++++---- + src/ck-vt-monitor.c | 30 +++----- + src/main.c | 66 +++++++++++++++-- 11 files changed, 366 insertions(+), 311 deletions(-) commit 02b7dac1de29b7e323d9457f14b639582d0a2e04 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Apr 3 11:40:47 2007 -0400 +Date: Tue Apr 3 11:40:47 2007 -0400 bump the ac_prereq and use the docdir var - configure.ac | 16 +--------------- + configure.ac | 16 +--------------- doc/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) commit b5c2e362c3ae4c932f4acdba13e53d80f63b1777 Author: David Zeuthen <davidz@redhat.com> -Date: Mon Apr 2 18:38:51 2007 -0400 +Date: Mon Apr 2 18:38:51 2007 -0400 daemonize properly - src/main.c | 3 +-- + src/main.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) commit b57d5c11612dbb896c53d65c01104bae586f6e17 Author: Michael Biebl <mbiebl@gmail.com> -Date: Mon Apr 2 16:16:16 2007 -0400 +Date: Mon Apr 2 16:16:16 2007 -0400 autoconf fixes, separate pamlibdir variable, path expansion at make time @@ -155,20 +720,20 @@ Date: Mon Apr 2 16:16:16 2007 -0400 Patch is tested and make distcheck works. - acinclude.m4 | 44 ---------- - configure.ac | 152 + acinclude.m4 | 44 ---------- + configure.ac | 152 ++++++++++++++++++------------------ - data/ConsoleKit.in | 10 +- - data/Makefile.am | 13 +++ - libck-connector/Makefile.am | 3 +- - libck-connector/ck-connector.pc.in | 2 +- - pam-ck-connector/Makefile.am | 3 +- - src/Makefile.am | 1 + + data/ConsoleKit.in | 10 +- + data/Makefile.am | 13 +++ + libck-connector/Makefile.am | 3 +- + libck-connector/ck-connector.pc.in | 2 +- + pam-ck-connector/Makefile.am | 3 +- + src/Makefile.am | 1 + 8 files changed, 99 insertions(+), 129 deletions(-) commit 86740ea242d0b26758e8a8c43904a0fc88a195f6 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Apr 2 15:36:30 2007 -0400 +Date: Mon Apr 2 15:36:30 2007 -0400 add unix-user to parse list @@ -179,18 +744,18 @@ Date: Mon Apr 2 15:36:30 2007 -0400 commit 41c329309a5c78d31495f97b2f4324a462c60568 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Apr 2 14:00:37 2007 -0400 +Date: Mon Apr 2 14:00:37 2007 -0400 add missing prefix and exec_prefix Apparently this is required. - libck-connector/ck-connector.pc.in | 2 ++ + libck-connector/ck-connector.pc.in | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) commit 5f3b3a7aec1c2ef81dfe28d6167049ef82e81860 Author: Doug Goldstein <cardoe@gentoo.org> -Date: Fri Mar 30 16:59:21 2007 -0400 +Date: Fri Mar 30 16:59:21 2007 -0400 make pam module install into $slibdir @@ -203,61 +768,61 @@ Date: Fri Mar 30 16:59:21 2007 -0400 commit a2b51f00af2143a90138c6ce1df1e7e9b4ec8afa Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 26 14:39:44 2007 -0400 +Date: Mon Mar 26 14:39:44 2007 -0400 use xlib directly instead of via gdk - configure.ac | 5 ++- - tools/linux/ck-get-x11-server-pid.c | 39 + configure.ac | 5 ++- + tools/linux/ck-get-x11-server-pid.c | 39 ++++++++++++++++++++++++++++------ 2 files changed, 35 insertions(+), 9 deletions(-) commit 4c365a8e28adafd6619ada97d4239e9e6df429ab Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 19 16:35:55 2007 -0400 +Date: Mon Mar 19 16:35:55 2007 -0400 add CanActivateSessions to Seat interface And associated documentation and added to test-fus. - doc/spec/ck-seat.xml | 12 ++++++++++++ - doc/xml/ck-design.xml | 9 +++++++++ + doc/spec/ck-seat.xml | 12 ++++++++++++ + doc/xml/ck-design.xml | 9 +++++++++ doc/xml/ref-ck-seat.xml | 12 +++++++----- - src/ck-seat.c | 14 ++++++++++++++ - src/ck-seat.h | 32 ++++++++++++++++---------------- - src/ck-seat.xml | 3 +++ - src/test-fus | 6 ++++++ + src/ck-seat.c | 14 ++++++++++++++ + src/ck-seat.h | 32 ++++++++++++++++---------------- + src/ck-seat.xml | 3 +++ + src/test-fus | 6 ++++++ 7 files changed, 67 insertions(+), 21 deletions(-) commit c40a87c622ac1543dc2d9cdccc651e33affadcfa Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Mar 15 14:04:05 2007 -0400 +Date: Thu Mar 15 14:04:05 2007 -0400 fix missed pam_syslog change Also make the configure checks simpler. - configure.ac | 5 ++--- - pam-ck-connector/pam-ck-connector.c | 6 +++--- + configure.ac | 5 ++--- + pam-ck-connector/pam-ck-connector.c | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) commit 4a947eddfad4f384bb02c8e4771a59a7ad01cd8b Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Mar 15 12:55:15 2007 -0400 +Date: Thu Mar 15 12:55:15 2007 -0400 fix building pam module on debian systems Only include what is available. Use a alternative to pam_syslog if it isn't available. - configure.ac | 3 + - pam-ck-connector/pam-ck-connector.c | 101 + configure.ac | 3 + + pam-ck-connector/pam-ck-connector.c | 101 ++++++++++++++++++++++++++++++----- 2 files changed, 90 insertions(+), 14 deletions(-) commit 54ad2d581ce690060a29fa8a4b94bf5dddbafc87 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Mar 15 10:05:37 2007 -0400 +Date: Thu Mar 15 10:05:37 2007 -0400 more typos in docs @@ -266,7 +831,7 @@ Date: Thu Mar 15 10:05:37 2007 -0400 commit ac2061bfcbf5c38b6f82b307479064cd73274a9f Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Mar 15 01:48:34 2007 -0400 +Date: Thu Mar 15 01:48:34 2007 -0400 typo @@ -275,7 +840,7 @@ Date: Thu Mar 15 01:48:34 2007 -0400 commit 2f434135af56d627a887c3cdc24020c4d9ecbde4 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Mar 14 23:35:58 2007 -0400 +Date: Wed Mar 14 23:35:58 2007 -0400 bump version @@ -284,7 +849,7 @@ Date: Wed Mar 14 23:35:58 2007 -0400 commit fee1f37461cd1e0abc479f263ecfd3e3570daa53 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Mar 14 23:33:51 2007 -0400 +Date: Wed Mar 14 23:33:51 2007 -0400 update for release @@ -293,7 +858,7 @@ Date: Wed Mar 14 23:33:51 2007 -0400 commit e8fbb76428bbaae2525347cddda8a2f526970451 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Mar 14 23:21:33 2007 -0400 +Date: Wed Mar 14 23:21:33 2007 -0400 bump the version arbitrarily @@ -302,7 +867,7 @@ Date: Wed Mar 14 23:21:33 2007 -0400 commit a6f9d78d526892da92fdeef9bacd70ea6271b038 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Mar 14 23:21:08 2007 -0400 +Date: Wed Mar 14 23:21:08 2007 -0400 update todo @@ -311,19 +876,19 @@ Date: Wed Mar 14 23:21:08 2007 -0400 commit 2e415f120e7652da842632cc822faa9bb16294f6 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Mar 14 23:18:13 2007 -0400 +Date: Wed Mar 14 23:18:13 2007 -0400 add some more docs - doc/xml/ck-design.xml | 166 + doc/xml/ck-design.xml | 166 +++++++++++++++++++++++++++++++++++++++++++ - doc/xml/ck-introduction.xml | 2 + - doc/xml/ck-terms.xml | 49 ++++++++++++- + doc/xml/ck-introduction.xml | 2 + + doc/xml/ck-terms.xml | 49 ++++++++++++- 3 files changed, 213 insertions(+), 4 deletions(-) commit 314b18ca8045eda3c48c0e7a5f2c0e26635ce5b8 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Mar 14 09:22:20 2007 -0400 +Date: Wed Mar 14 09:22:20 2007 -0400 add missing instead attribute @@ -332,18 +897,18 @@ Date: Wed Mar 14 09:22:20 2007 -0400 commit 2f4b6ef24431fc9c4997e535f8b5e126eb5ae3db Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Mar 14 08:46:08 2007 -0400 +Date: Wed Mar 14 08:46:08 2007 -0400 don't include the generated html in git - doc/ConsoleKit.html | 317 + doc/ConsoleKit.html | 317 --------------------------------------------------- - doc/Makefile.am | 1 - + doc/Makefile.am | 1 - 2 files changed, 0 insertions(+), 318 deletions(-) commit f1ad1ddf9cd5898b4bca3875a698a9628313eb19 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Mar 14 08:45:44 2007 -0400 +Date: Wed Mar 14 08:45:44 2007 -0400 dont' mark the user properties to be set in the constructor @@ -358,111 +923,111 @@ Date: Wed Mar 14 08:45:44 2007 -0400 commit c01153022b0fa850bd10503141ff081749f01d4d Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 13 17:29:46 2007 -0400 +Date: Tue Mar 13 17:29:46 2007 -0400 missed a namespace on the permission tag - doc/ConsoleKit.html | 132 + doc/ConsoleKit.html | 132 ++++++++++++++++++++++---------------------- - doc/spec/ck-session.xml | 4 +- - doc/xml/ref-ck-session.xml | 4 +- + doc/spec/ck-session.xml | 4 +- + doc/xml/ref-ck-session.xml | 4 +- 3 files changed, 70 insertions(+), 70 deletions(-) commit 4a531bc467c9a142cb2d05792e6f9e9330c199ff Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 13 15:20:37 2007 -0400 +Date: Tue Mar 13 15:20:37 2007 -0400 updated doc dtd - doc/ConsoleKit.html | 128 + doc/ConsoleKit.html | 128 +++++++++++++++++++++--------------------- doc/dbus-introspect-docs.dtd | 2 +- 2 files changed, 65 insertions(+), 65 deletions(-) commit 608080a2f755254a590b4d052451461294fbcee4 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 13 14:34:32 2007 -0400 +Date: Tue Mar 13 14:34:32 2007 -0400 add a new configure option --with-slibdir to use for connector Turns out that just using libdir breaks the .pc file install. - configure.ac | 15 +++++++++++++++ - libck-connector/Makefile.am | 3 ++- - libck-connector/ck-connector.pc.in | 2 +- + configure.ac | 15 +++++++++++++++ + libck-connector/Makefile.am | 3 ++- + libck-connector/ck-connector.pc.in | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) commit 0f1d6b3b234a1f8d8c6b9dff38388ab58f695b64 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 13 13:50:58 2007 -0400 +Date: Tue Mar 13 13:50:58 2007 -0400 deprecate the user properties and add unix-user properties Also added deprecated notes to the docs. New code should be using GetUnixUser instead of GetUser etc. - doc/ConsoleKit.html | 141 + doc/ConsoleKit.html | 141 +++++++++++++++++++-------------- - doc/dbus-introspect-docs.dtd | 2 +- - doc/spec/ck-manager.xml | 22 +++++ - doc/spec/ck-session.xml | 21 +++++ - doc/tools/spec-to-docbook.xsl | 75 +++++++++++++++-- - doc/xml/ref-ck-manager.xml | 15 +++- - doc/xml/ref-ck-session.xml | 24 +++++- - src/ck-manager.c | 25 ++++-- - src/ck-manager.h | 4 + - src/ck-manager.xml | 5 + - src/ck-session.c | 44 ++++++++-- - src/ck-session.h | 8 ++- - src/ck-session.xml | 4 + + doc/dbus-introspect-docs.dtd | 2 +- + doc/spec/ck-manager.xml | 22 +++++ + doc/spec/ck-session.xml | 21 +++++ + doc/tools/spec-to-docbook.xsl | 75 +++++++++++++++-- + doc/xml/ref-ck-manager.xml | 15 +++- + doc/xml/ref-ck-session.xml | 24 +++++- + src/ck-manager.c | 25 ++++-- + src/ck-manager.h | 4 + + src/ck-manager.xml | 5 + + src/ck-session.c | 44 ++++++++-- + src/ck-session.h | 8 ++- + src/ck-session.xml | 4 + tools/linux/ck-collect-session-info.c | 2 +- - tools/list-sessions.c | 2 +- + tools/list-sessions.c | 2 +- 15 files changed, 295 insertions(+), 99 deletions(-) commit 921b5e02edf59117b64385edbe4d191819d90abd Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 13 12:11:04 2007 -0400 +Date: Tue Mar 13 12:11:04 2007 -0400 add more doc stubs - doc/ConsoleKit.html | 122 + doc/ConsoleKit.html | 122 +++++++++++++++++++++++-------------------- - doc/ConsoleKit.xml.in | 4 ++ - doc/Makefile.am | 2 + - doc/xml/ck-design.xml | 5 ++ - doc/xml/ck-introduction.xml | 6 ++ - doc/xml/ck-terms.xml | 26 +++++++++ + doc/ConsoleKit.xml.in | 4 ++ + doc/Makefile.am | 2 + + doc/xml/ck-design.xml | 5 ++ + doc/xml/ck-introduction.xml | 6 ++ + doc/xml/ck-terms.xml | 26 +++++++++ 6 files changed, 108 insertions(+), 57 deletions(-) commit 4a639d92a6f1a5dd8f59d57ade37d4cff420b66a Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 13 11:41:31 2007 -0400 +Date: Tue Mar 13 11:41:31 2007 -0400 various leak fixes src/ck-manager.c | 38 +++++++++++++++++++++++++++++++++++--- - src/ck-seat.c | 15 +++++++++++---- + src/ck-seat.c | 15 +++++++++++---- src/ck-session.c | 32 +++++++++++++++++++------------- - src/main.c | 4 +++- + src/main.c | 4 +++- 4 files changed, 68 insertions(+), 21 deletions(-) commit 1e7af7e9c648fb461e0d36d037d2920519159525 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 13 10:05:31 2007 -0400 +Date: Tue Mar 13 10:05:31 2007 -0400 convert to utf8 and xhtml output Seems to fix some problems with invalid characters showing up. - doc/ConsoleKit.html | 122 + doc/ConsoleKit.html | 122 +++++++++++++++++++++-------------------- - doc/Makefile.am | 2 +- + doc/Makefile.am | 2 +- doc/tools/spec-to-docbook.xsl | 2 +- 3 files changed, 64 insertions(+), 62 deletions(-) commit 8b42a4928a0a266c3b3ae6bb13997764bc7f6405 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 13 03:42:04 2007 -0400 +Date: Tue Mar 13 03:42:04 2007 -0400 add the last bits of spec framework @@ -470,19 +1035,19 @@ Date: Tue Mar 13 03:42:04 2007 -0400 docs. There are tools to build docbook and strip the docs to make dbus introspect xml. - doc/ConsoleKit.html | 336 +++++++++++++++++++++++++++-------- - doc/ConsoleKit.xml.in | 9 +- - doc/Makefile.am | 8 +- + doc/ConsoleKit.html | 336 +++++++++++++++++++++++++++-------- + doc/ConsoleKit.xml.in | 9 +- + doc/Makefile.am | 8 +- doc/ck-introduction.xml | 23 --- doc/dbus-introspect-docs.dtd | 31 ++++ - doc/docbook-dbus.xsl | 261 --------------------------- - doc/docbook.css | 5 + + doc/docbook-dbus.xsl | 261 --------------------------- + doc/docbook.css | 5 + doc/docize-dbus-xml.sh | 34 ---- doc/ref-ck-manager.xml | 181 ------------------- - doc/ref-ck-seat.xml | 111 ------------ + doc/ref-ck-seat.xml | 111 ------------ doc/ref-ck-session.xml | 350 ----------------------------------- doc/spec/ck-manager.xml | 286 +++++++++++++++++++++++++++++ - doc/spec/ck-seat.xml | 110 +++++++++++ + doc/spec/ck-seat.xml | 110 +++++++++++ doc/spec/ck-session.xml | 401 +++++++++++++++++++++++++++++++++++++++++ doc/tools/spec-strip-docs | 34 ++++ @@ -495,52 +1060,52 @@ Date: Tue Mar 13 03:42:04 2007 -0400 doc/xml/ref-ck-manager.xml | 174 ++++++++++++++++++ doc/xml/ref-ck-seat.xml | 72 ++++++++ doc/xml/ref-ck-session.xml | 240 ++++++++++++++++++++++++ - src/ck-manager.xml | 16 +-- - src/ck-seat.xml | 14 +- - src/ck-session.xml | 11 +- + src/ck-manager.xml | 16 +-- + src/ck-seat.xml | 14 +- + src/ck-session.xml | 11 +- 26 files changed, 2131 insertions(+), 1070 deletions(-) commit 4595ab3d4953d6257a6fedfe5b294df67ff3581f Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 13 03:39:52 2007 -0400 +Date: Tue Mar 13 03:39:52 2007 -0400 install the connector into libdir by default If building the PAM module then it probably should be going - into /lib. However, hardcoding /lib makes it very difficult + into /lib. However, hardcoding /lib makes it very difficult to build as non-root, breaks make distcheck, and probably isn't correct for 64 bit systems. If you are a distro you should probably configure using --libdir=/lib. - libck-connector/Makefile.am | 3 +-- - libck-connector/ck-connector.pc.in | 2 +- + libck-connector/Makefile.am | 3 +-- + libck-connector/ck-connector.pc.in | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) commit 29437f4aa9bd1bab54bde41cb1f6301803a2632e Author: William Jon McCann <mccann@jhu.edu> -Date: Sat Mar 10 18:02:29 2007 -0500 +Date: Sat Mar 10 18:02:29 2007 -0500 regenerate docs - doc/ConsoleKit.html | 72 + doc/ConsoleKit.html | 72 ++++++++++++++++++++++++------------------------ doc/ref-ck-session.xml | 36 ++++++++++++------------ 2 files changed, 54 insertions(+), 54 deletions(-) commit 6ce9a74f69f611bc5aeeb57a4bf9efea19774938 Author: William Jon McCann <mccann@jhu.edu> -Date: Sat Mar 10 17:05:06 2007 -0500 +Date: Sat Mar 10 17:05:06 2007 -0500 add the generated doc html - doc/.gitignore | 1 - - doc/ConsoleKit.html | 96 + doc/.gitignore | 1 - + doc/ConsoleKit.html | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletions(-) commit 50ff6eda31c06cea4e3b8010d114e66cfdb3f6e6 Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Mar 9 13:51:21 2007 -0500 +Date: Fri Mar 9 13:51:21 2007 -0500 give root permission to use the property interface @@ -549,27 +1114,27 @@ Date: Fri Mar 9 13:51:21 2007 -0500 commit 093539956ac0a5092a5fdc39f8b27475071032c4 Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Mar 9 13:50:10 2007 -0500 +Date: Fri Mar 9 13:50:10 2007 -0500 fix the user prop type - src/ck-session.xml | 18 +++++++++--------- + src/ck-session.xml | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) commit c8dbc4b6a38b99ed192f5ed2f73f57014a49d50a Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Mar 9 12:36:09 2007 -0500 +Date: Fri Mar 9 12:36:09 2007 -0500 add a few more parameters to session idl doc/ref-ck-session.xml | 90 +++++++++++++++++++++++++++++++++++++++++++++++- - src/ck-session.xml | 8 ++++ + src/ck-session.xml | 8 ++++ 2 files changed, 97 insertions(+), 1 deletions(-) commit d5061bf16725bc711f7ddcff02e77a94014107f5 Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Mar 9 12:35:30 2007 -0500 +Date: Fri Mar 9 12:35:30 2007 -0500 add uuid to cookie @@ -578,7 +1143,7 @@ Date: Fri Mar 9 12:35:30 2007 -0500 commit 1d72374535de222cb816c74506555c71af10d429 Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Mar 9 11:40:59 2007 -0500 +Date: Fri Mar 9 11:40:59 2007 -0500 add a tool to autogenerate dbus object ref docs @@ -587,26 +1152,26 @@ Date: Fri Mar 9 11:40:59 2007 -0500 Still need to add support for comments and actual descriptions ala gtk-doc. - doc/ConsoleKit.xml.in | 10 ++- - doc/Makefile.am | 6 +- + doc/ConsoleKit.xml.in | 10 ++- + doc/Makefile.am | 6 +- doc/ck-dbus-manager.xml | 52 --------- - doc/ck-dbus-seat.xml | 39 ------- + doc/ck-dbus-seat.xml | 39 ------- doc/ck-dbus-session.xml | 55 ---------- - doc/docbook-dbus.xsl | 261 + doc/docbook-dbus.xsl | 261 ++++++++++++++++++++++++++++++++++++++++++++++ doc/docize-dbus-xml.sh | 34 ++++++ doc/ref-ck-manager.xml | 181 ++++++++++++++++++++++++++++++++ - doc/ref-ck-seat.xml | 111 ++++++++++++++++++++ + doc/ref-ck-seat.xml | 111 ++++++++++++++++++++ doc/ref-ck-session.xml | 262 +++++++++++++++++++++++++++++++++++++++++++++++ - src/ck-manager.xml | 12 ++- - src/ck-seat.xml | 12 ++- - src/ck-session.xml | 9 ++- + src/ck-manager.xml | 12 ++- + src/ck-seat.xml | 12 ++- + src/ck-session.xml | 9 ++- 13 files changed, 884 insertions(+), 160 deletions(-) commit 15ad40c8d8abd86a4b83e445031fd467406b45d8 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Mar 8 22:09:41 2007 -0500 +Date: Thu Mar 8 22:09:41 2007 -0500 tweak the css for the docs @@ -617,40 +1182,40 @@ Date: Thu Mar 8 22:09:41 2007 -0500 commit 54246537dfdcb89ee34dfbaa8b909b94ae2845b9 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Mar 8 21:24:25 2007 -0500 +Date: Thu Mar 8 21:24:25 2007 -0500 update all .gitignore files - .gitignore | 1 + - libck-connector/.gitignore | 9 +++++++++ - pam-ck-connector/.gitignore | 8 ++++++++ - tools/.gitignore | 2 +- - tools/linux/.gitignore | 9 +++++++++ + .gitignore | 1 + + libck-connector/.gitignore | 9 +++++++++ + pam-ck-connector/.gitignore | 8 ++++++++ + tools/.gitignore | 2 +- + tools/linux/.gitignore | 9 +++++++++ 5 files changed, 28 insertions(+), 1 deletions(-) commit 1702970a3ea3de88f04623f69a3ab5260f77d2c5 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Mar 8 21:16:40 2007 -0500 +Date: Thu Mar 8 21:16:40 2007 -0500 add a stub for docbook documentation - Makefile.am | 1 + - configure.ac | 102 + Makefile.am | 1 + + configure.ac | 102 +++++++++++++++++++++++++++++++++-------------- - doc/.gitignore | 6 +++ - doc/ConsoleKit.xml.in | 69 +++++++++++++++++++++++++++++++ - doc/Makefile.am | 37 +++++++++++++++++ + doc/.gitignore | 6 +++ + doc/ConsoleKit.xml.in | 69 +++++++++++++++++++++++++++++++ + doc/Makefile.am | 37 +++++++++++++++++ doc/ck-dbus-manager.xml | 52 ++++++++++++++++++++++++ - doc/ck-dbus-seat.xml | 39 ++++++++++++++++++ + doc/ck-dbus-seat.xml | 39 ++++++++++++++++++ doc/ck-dbus-session.xml | 55 +++++++++++++++++++++++++ doc/ck-introduction.xml | 23 +++++++++++ - doc/config.xsl | 6 +++ - doc/docbook.css | 18 ++++++++ + doc/config.xsl | 6 +++ + doc/docbook.css | 18 ++++++++ 11 files changed, 378 insertions(+), 30 deletions(-) commit ef7ee407bc58ea24db828cad9e1e7d628e322067 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Mar 8 21:06:55 2007 -0500 +Date: Thu Mar 8 21:06:55 2007 -0500 prevent the use of the glib properties interface @@ -662,7 +1227,7 @@ Date: Thu Mar 8 21:06:55 2007 -0500 commit f4173a08a83db8879ae9c82356f7a9702cb4f883 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Mar 7 14:53:01 2007 -0500 +Date: Wed Mar 7 14:53:01 2007 -0500 update todo @@ -671,7 +1236,7 @@ Date: Wed Mar 7 14:53:01 2007 -0500 commit ef83e4007f375db0ee8f240d2bf292331a5a76cb Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 6 18:46:25 2007 -0500 +Date: Tue Mar 6 18:46:25 2007 -0500 remove debug noise @@ -680,7 +1245,7 @@ Date: Tue Mar 6 18:46:25 2007 -0500 commit 701349f1ad564242c143cab6773dde0de6396db8 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 6 18:32:49 2007 -0500 +Date: Tue Mar 6 18:32:49 2007 -0500 add very basic idle monitoring of text sessions and rework parameter parsing @@ -688,28 +1253,28 @@ Date: Tue Mar 6 18:32:49 2007 -0500 Rework the parameter parsing so it is a bit more robust and so that parameters can get passed to the constructor. - src/ck-session.c | 223 + src/ck-session.c | 223 +++++++++++++++++++++++++++++---- src/test-open-session-with-parameters | 5 +- 2 files changed, 205 insertions(+), 23 deletions(-) commit dc5e9585215f34ec78b68fbb6da990a90d8f3a1b Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 6 16:07:24 2007 -0500 +Date: Tue Mar 6 16:07:24 2007 -0500 use paths.h if available - configure.ac | 2 ++ - pam-ck-connector/pam-ck-connector.c | 14 ++++++++++++-- - pam-ck-connector/test-pam.c | 8 +++++++- - src/ck-seat.c | 11 +++++++++-- - src/getfd.c | 28 +++++++++++++++++++++------- - src/proc-linux.c | 10 +++++++--- + configure.ac | 2 ++ + pam-ck-connector/pam-ck-connector.c | 14 ++++++++++++-- + pam-ck-connector/test-pam.c | 8 +++++++- + src/ck-seat.c | 11 +++++++++-- + src/getfd.c | 28 +++++++++++++++++++++------- + src/proc-linux.c | 10 +++++++--- 6 files changed, 58 insertions(+), 15 deletions(-) commit ce4ee7b54d40faf13e005285e5b85a061f21e256 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 6 15:36:56 2007 -0500 +Date: Tue Mar 6 15:36:56 2007 -0500 add some items in a TODO file @@ -718,25 +1283,25 @@ Date: Tue Mar 6 15:36:56 2007 -0500 commit 96d209ea26485c6b6f23a469ee1d2db672e6697a Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 6 15:01:07 2007 -0500 +Date: Tue Mar 6 15:01:07 2007 -0500 exit if we can't acquire name at startup and fix a glib warning - src/main.c | 41 ++++++++++++++++++++++++++++++++--------- + src/main.c | 41 ++++++++++++++++++++++++++++++++--------- 1 files changed, 32 insertions(+), 9 deletions(-) commit 98ea3604c92a4c0317d2f9626f097bc384caf70a Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 6 02:32:10 2007 -0500 +Date: Tue Mar 6 02:32:10 2007 -0500 add is-local back to the pam module - pam-ck-connector/pam-ck-connector.c | 4 ++++ + pam-ck-connector/pam-ck-connector.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) commit 699923e665a4606a1b3f6822e4e4917f86a2a713 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 6 02:31:45 2007 -0500 +Date: Tue Mar 6 02:31:45 2007 -0500 check for empty strings as well as null @@ -745,19 +1310,19 @@ Date: Tue Mar 6 02:31:45 2007 -0500 commit d9ca86ae5acb8a4a56e875c9ad0ed617f50abf65 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 6 00:25:06 2007 -0500 +Date: Tue Mar 6 00:25:06 2007 -0500 use a slightly more sophisticated rule for adding sessions to static seat - src/ck-manager.c | 37 + src/ck-manager.c | 37 ++++++++++++++++++++++++++++---- src/test-open-session-with-parameters | 1 + 2 files changed, 33 insertions(+), 5 deletions(-) commit a3cb617b1fd3be5199c0dfc08aee0af4b04d1a8b Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Mar 6 00:24:02 2007 -0500 +Date: Tue Mar 6 00:24:02 2007 -0500 allow for the possibility of matching multiple sessions for device @@ -773,7 +1338,7 @@ Date: Tue Mar 6 00:24:02 2007 -0500 commit 08436b041d6b334a5754266b11385941a71d3f81 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 21:56:52 2007 -0500 +Date: Mon Mar 5 21:56:52 2007 -0500 add x11-display-device to parse table @@ -783,16 +1348,16 @@ Date: Mon Mar 5 21:56:52 2007 -0500 commit 5cc0ba8ec8c988d0068b07e4f67839d42b357537 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 20:36:59 2007 -0500 +Date: Mon Mar 5 20:36:59 2007 -0500 try to parse the real meaning of PAM_TTY - pam-ck-connector/pam-ck-connector.c | 10 ++++++++++ + pam-ck-connector/pam-ck-connector.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) commit 2e38a7026491595e6837fa8c02e077584fc71b71 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 19:14:14 2007 -0500 +Date: Mon Mar 5 19:14:14 2007 -0500 fix the example code @@ -801,17 +1366,17 @@ Date: Mon Mar 5 19:14:14 2007 -0500 commit a9a48c07142025841a69da6fc30c6a1fbd29727a Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 19:10:51 2007 -0500 +Date: Mon Mar 5 19:10:51 2007 -0500 use with_parameters and add remote-host-name if available - pam-ck-connector/pam-ck-connector.c | 49 + pam-ck-connector/pam-ck-connector.c | 49 +++++++++++++++++++++++++++------- 1 files changed, 39 insertions(+), 10 deletions(-) commit 0293d43731d125b825fa8962976b527bf46b65d6 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 19:10:02 2007 -0500 +Date: Mon Mar 5 19:10:02 2007 -0500 add a with_parameters function to connector @@ -823,7 +1388,7 @@ Date: Mon Mar 5 19:10:02 2007 -0500 commit d588a897fef3af61a7368226986b384fce2524e7 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 19:08:15 2007 -0500 +Date: Mon Mar 5 19:08:15 2007 -0500 rename host-name in one more place @@ -832,22 +1397,22 @@ Date: Mon Mar 5 19:08:15 2007 -0500 commit 7dfb9732b27778722214531d0c17b7e50e8a2fe1 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 15:24:56 2007 -0500 +Date: Mon Mar 5 15:24:56 2007 -0500 rename host-name to remote-host-name to make it more intuitive libck-connector/ck-connector.c | 8 ----- - src/ck-session.c | 49 + src/ck-session.c | 49 ++++++++++++++++++--------------- - src/ck-session.h | 6 ++-- - src/ck-session.xml | 4 +- + src/ck-session.h | 6 ++-- + src/ck-session.xml | 4 +- tools/linux/ck-collect-session-info.c | 12 ++++---- - tools/list-sessions.c | 12 ++++---- + tools/list-sessions.c | 12 ++++---- 6 files changed, 44 insertions(+), 47 deletions(-) commit ed0e87a5f66d88d6f388229e1bf71632bb0f1308 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 14:49:47 2007 -0500 +Date: Mon Mar 5 14:49:47 2007 -0500 add x11-display-device to ck-list-sessions @@ -856,18 +1421,18 @@ Date: Mon Mar 5 14:49:47 2007 -0500 commit 4749b0ecb6241517685a2a809695a85bd9f93432 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 14:39:07 2007 -0500 +Date: Mon Mar 5 14:39:07 2007 -0500 add two more proc sysdep functions src/proc-linux.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - src/proc.h | 4 ++++ + src/proc.h | 4 ++++ 2 files changed, 57 insertions(+), 0 deletions(-) commit 4b245b3113480d495440e1b7d32eb4dc6d564c8c Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 12:12:59 2007 -0500 +Date: Mon Mar 5 12:12:59 2007 -0500 add x11-display-device attribute @@ -875,33 +1440,33 @@ Date: Mon Mar 5 12:12:59 2007 -0500 (tty of session leader) from the x11-display-device (tty of xorg process). - src/ck-session.c | 60 ++++++++++-- - src/ck-session.h | 172 + src/ck-session.c | 60 ++++++++++-- + src/ck-session.h | 172 +++++++++++++++++---------------- - src/ck-session.xml | 3 + + src/ck-session.xml | 3 + tools/linux/ck-collect-session-info.c | 29 ++++-- 4 files changed, 164 insertions(+), 100 deletions(-) commit 67fa39aacf65117a85533035a71ee09b184003dc Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Mar 5 11:18:32 2007 -0500 +Date: Mon Mar 5 11:18:32 2007 -0500 use an async job to collect session info Use an async helper job to collect session info for the OpenSession() method. - src/Makefile.am | 2 + - src/ck-job.c | 392 + src/Makefile.am | 2 + + src/ck-job.c | 392 +++++++++++++++++++++++++++++++++ - src/ck-job.h | 76 +++++++ - src/ck-manager.c | 278 +++++++++++++++++------- + src/ck-job.h | 76 +++++++ + src/ck-manager.c | 278 +++++++++++++++++------- tools/linux/ck-collect-session-info.c | 11 +- 5 files changed, 681 insertions(+), 78 deletions(-) commit f67761a042ff8b29d7689a043a53110d0bbbf6e9 Author: David Zeuthen <david@fubar.dk> -Date: Mon Mar 5 10:26:10 2007 -0500 +Date: Mon Mar 5 10:26:10 2007 -0500 allow uid 0 to use the pam module @@ -918,17 +1483,17 @@ Date: Mon Mar 5 10:26:10 2007 -0500 commit 4f0911bf685f51b51d05a69a40d3950debb995a0 Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Mar 2 17:51:37 2007 -0500 +Date: Fri Mar 2 17:51:37 2007 -0500 add linux backends for collecting session information These tools will be used to generate and verify the parameters used to open a session. - configure.ac | 5 + - src/proc-linux.c | 57 +++++ - src/proc.h | 20 +- - tools/linux/Makefile.am | 23 ++- + configure.ac | 5 + + src/proc-linux.c | 57 +++++ + src/proc.h | 20 +- + tools/linux/Makefile.am | 23 ++- tools/linux/ck-collect-session-info.c | 390 +++++++++++++++++++++++++++++++++ tools/linux/ck-get-x11-server-pid.c | 75 +++++++ @@ -936,7 +1501,7 @@ Date: Fri Mar 2 17:51:37 2007 -0500 commit 75ad4b862611bd6a39bda06db3db4c9737657dad Author: David Zeuthen <davidz@redhat.com> -Date: Thu Mar 1 15:23:14 2007 -0500 +Date: Thu Mar 1 15:23:14 2007 -0500 dist the manual page for the PAM module @@ -945,46 +1510,46 @@ Date: Thu Mar 1 15:23:14 2007 -0500 commit 1d1b98cd17764be77b1aee79efae8e89ce7faa04 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Mar 1 14:24:27 2007 -0500 +Date: Thu Mar 1 14:24:27 2007 -0500 add a test program for the PAM module Basically this is a mini login. It authenticates, opens a session, sleeps 20 seconds, and then closes the session. - configure.ac | 4 + - pam-ck-connector/Makefile.am | 38 +++++++++- - pam-ck-connector/pam-ck-connector.c | 2 +- - pam-ck-connector/test-pam.c | 135 + configure.ac | 4 + + pam-ck-connector/Makefile.am | 38 +++++++++- + pam-ck-connector/pam-ck-connector.c | 2 +- + pam-ck-connector/test-pam.c | 135 +++++++++++++++++++++++++++++++++++ 4 files changed, 174 insertions(+), 5 deletions(-) commit e37a78dfc5abcb3b02cb5debaa24122fa9b949c4 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Mar 1 13:08:17 2007 -0500 +Date: Thu Mar 1 13:08:17 2007 -0500 fix some typos - pam-ck-connector/pam-ck-connector.c | 7 +++---- + pam-ck-connector/pam-ck-connector.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) commit 6eae9c8ba66c9a7469a2cdea88c16048fdbe2638 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 28 14:20:40 2007 -0500 +Date: Wed Feb 28 14:20:40 2007 -0500 add a test program for the connector Add a simple test app for the connector. Adapted from the example David put in the header. - libck-connector/Makefile.am | 59 ++++++++++++++++++++++---- + libck-connector/Makefile.am | 59 ++++++++++++++++++++++---- libck-connector/test-connector.c | 85 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 9 deletions(-) commit 1905aa0cb4a680308949e366c21803bcf542d9e1 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 28 14:19:44 2007 -0500 +Date: Wed Feb 28 14:19:44 2007 -0500 change the connector API a bit + misc anality @@ -998,15 +1563,15 @@ Date: Wed Feb 28 14:19:44 2007 -0500 I also made some changes to whitespace and style. And converted descriptions to gtkdoc style comments. - libck-connector/ck-connector.c | 886 + libck-connector/ck-connector.c | 886 +++++++++++++++++++++++------------ - libck-connector/ck-connector.h | 108 +---- - pam-ck-connector/pam-ck-connector.c | 287 +++++++----- + libck-connector/ck-connector.h | 108 +---- + pam-ck-connector/pam-ck-connector.c | 287 +++++++----- 3 files changed, 762 insertions(+), 519 deletions(-) commit fed7e94f76c4279015354ff210bc72f1ac68af70 Author: David Zeuthen <davidz@redhat.com> -Date: Wed Feb 28 13:52:17 2007 -0500 +Date: Wed Feb 28 13:52:17 2007 -0500 add a connector library and (reluctantly) a PAM module @@ -1021,40 +1586,40 @@ Date: Wed Feb 28 13:52:17 2007 -0500 under the MIT license as god knows what might want to use them. Sounds good to you? - Makefile.am | 2 + - configure.ac | 29 +++ - libck-connector/Makefile.am | 22 ++ - libck-connector/ck-connector.c | 381 + Makefile.am | 2 + + configure.ac | 29 +++ + libck-connector/Makefile.am | 22 ++ + libck-connector/ck-connector.c | 381 +++++++++++++++++++++++++++++++++++ - libck-connector/ck-connector.h | 122 +++++++++++ - libck-connector/ck-connector.pc.in | 9 + - pam-ck-connector/Makefile.am | 17 ++ - pam-ck-connector/pam-ck-connector.c | 228 +++++++++++++++++++++ - pam-ck-connector/pam_ck_connector.8 | 80 ++++++++ + libck-connector/ck-connector.h | 122 +++++++++++ + libck-connector/ck-connector.pc.in | 9 + + pam-ck-connector/Makefile.am | 17 ++ + pam-ck-connector/pam-ck-connector.c | 228 +++++++++++++++++++++ + pam-ck-connector/pam_ck_connector.8 | 80 ++++++++ 9 files changed, 890 insertions(+), 0 deletions(-) commit 8b33f57e8cd5f451d55fbb0f9bcc3c119a076326 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 28 10:50:46 2007 -0500 +Date: Wed Feb 28 10:50:46 2007 -0500 add framework for backend tools System dependent tools will be built in subdirectories under tools. - configure.ac | 23 +++++++++++++++++++++++ - tools/Makefile.am | 8 ++++++++ + configure.ac | 23 +++++++++++++++++++++++ + tools/Makefile.am | 8 ++++++++ tools/linux/Makefile.am | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 0 deletions(-) commit 593d2ae454f225c545c35398ddfd2c92389e48a7 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 28 10:47:51 2007 -0500 +Date: Wed Feb 28 10:47:51 2007 -0500 lay the groundwork for making open session async Restructure things a bit so that we can be completely async about creating sessions. We want to do this so we can use - callouts to gather session info or to verify info. Also + callouts to gather session info or to verify info. Also make the OpenSession create a parameter list and then create the session rather than creating the session and changing attributes. This is less racy and the session will be complete @@ -1066,7 +1631,7 @@ Date: Wed Feb 28 10:47:51 2007 -0500 commit 160f1cdb75e631743312cfd26fb41831ed0f5c8c Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 28 10:43:17 2007 -0500 +Date: Wed Feb 28 10:43:17 2007 -0500 don't rely on evironment getting updated in python scripts @@ -1075,16 +1640,16 @@ Date: Wed Feb 28 10:43:17 2007 -0500 commit 7c64a3ab942df6232f1386808a817ff5ecad1311 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Feb 27 12:44:58 2007 -0500 +Date: Tue Feb 27 12:44:58 2007 -0500 install the list-sessions tool as ck-list-sessions - tools/Makefile.am | 8 ++++---- + tools/Makefile.am | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) commit 75c0717053780fe51471213cdb21ee8019bfbb6e Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Feb 26 17:08:23 2007 -0500 +Date: Mon Feb 26 17:08:23 2007 -0500 post release version bump @@ -1093,34 +1658,34 @@ Date: Mon Feb 26 17:08:23 2007 -0500 commit f772ad2e5c57010f3ca0bbd04a0b490e8f78c07d Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Feb 26 17:07:06 2007 -0500 +Date: Mon Feb 26 17:07:06 2007 -0500 update news for release Also fix a distcheck error. - NEWS | 13 +++++++++++++ + NEWS | 13 +++++++++++++ src/Makefile.am | 3 ++- 2 files changed, 15 insertions(+), 1 deletions(-) commit 35b022fde7836d0edb5819d4f8be29bd1b9a20d9 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Feb 26 15:18:49 2007 -0500 +Date: Mon Feb 26 15:18:49 2007 -0500 rename some items in proc.h api; add some more error checking - Make the proc.h API more coherent. Convert some warnings + Make the proc.h API more coherent. Convert some warnings to debug statements. Fix two leaks. Add more error checking. src/ck-manager.c | 104 ++++++++++++++++++++++++++++++++++-------------------- src/proc-linux.c | 42 ++++++++++++--------- - src/proc.h | 17 +++++---- + src/proc.h | 17 +++++---- 3 files changed, 99 insertions(+), 64 deletions(-) commit 8fa6f59953fbcae779008c7cdf12441e995b1ca3 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 21 13:22:37 2007 -0500 +Date: Wed Feb 21 13:22:37 2007 -0500 add support for glib < 2.12 @@ -1133,22 +1698,22 @@ Date: Wed Feb 21 13:22:37 2007 -0500 commit 20d3103338d253d09ba7317e6a53310fa9680794 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 21 11:31:54 2007 -0500 +Date: Wed Feb 21 11:31:54 2007 -0500 make separate test scripts for open session methods - src/ck-manager.c | 1 + - src/test-open-session | 44 + src/ck-manager.c | 1 + + src/test-open-session | 44 ++++++++++++++++++++++++++++++ src/test-open-session-with-parameters | 47 +++++++++++++++++++++++++++++++++ - src/test-session | 47 + src/test-session | 47 --------------------------------- 4 files changed, 92 insertions(+), 47 deletions(-) commit 0a8a82bf2701eadb3ef8c3ea927b1d61ea0f68ba Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 21 11:31:09 2007 -0500 +Date: Wed Feb 21 11:31:09 2007 -0500 don't use null parameters @@ -1157,7 +1722,7 @@ Date: Wed Feb 21 11:31:09 2007 -0500 commit eb9361c9b0b05c3bd51de7325c3327db79431fc9 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Feb 20 14:45:40 2007 -0500 +Date: Tue Feb 20 14:45:40 2007 -0500 add a system-idle-hint and system-idle-since-hint @@ -1168,27 +1733,27 @@ Date: Tue Feb 20 14:45:40 2007 -0500 src/ck-manager.c | 160 ++++++++++++++++++++++++++++++++++++++++++++++------ - src/ck-manager.h | 20 +++++- - src/ck-manager.xml | 8 +++ + src/ck-manager.h | 20 +++++- + src/ck-manager.xml | 8 +++ 3 files changed, 166 insertions(+), 22 deletions(-) commit ef89bbdb1be20fbca2a83037fcc922b444b7b513 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Feb 20 14:43:27 2007 -0500 +Date: Tue Feb 20 14:43:27 2007 -0500 make the idle hint getters sync dbus methods This makes it easier to use from C code. Also fix a bug where we weren't emitting the argument in the idle-hint-changed signal. - src/ck-session.c | 23 ++++++++++++++++------- - src/ck-session.h | 6 ++++-- - src/ck-session.xml | 2 -- + src/ck-session.c | 23 ++++++++++++++++------- + src/ck-session.h | 6 ++++-- + src/ck-session.xml | 2 -- 3 files changed, 20 insertions(+), 11 deletions(-) commit 10a6532e35f4e40135006329a6975942ee896817 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Feb 20 12:07:29 2007 -0500 +Date: Tue Feb 20 12:07:29 2007 -0500 rename idle methods and signal to indicate they are hints @@ -1204,18 +1769,18 @@ Date: Tue Feb 20 12:07:29 2007 -0500 commit 7f7124d4f7583347043b271472e570614d975f35 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Feb 19 17:59:54 2007 -0500 +Date: Mon Feb 19 17:59:54 2007 -0500 limit the use of errno Try to limit the use of errno in case it can change. - src/ck-vt-monitor.c | 15 ++++++++++----- + src/ck-vt-monitor.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) commit 5376650940e9018a0d3e97367d2979f90af749bc Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Feb 19 16:14:22 2007 -0500 +Date: Mon Feb 19 16:14:22 2007 -0500 handle the no console fd case better @@ -1223,13 +1788,13 @@ Date: Mon Feb 19 16:14:22 2007 -0500 Also add a comment to note where getfd.c comes from. - src/ck-vt-monitor.c | 42 ++++++++++++++++++++++++++++++++---------- - src/getfd.c | 6 ++++++ + src/ck-vt-monitor.c | 42 ++++++++++++++++++++++++++++++++---------- + src/getfd.c | 6 ++++++ 2 files changed, 38 insertions(+), 10 deletions(-) commit 4d7e3eec89f706cb9a46fd84359de3da1868245d Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Feb 19 15:42:37 2007 -0500 +Date: Mon Feb 19 15:42:37 2007 -0500 improve thread safety @@ -1239,13 +1804,13 @@ Date: Mon Feb 19 15:42:37 2007 -0500 possible by discarding all but the most recent VT activation event. - src/ck-vt-monitor.c | 226 + src/ck-vt-monitor.c | 226 +++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 174 insertions(+), 52 deletions(-) commit 51ff0be15b7bd4a48fd07ada4822f07ddc028af0 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Feb 15 17:20:46 2007 -0500 +Date: Thu Feb 15 17:20:46 2007 -0500 split list-sessions output onto separate lines @@ -1256,7 +1821,7 @@ Date: Thu Feb 15 17:20:46 2007 -0500 commit 497cc86462934168ab8cd379ab1130d4ef5d039b Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Feb 15 16:15:16 2007 -0500 +Date: Thu Feb 15 16:15:16 2007 -0500 add creation and idle-since times @@ -1272,7 +1837,7 @@ Date: Thu Feb 15 16:15:16 2007 -0500 commit cbe9b9ba1ca59d25365593fdc1a66f9ffd3183ca Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Feb 15 15:28:27 2007 -0500 +Date: Thu Feb 15 15:28:27 2007 -0500 implement get/set idle methods @@ -1281,13 +1846,13 @@ Date: Thu Feb 15 15:28:27 2007 -0500 src/ck-session.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++++--- - src/ck-session.h | 7 +- - src/ck-session.xml | 11 ++++ + src/ck-session.h | 7 +- + src/ck-session.xml | 11 ++++ 3 files changed, 173 insertions(+), 11 deletions(-) commit 66c740f30d36bac8f7b56261f0bd595b297d3dd2 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Feb 15 15:26:06 2007 -0500 +Date: Thu Feb 15 15:26:06 2007 -0500 restrict access to CloseSession @@ -1299,38 +1864,38 @@ Date: Thu Feb 15 15:26:06 2007 -0500 commit be0751cd3ec3638082721b1556c07a4238c6c4ac Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Feb 15 15:23:06 2007 -0500 +Date: Thu Feb 15 15:23:06 2007 -0500 convert all tabs to spaces src/ck-manager.c | 154 +++++++++++++++++++++++++++--------------------------- - src/ck-seat.c | 18 +++--- + src/ck-seat.c | 18 +++--- src/ck-session.c | 14 +++--- 3 files changed, 93 insertions(+), 93 deletions(-) commit 4009566af9a47aa4a41dac689ff89f017d6dc8db Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Feb 15 15:22:20 2007 -0500 +Date: Thu Feb 15 15:22:20 2007 -0500 fix compiler warning - src/getfd.c | 9 ++++++--- + src/getfd.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) commit 6c532b986e2a05bf666a8409cf130651e8461874 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Feb 13 08:07:19 2007 -0500 +Date: Tue Feb 13 08:07:19 2007 -0500 fix warning from missing include - src/ck-vt-monitor.c | 2 +- - src/main.c | 9 +++++---- + src/ck-vt-monitor.c | 2 +- + src/main.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) commit 4800bf1e4a3706b6829ccc875d040a64a8d17aad Author: S.Çağlar Onur <caglar@pardus.org.tr> -Date: Tue Feb 13 07:03:50 2007 -0500 +Date: Tue Feb 13 07:03:50 2007 -0500 create and delete pid file @@ -1338,12 +1903,12 @@ Date: Tue Feb 13 07:03:50 2007 -0500 pid file, so if needed attached patch adds that with copy/paste from PolicyKit :). - src/main.c | 25 ++++++++++++++++++++++++- + src/main.c | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) commit 1bd5d81ed1c69074d48158a337043fc569970b75 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Feb 12 17:02:35 2007 -0500 +Date: Mon Feb 12 17:02:35 2007 -0500 post release version bump @@ -1352,7 +1917,7 @@ Date: Mon Feb 12 17:02:35 2007 -0500 commit 87813890f09c1e1ac16f617e8baf7d523e971381 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Feb 12 16:56:24 2007 -0500 +Date: Mon Feb 12 16:56:24 2007 -0500 add more warnings when building from git @@ -1361,7 +1926,7 @@ Date: Mon Feb 12 16:56:24 2007 -0500 commit 32d47eb2f93f97c29b2582add77b54428aefef5a Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Feb 12 16:53:24 2007 -0500 +Date: Mon Feb 12 16:53:24 2007 -0500 update for release @@ -1370,7 +1935,7 @@ Date: Mon Feb 12 16:53:24 2007 -0500 commit 3444585150a2f88ccfe92ba5f3959961428d597c Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Feb 12 16:15:51 2007 -0500 +Date: Mon Feb 12 16:15:51 2007 -0500 use the supplied vt number when updating active session @@ -1382,19 +1947,19 @@ Date: Mon Feb 12 16:15:51 2007 -0500 commit dc427221e1c5028465f4a78132374662341ca3b7 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Feb 8 14:12:10 2007 -0500 +Date: Thu Feb 8 14:12:10 2007 -0500 Bump thread stack size up to 64k The minimum stack size 16k seems to crash glibc when we do printf in debug. - src/ck-vt-monitor.c | 2 +- + src/ck-vt-monitor.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 0c695fd6c3279e8b3f3336337bdc0d66689eff9a Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 7 14:51:16 2007 -0500 +Date: Wed Feb 7 14:51:16 2007 -0500 support for reconnecting to the system bus @@ -1407,7 +1972,7 @@ Date: Wed Feb 7 14:51:16 2007 -0500 commit 975ccd898da30b3904e287848d6d7661ed0a9dfe Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 7 14:49:05 2007 -0500 +Date: Wed Feb 7 14:49:05 2007 -0500 reduce the debug buffer size @@ -1418,7 +1983,7 @@ Date: Wed Feb 7 14:49:05 2007 -0500 commit 4cf47cb3072a7995e6dc87fcc7dd4bafe76256f8 Author: David Zeuthen <david@fubar.dk> -Date: Wed Feb 7 11:01:52 2007 -0500 +Date: Wed Feb 7 11:01:52 2007 -0500 start ck before hal @@ -1426,12 +1991,12 @@ Date: Wed Feb 7 11:01:52 2007 -0500 HAL I'm working on); this patch does that for RH based systems. Please apply. Thanks! - data/ConsoleKit.in | 2 +- + data/ConsoleKit.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 7dcf31d02463faa3c59a9417dae654668d03fea9 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 7 10:57:55 2007 -0500 +Date: Wed Feb 7 10:57:55 2007 -0500 don't refer to the hal repo @@ -1442,7 +2007,7 @@ Date: Wed Feb 7 10:57:55 2007 -0500 commit 98addf1933cd24f546177dd4b158c770ea404df0 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Feb 7 10:53:30 2007 -0500 +Date: Wed Feb 7 10:53:30 2007 -0500 add more information @@ -1455,7 +2020,7 @@ Date: Wed Feb 7 10:53:30 2007 -0500 commit 7e4ffe9ca1d65afeb094ee1bb71b0a7751e09e1c Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Feb 6 11:49:35 2007 -0500 +Date: Tue Feb 6 11:49:35 2007 -0500 Don't keep last session active when switching to a VT without a session registered on it. @@ -1466,7 +2031,7 @@ Date: Tue Feb 6 11:49:35 2007 -0500 commit dc17c930b2ba7dd0a4d0c1ba12c75aa2db18d5a6 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Feb 6 11:46:48 2007 -0500 +Date: Tue Feb 6 11:46:48 2007 -0500 Add some more debugging output @@ -1476,17 +2041,17 @@ Date: Tue Feb 6 11:46:48 2007 -0500 commit 89ee325cf6a0006e48ce702cd5626b7ef4021b04 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Feb 6 11:46:21 2007 -0500 +Date: Tue Feb 6 11:46:21 2007 -0500 Make threads use minimum stack size rather than the default. Patch from: mclasen@redhat.com - src/ck-vt-monitor.c | 2 +- + src/ck-vt-monitor.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit a7208ca3337fef21daa9cd39e0178fe46d31ab99 Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Jan 12 16:11:00 2007 -0500 +Date: Fri Jan 12 16:11:00 2007 -0500 Rename dbus config file. @@ -1499,17 +2064,17 @@ Date: Fri Jan 12 16:11:00 2007 -0500 commit be3fef886b70ccfd5ee48bcd5d9f4cb0256ecbdc Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Jan 12 15:59:04 2007 -0500 +Date: Fri Jan 12 15:59:04 2007 -0500 Change a console-kit to ConsoleKit in a few places - configure.ac | 11 ++++++----- - data/ConsoleKit.in | 8 ++++---- + configure.ac | 11 ++++++----- + data/ConsoleKit.in | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) commit e7774625aa136e766c064f39d83d031c5af8d900 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Jan 11 11:03:30 2007 -0500 +Date: Thu Jan 11 11:03:30 2007 -0500 Post release version bump @@ -1518,28 +2083,28 @@ Date: Thu Jan 11 11:03:30 2007 -0500 commit 9ced94ab8b658ae31e8d2652d6cfe4d635459014 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Jan 11 10:54:39 2007 -0500 +Date: Thu Jan 11 10:54:39 2007 -0500 Update for 0.1.0 release - NEWS | 7 +++++++ + NEWS | 7 +++++++ configure.ac | 2 +- 2 files changed, 8 insertions(+), 1 deletions(-) commit e6b013eb3b5310357d6a62a405fcc1da8aad0cf8 Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Jan 10 22:45:05 2007 -0500 +Date: Wed Jan 10 22:45:05 2007 -0500 Add HACKING and README. - HACKING | 8 ++++++++ - Makefile.am | 1 + - README | 26 ++++++++++++++++++++++++++ + HACKING | 8 ++++++++ + Makefile.am | 1 + + README | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 0 deletions(-) commit 47b6509e6f386bf47244922b2c3cf5637be117a3 Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Nov 17 17:39:51 2006 -0500 +Date: Fri Nov 17 17:39:51 2006 -0500 Dist the ChangeLog, sigh. @@ -1549,71 +2114,71 @@ Date: Fri Nov 17 17:39:51 2006 -0500 commit c05a0ed330836b4f9569b6b6c96d853b8207c33a Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Nov 17 17:33:22 2006 -0500 +Date: Fri Nov 17 17:33:22 2006 -0500 Automatically generate ChangeLog. Fix autogen. Remove translation stuff. - Makefile.am | 26 ++- - autogen.sh | 549 + Makefile.am | 26 ++- + autogen.sh | 549 ++++++++++++++------------------------------------------ - configure.ac | 2 - + configure.ac | 2 - po/POTFILES.in | 3 - 4 files changed, 158 insertions(+), 422 deletions(-) commit babc733eff30a2be18fa3f99bc3ef4f14e35d259 Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Nov 6 15:28:41 2006 -0500 +Date: Mon Nov 6 15:28:41 2006 -0500 Fix some small leaks. Add --timed-exit to daemon for valgrinding. src/ck-manager.c | 11 ++++++++++- src/ck-session.c | 2 ++ - src/main.c | 3 ++- + src/main.c | 3 ++- src/test-session | 3 ++- src/valgrind.sh | 4 ++-- 5 files changed, 18 insertions(+), 5 deletions(-) commit be02d5de51072235c20d6974f0cccb485055a02e Author: William Jon McCann <mccann@jhu.edu> -Date: Mon Nov 6 00:35:01 2006 -0500 +Date: Mon Nov 6 00:35:01 2006 -0500 Show message even when error is NULL. Fix valgrind script. src/ck-manager.c | 1 - - src/main.c | 4 ++++ + src/main.c | 4 ++++ src/valgrind.sh | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) commit 7e817628550ab4932baf6059b06049944893af7e Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Oct 31 23:38:41 2006 -0500 +Date: Tue Oct 31 23:38:41 2006 -0500 Fake the presence of a ChangeLog to work around automake - autogen.sh | 3 ++- + autogen.sh | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) commit 26b40c39ef74eec4f0e9cc7834cfd033a4decbb3 Author: William Jon McCann <mccann@jhu.edu> -Date: Tue Oct 31 22:40:34 2006 -0500 +Date: Tue Oct 31 22:40:34 2006 -0500 Add a script to test FUS related functionality. Fix a problem where error was reported twice. - src/ck-seat.c | 5 +++- - src/test-fus | 63 + src/ck-seat.c | 5 +++- + src/test-fus | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/test-session | 13 +++------- 3 files changed, 71 insertions(+), 10 deletions(-) commit 1d77428175b9684acf582717e7b12b3775ec7e4e Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Oct 27 10:20:57 2006 -0400 +Date: Fri Oct 27 10:20:57 2006 -0400 Add .gitignore files and rename tool. - .gitignore | 45 ++++++ + .gitignore | 45 ++++++ data/.gitignore | 3 + src/.gitignore | 13 ++ tools/.gitignore | 8 + @@ -1626,32 +2191,32 @@ Date: Fri Oct 27 10:20:57 2006 -0400 commit 6b71d5dcaf9178645d83b4cbfc8febbb43ebe9c2 Author: William Jon McCann <mccann@jhu.edu> -Date: Fri Oct 27 09:54:59 2006 -0400 +Date: Fri Oct 27 09:54:59 2006 -0400 Actually remove files and remember to use commit -a. - INSTALL | 236 - - Makefile.am | 3 - - Makefile.in | 723 -- - acinclude.m4 | 88 + - aclocal.m4 | 8166 ----------------- - compile | 142 - - config.guess | 1463 --- - config.h.in | 97 - - config.sub | 1579 ---- - configure |24456 + INSTALL | 236 - + Makefile.am | 3 - + Makefile.in | 723 -- + acinclude.m4 | 88 + + aclocal.m4 | 8166 ----------------- + compile | 142 - + config.guess | 1463 --- + config.h.in | 97 - + config.sub | 1579 ---- + configure |24456 ------------------------------------------------- - configure.ac | 2 +- + configure.ac | 2 +- data/Makefile.am | 4 + data/Makefile.in | 443 - - depcomp | 530 -- - install-sh | 323 - + depcomp | 530 -- + install-sh | 323 - intltool-extract.in | 853 -- intltool-merge.in | 1403 --- intltool-update.in | 1089 --- - ltmain.sh | 6863 -------------- - missing | 360 - - mkinstalldirs | 158 - + ltmain.sh | 6863 -------------- + missing | 360 - + mkinstalldirs | 158 - po/Makefile.in.in | 221 - src/Makefile.in | 724 -- src/ck-manager-glue.h | 223 - @@ -1664,7 +2229,7 @@ Date: Fri Oct 27 09:54:59 2006 -0400 commit 0c2eba4ba67bcc52e9ce88e49a0dd74ce5ebdea6 Author: William Jon McCann <mccann@jhu.edu> -Date: Thu Oct 26 21:58:54 2006 -0400 +Date: Thu Oct 26 21:58:54 2006 -0400 Remove all the generated cruft from the tarball import. @@ -1674,7 +2239,7 @@ Date: Thu Oct 26 21:58:54 2006 -0400 commit d8d6b694e11d9433495833dfe09dcb3cf6830c1d Author: William Jon McCann <mccann@jhu.edu> -Date: Wed Oct 25 16:30:23 2006 -0400 +Date: Wed Oct 25 16:30:23 2006 -0400 Bump version for git. @@ -1683,36 +2248,36 @@ Date: Wed Oct 25 16:30:23 2006 -0400 commit a08530e838218b3c5859550058e78b8f1abee434 Author: William Jon McCann <mccannwj@acsnb12.pha.jhu.edu> -Date: Wed Oct 25 14:38:19 2006 -0400 +Date: Wed Oct 25 14:38:19 2006 -0400 Initial import - AUTHORS | 1 + - COPYING | 340 + - INSTALL | 236 + - Makefile.am | 51 + - Makefile.in | 723 ++ - acinclude.m4 | 43 + - aclocal.m4 | 8166 +++++++++++++++++ - compile | 142 + - config.guess | 1463 +++ - config.h.in | 97 + - config.sub | 1579 ++++ - configure |24456 + AUTHORS | 1 + + COPYING | 340 + + INSTALL | 236 + + Makefile.am | 51 + + Makefile.in | 723 ++ + acinclude.m4 | 43 + + aclocal.m4 | 8166 +++++++++++++++++ + compile | 142 + + config.guess | 1463 +++ + config.h.in | 97 + + config.sub | 1579 ++++ + configure |24456 +++++++++++++++++++++++++++++++++++++++++++++++++ - configure.ac | 236 + + configure.ac | 236 + data/ConsoleKit.in | 70 + data/Makefile.am | 14 + data/Makefile.in | 443 + data/console-kit.conf | 49 + - depcomp | 530 ++ - install-sh | 323 + + depcomp | 530 ++ + install-sh | 323 + intltool-extract.in | 853 ++ intltool-merge.in | 1403 +++ intltool-update.in | 1089 +++ - ltmain.sh | 6863 ++++++++++++++ - missing | 360 + - mkinstalldirs | 158 + + ltmain.sh | 6863 ++++++++++++++ + missing | 360 + + mkinstalldirs | 158 + po/Makefile.in.in | 221 + po/POTFILES.in | 3 + src/Makefile.am | 90 + @@ -1727,8 +2292,8 @@ Date: Wed Oct 25 14:38:19 2006 -0400 src/ck-marshal.h | 28 + src/ck-marshal.list | 2 + src/ck-seat-glue.h | 167 + - src/ck-seat.c | 724 ++ - src/ck-seat.h | 111 + + src/ck-seat.c | 724 ++ + src/ck-seat.h | 111 + src/ck-seat.xml | 27 + src/ck-session-glue.h | 135 + src/ck-session.c | 744 ++ @@ -1736,10 +2301,10 @@ Date: Wed Oct 25 14:38:19 2006 -0400 src/ck-session.xml | 49 + src/ck-vt-monitor.c | 360 + src/ck-vt-monitor.h | 71 + - src/getfd.c | 52 + - src/main.c | 141 + + src/getfd.c | 52 + + src/main.c | 141 + src/proc-linux.c | 473 + - src/proc.h | 41 + + src/proc.h | 41 + src/test-session | 51 + src/valgrind.sh | 12 + tools/Makefile.am | 42 + diff --git a/Makefile.in b/Makefile.in index 1257a42..aa0a493 100644 --- a/Makefile.in +++ b/Makefile.in @@ -140,6 +140,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ +KVM_LIBS = @KVM_LIBS@ LDFLAGS = @LDFLAGS@ LIBDBUS_CFLAGS = @LIBDBUS_CFLAGS@ LIBDBUS_LIBS = @LIBDBUS_LIBS@ @@ -1,4 +1,23 @@ ============= +Version 0.2.3 +============= + + * Use unix-user instead of user so that PAM module works + +============= +Version 0.2.2 +============= + + Major changes in this release: + + * FreeBSD support (Joe Marcus Clarke & Florent Thoumie) + * Solaris support (Brian Cameron & William Jon McCann) + * More abstraction of system dependent stuff (William Jon McCann) + * Experimental support for seat & device configuration (William Jon McCann) + * Add new helper for getting tty from DISPLAY (William Jon McCann) + * a few fixes for getfd suggested by Lennart (William Jon McCann) + +============= Version 0.2.1 ============= @@ -1087,7 +1087,7 @@ glib_DEFUN([GLIB_WITH_NLS], AC_CHECK_FUNCS(dcgettext) MSGFMT_OPTS= AC_MSG_CHECKING([if msgfmt accepts -c]) - GLIB_RUN_PROG([msgfmt -c -o /dev/null],[ + GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" @@ -1311,31 +1311,6 @@ sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD fi]) -# isc-posix.m4 serial 2 (gettext-0.11.2) -dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. - -# This test replaces the one in autoconf. -# Currently this macro should have the same name as the autoconf macro -# because gettext's gettext.m4 (distributed in the automake package) -# still uses it. Otherwise, the use in gettext.m4 makes autoheader -# give these diagnostics: -# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX -# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX - -undefine([AC_ISC_POSIX]) - -AC_DEFUN([AC_ISC_POSIX], - [ - dnl This test replaces the obsolescent AC_ISC_POSIX kludge. - AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) - ] -) - # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 48 AC_PROG_LIBTOOL @@ -7868,7 +7843,8 @@ installed software in a non-standard prefix. _PKG_TEXT ])], - [$4]) + [AC_MSG_RESULT([no]) + $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it diff --git a/config.h.in b/config.h.in index 55f260e..6d39f44 100644 --- a/config.h.in +++ b/config.h.in @@ -21,6 +21,12 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `getpeereid' function. */ +#undef HAVE_GETPEEREID + +/* Define to 1 if you have the `getpeerucred' function. */ +#undef HAVE_GETPEERUCRED + /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for ConsoleKit 0.2.1. +# Generated by GNU Autoconf 2.60 for ConsoleKit 0.2.3. # # Report bugs to <mccann@jhu.edu>. # @@ -713,8 +713,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='ConsoleKit' PACKAGE_TARNAME='ConsoleKit' -PACKAGE_VERSION='0.2.1' -PACKAGE_STRING='ConsoleKit 0.2.1' +PACKAGE_VERSION='0.2.3' +PACKAGE_STRING='ConsoleKit 0.2.3' PACKAGE_BUGREPORT='mccann@jhu.edu' ac_unique_file="src/ck-manager.c" @@ -886,6 +886,7 @@ WARN_CFLAGS DBUS_CFLAGS DBUS_SYS_DIR CONSOLE_KIT_PID_FILE +KVM_LIBS CK_COMPILE_LINUX_TRUE CK_COMPILE_LINUX_FALSE CK_COMPILE_FREEBSD_TRUE @@ -1432,7 +1433,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ConsoleKit 0.2.1 to adapt to many kinds of systems. +\`configure' configures ConsoleKit 0.2.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1502,7 +1503,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ConsoleKit 0.2.1:";; + short | recursive ) echo "Configuration of ConsoleKit 0.2.3:";; esac cat <<\_ACEOF @@ -1630,7 +1631,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ConsoleKit configure 0.2.1 +ConsoleKit configure 0.2.3 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1644,7 +1645,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ConsoleKit $as_me 0.2.1, which was +It was created by ConsoleKit $as_me 0.2.3, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -2317,7 +2318,7 @@ fi # Define the identity of the package. PACKAGE='ConsoleKit' - VERSION='0.2.1' + VERSION='0.2.3' cat >>confdefs.h <<_ACEOF @@ -3664,14 +3665,12 @@ fi - - { echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5 -echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6; } -if test "${ac_cv_lib_cposix_strerror+set}" = set; then +{ echo "$as_me:$LINENO: checking for library containing strerror" >&5 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } +if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcposix $LIBS" + ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3694,7 +3693,14 @@ return strerror (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -3728,25 +3734,35 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_cposix_strerror=yes + ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_cposix_strerror=no + fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if test "${ac_cv_search_strerror+set}" = set; then + break fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5 -echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6; } -if test $ac_cv_lib_cposix_strerror = yes; then - LIBS="$LIBS -lcposix" +done +if test "${ac_cv_search_strerror+set}" = set; then + : +else + ac_cv_search_strerror=no fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +echo "${ECHO_T}$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5864,7 +5880,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5867 "configure"' > conftest.$ac_ext + echo '#line 5883 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8378,11 +8394,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8381: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8397: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8385: \$? = $ac_status" >&5 + echo "$as_me:8401: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8646,11 +8662,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8649: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8665: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8653: \$? = $ac_status" >&5 + echo "$as_me:8669: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8750,11 +8766,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8753: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8769: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8757: \$? = $ac_status" >&5 + echo "$as_me:8773: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10247,7 +10263,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 10250 "configure"' > conftest.$ac_ext + echo '#line 10266 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -11223,7 +11239,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 11226 "configure" +#line 11242 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11323,7 +11339,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 11326 "configure" +#line 11342 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13691,11 +13707,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13694: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13710: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13698: \$? = $ac_status" >&5 + echo "$as_me:13714: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13795,11 +13811,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13798: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13814: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13802: \$? = $ac_status" >&5 + echo "$as_me:13818: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14331,7 +14347,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 14334 "configure"' > conftest.$ac_ext + echo '#line 14350 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -15386,11 +15402,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15389: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15405: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15393: \$? = $ac_status" >&5 + echo "$as_me:15409: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15490,11 +15506,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15493: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15509: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15497: \$? = $ac_status" >&5 + echo "$as_me:15513: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16967,7 +16983,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 16970 "configure"' > conftest.$ac_ext + echo '#line 16986 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -17741,11 +17757,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17744: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17760: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17748: \$? = $ac_status" >&5 + echo "$as_me:17764: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -18009,11 +18025,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18012: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18028: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18016: \$? = $ac_status" >&5 + echo "$as_me:18032: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -18113,11 +18129,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18116: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18132: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18120: \$? = $ac_status" >&5 + echo "$as_me:18136: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19610,7 +19626,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 19613 "configure"' > conftest.$ac_ext + echo '#line 19629 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -22440,8 +22456,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" _ACEOF -if { (echo "$as_me:$LINENO: msgfmt -c -o /dev/null conftest.foo") >&5 - (msgfmt -c -o /dev/null conftest.foo) 2>&5 +if { (echo "$as_me:$LINENO: \$MSGFMT -c -o /dev/null conftest.foo") >&5 + ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -23162,6 +23178,118 @@ fi done + + +for ac_func in getpeerucred getpeereid +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + { echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } if test "${ac_cv_type_uid_t+set}" = set; then @@ -24065,18 +24193,111 @@ fi CK_BACKEND="" +KVM_LIBS="" case "$host" in *-*-freebsd*) + CK_BACKEND="freebsd" + { echo "$as_me:$LINENO: checking for kvm_openfiles in -lkvm" >&5 +echo $ECHO_N "checking for kvm_openfiles in -lkvm... $ECHO_C" >&6; } +if test "${ac_cv_lib_kvm_kvm_openfiles+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lkvm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char kvm_openfiles (); +int +main () +{ +return kvm_openfiles (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_kvm_kvm_openfiles=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_kvm_kvm_openfiles=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_kvm_kvm_openfiles" >&5 +echo "${ECHO_T}$ac_cv_lib_kvm_kvm_openfiles" >&6; } +if test $ac_cv_lib_kvm_kvm_openfiles = yes; then + have_kvm=yes +else + { { echo "$as_me:$LINENO: error: Unable to find libkvm which is needed on FreeBSD" >&5 +echo "$as_me: error: Unable to find libkvm which is needed on FreeBSD" >&2;} + { (exit 1); exit 1; }; } +fi + + if test "x$have_kvm" = "xyes"; then + KVM_LIBS="-lkvm" + fi ;; *-*-linux*) CK_BACKEND="linux" ;; *-*-solaris*) + CK_BACKEND="solaris" ;; esac + + if test x$CK_BACKEND = xlinux; then CK_COMPILE_LINUX_TRUE= CK_COMPILE_LINUX_FALSE='#' @@ -25483,7 +25704,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ConsoleKit $as_me 0.2.1, which was +This file was extended by ConsoleKit $as_me 0.2.3, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25536,7 +25757,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -ConsoleKit config.status 0.2.1 +ConsoleKit config.status 0.2.3 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -25898,6 +26119,7 @@ WARN_CFLAGS!$WARN_CFLAGS$ac_delim DBUS_CFLAGS!$DBUS_CFLAGS$ac_delim DBUS_SYS_DIR!$DBUS_SYS_DIR$ac_delim CONSOLE_KIT_PID_FILE!$CONSOLE_KIT_PID_FILE$ac_delim +KVM_LIBS!$KVM_LIBS$ac_delim CK_COMPILE_LINUX_TRUE!$CK_COMPILE_LINUX_TRUE$ac_delim CK_COMPILE_LINUX_FALSE!$CK_COMPILE_LINUX_FALSE$ac_delim CK_COMPILE_FREEBSD_TRUE!$CK_COMPILE_FREEBSD_TRUE$ac_delim @@ -25922,7 +26144,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 57; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 58; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -26533,6 +26755,7 @@ echo " compiler: ${CC} cflags: ${CFLAGS} Base libs: ${CONSOLE_KIT_LIBS} + Tools libs: ${TOOLS_LIBS} Maintainer mode: ${USE_MAINTAINER_MODE} dbus-1 system.d dir: ${DBUS_SYS_DIR} diff --git a/configure.ac b/configure.ac index 451cb9c..d706a56 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl -*- mode: m4 -*- AC_PREREQ(2.59c) AC_INIT([ConsoleKit], - [0.2.1], + [0.2.3], [mccann@jhu.edu], [ConsoleKit]) @@ -40,6 +40,8 @@ X11_REQUIRED_VERSION=1.0.0 AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(paths.h) +AC_CHECK_FUNCS(getpeerucred getpeereid) + AC_TYPE_UID_T PKG_CHECK_MODULES(CONSOLE_KIT, @@ -138,16 +140,26 @@ dnl Figure out what tools backend to build dnl --------------------------------------------------------------------------- CK_BACKEND="" +KVM_LIBS="" case "$host" in *-*-freebsd*) + CK_BACKEND="freebsd" + AC_CHECK_LIB(kvm, kvm_openfiles, have_kvm=yes, + AC_MSG_ERROR([Unable to find libkvm which is needed on FreeBSD])) + if test "x$have_kvm" = "xyes"; then + KVM_LIBS="-lkvm" + fi ;; *-*-linux*) CK_BACKEND="linux" ;; *-*-solaris*) + CK_BACKEND="solaris" ;; esac +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_SOLARIS, test x$CK_BACKEND = xsolaris, [Compiling for Solaris]) @@ -352,6 +364,7 @@ echo " compiler: ${CC} cflags: ${CFLAGS} Base libs: ${CONSOLE_KIT_LIBS} + Tools libs: ${TOOLS_LIBS} Maintainer mode: ${USE_MAINTAINER_MODE} dbus-1 system.d dir: ${DBUS_SYS_DIR} diff --git a/data/00-primary.seat b/data/00-primary.seat new file mode 100644 index 0000000..6e61db4 --- /dev/null +++ b/data/00-primary.seat @@ -0,0 +1,5 @@ +[Seat Entry] +Version=1.0 +Name=Primary seat +Hidden=false +Devices=
\ No newline at end of file diff --git a/data/ConsoleKit.conf b/data/ConsoleKit.conf index 7451e61..1ede954 100644 --- a/data/ConsoleKit.conf +++ b/data/ConsoleKit.conf @@ -37,19 +37,4 @@ send_interface="org.freedesktop.DBus.Properties" /> </policy> - <policy user="gdm"> - <allow send_interface="org.freedesktop.ConsoleKit.Manager"/> - <allow send_interface="org.freedesktop.ConsoleKit.Seat"/> - <allow send_interface="org.freedesktop.ConsoleKit.Session"/> - - <allow send_interface="org.freedesktop.ConsoleKit.Manager" - send_member="OpenConsoleWithParameters"/> - <allow send_interface="org.freedesktop.ConsoleKit.Session" - send_member="Lock"/> - <allow send_interface="org.freedesktop.ConsoleKit.Session" - send_member="Unlock"/> - <allow send_destination="org.freedesktop.ConsoleKit" - send_interface="org.freedesktop.DBus.Properties" /> - </policy> - </busconfig> diff --git a/data/Makefile.am b/data/Makefile.am index f9216c4..947f762 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -3,11 +3,18 @@ NULL = dbusconfdir = $(DBUS_SYS_DIR) dbusconf_DATA = ConsoleKit.conf +seatdir = $(sysconfdir)/ConsoleKit/seats.d +seat_DATA = 00-primary.seat + SCRIPT_IN_FILES = ConsoleKit.in + +# I guess it's Linux-only but that will do for the moment. +if ! CK_COMPILE_FREEBSD initddir=$(sysconfdir)/rc.d/init.d initd_SCRIPTS= \ ConsoleKit \ $(NULL) +endif ConsoleKit: ConsoleKit.in Makefile @@ -21,6 +28,7 @@ edit = sed \ EXTRA_DIST = \ $(dbusconf_DATA) \ + $(seat_DATA) \ $(SCRIPT_IN_FILES) \ $(NULL) diff --git a/data/Makefile.in b/data/Makefile.in index 89b1ebd..9dd6e7e 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -47,7 +47,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(initddir)" "$(DESTDIR)$(dbusconfdir)" +am__installdirs = "$(DESTDIR)$(initddir)" "$(DESTDIR)$(dbusconfdir)" \ + "$(DESTDIR)$(seatdir)" initdSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(initd_SCRIPTS) SOURCES = @@ -59,7 +60,8 @@ am__vpath_adj = case $$p in \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; dbusconfDATA_INSTALL = $(INSTALL_DATA) -DATA = $(dbusconf_DATA) +seatDATA_INSTALL = $(INSTALL_DATA) +DATA = $(dbusconf_DATA) $(seat_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ @@ -126,6 +128,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ +KVM_LIBS = @KVM_LIBS@ LDFLAGS = @LDFLAGS@ LIBDBUS_CFLAGS = @LIBDBUS_CFLAGS@ LIBDBUS_LIBS = @LIBDBUS_LIBS@ @@ -217,11 +220,15 @@ target_alias = @target_alias@ NULL = dbusconfdir = $(DBUS_SYS_DIR) dbusconf_DATA = ConsoleKit.conf +seatdir = $(sysconfdir)/ConsoleKit/seats.d +seat_DATA = 00-primary.seat SCRIPT_IN_FILES = ConsoleKit.in -initddir = $(sysconfdir)/rc.d/init.d -initd_SCRIPTS = \ - ConsoleKit \ - $(NULL) + +# I guess it's Linux-only but that will do for the moment. +@CK_COMPILE_FREEBSD_FALSE@initddir = $(sysconfdir)/rc.d/init.d +@CK_COMPILE_FREEBSD_FALSE@initd_SCRIPTS = \ +@CK_COMPILE_FREEBSD_FALSE@ ConsoleKit \ +@CK_COMPILE_FREEBSD_FALSE@ $(NULL) edit = sed \ -e 's|@sbindir[@]|$(sbindir)|g' \ @@ -231,6 +238,7 @@ edit = sed \ EXTRA_DIST = \ $(dbusconf_DATA) \ + $(seat_DATA) \ $(SCRIPT_IN_FILES) \ $(NULL) @@ -317,6 +325,23 @@ uninstall-dbusconfDATA: echo " rm -f '$(DESTDIR)$(dbusconfdir)/$$f'"; \ rm -f "$(DESTDIR)$(dbusconfdir)/$$f"; \ done +install-seatDATA: $(seat_DATA) + @$(NORMAL_INSTALL) + test -z "$(seatdir)" || $(mkdir_p) "$(DESTDIR)$(seatdir)" + @list='$(seat_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(seatDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(seatdir)/$$f'"; \ + $(seatDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(seatdir)/$$f"; \ + done + +uninstall-seatDATA: + @$(NORMAL_UNINSTALL) + @list='$(seat_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(seatdir)/$$f'"; \ + rm -f "$(DESTDIR)$(seatdir)/$$f"; \ + done tags: TAGS TAGS: @@ -355,7 +380,7 @@ check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: - for dir in "$(DESTDIR)$(initddir)" "$(DESTDIR)$(dbusconfdir)"; do \ + for dir in "$(DESTDIR)$(initddir)" "$(DESTDIR)$(dbusconfdir)" "$(DESTDIR)$(seatdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am @@ -402,7 +427,8 @@ info: info-am info-am: -install-data-am: install-dbusconfDATA install-initdSCRIPTS +install-data-am: install-dbusconfDATA install-initdSCRIPTS \ + install-seatDATA install-exec-am: @@ -429,19 +455,19 @@ ps: ps-am ps-am: uninstall-am: uninstall-dbusconfDATA uninstall-info-am \ - uninstall-initdSCRIPTS + uninstall-initdSCRIPTS uninstall-seatDATA .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dbusconfDATA install-exec \ install-exec-am install-info install-info-am \ - install-initdSCRIPTS install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-dbusconfDATA uninstall-info-am \ - uninstall-initdSCRIPTS + install-initdSCRIPTS install-man install-seatDATA \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-dbusconfDATA \ + uninstall-info-am uninstall-initdSCRIPTS uninstall-seatDATA ConsoleKit: ConsoleKit.in Makefile diff --git a/doc/ConsoleKit.xml b/doc/ConsoleKit.xml index 36869ca..b3e1ce3 100644 --- a/doc/ConsoleKit.xml +++ b/doc/ConsoleKit.xml @@ -10,8 +10,8 @@ <book id="index"> <bookinfo> - <title>ConsoleKit 0.2.1 Documentation</title> - <releaseinfo>Version 0.2.1</releaseinfo> + <title>ConsoleKit 0.2.3 Documentation</title> + <releaseinfo>Version 0.2.3</releaseinfo> <date>8 March, 2007</date> <authorgroup> <author> diff --git a/doc/Makefile.in b/doc/Makefile.in index f12529c..0e72c4a 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -124,6 +124,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ +KVM_LIBS = @KVM_LIBS@ LDFLAGS = @LDFLAGS@ LIBDBUS_CFLAGS = @LIBDBUS_CFLAGS@ LIBDBUS_LIBS = @LIBDBUS_LIBS@ diff --git a/doc/xml/ref-ck-seat.xml b/doc/xml/ref-ck-seat.xml index 03f4176..16d86b2 100644 --- a/doc/xml/ref-ck-seat.xml +++ b/doc/xml/ref-ck-seat.xml @@ -8,18 +8,21 @@ </refnamediv> <refsynopsisdiv role="synopsis"> <title role="synopsis.title">Methods</title> - <synopsis><link linkend="Seat.GetId">GetId</link> (out 'o' sid) -<link linkend="Seat.GetSessions">GetSessions</link> (out 'ao' sessions) -<link linkend="Seat.GetActiveSession">GetActiveSession</link> (out 'o' ssid) -<link linkend="Seat.CanActivateSessions">CanActivateSessions</link> (out 'b' can_activate) -<link linkend="Seat.ActivateSession">ActivateSession</link> (in 'o' ssid) + <synopsis><link linkend="Seat.GetId">GetId</link> (out 'o' sid) +<link linkend="Seat.GetSessions">GetSessions</link> (out 'ao' sessions) +<link linkend="Seat.GetDevices">GetDevices</link> (out 'a(ss)' devices) +<link linkend="Seat.GetActiveSession">GetActiveSession</link> (out 'o' ssid) +<link linkend="Seat.CanActivateSessions">CanActivateSessions</link> (out 'b' can_activate) +<link linkend="Seat.ActivateSession">ActivateSession</link> (in 'o' ssid) </synopsis> </refsynopsisdiv> <refsect1 role="signal_proto"> <title role="signal_proto.title">Signals</title> - <synopsis><link linkend="Seat::ActiveSessionChanged">ActiveSessionChanged</link> ('o' ssid) -<link linkend="Seat::SessionAdded">SessionAdded</link> ('o' ssid) -<link linkend="Seat::SessionRemoved">SessionRemoved</link> ('o' ssid) + <synopsis><link linkend="Seat::ActiveSessionChanged">ActiveSessionChanged</link> ('o' ssid) +<link linkend="Seat::SessionAdded">SessionAdded</link> ('o' ssid) +<link linkend="Seat::SessionRemoved">SessionRemoved</link> ('o' ssid) +<link linkend="Seat::DeviceAdded">DeviceAdded</link> ('(ss)' device) +<link linkend="Seat::DeviceRemoved">DeviceRemoved</link> ('(ss)' device) </synopsis> </refsect1> <refsect1 role="impl_interfaces"> @@ -49,7 +52,13 @@ seat at a time.</para> that are currently attached to this seat.</para> <para>Each Session ID is an D-Bus object path for the object that implements the <link linkend="Session">Session</link> interface.</para> - <variablelist role="params"><varlistentry><term><parameter>sessions</parameter>:</term><listitem><simpara>an array of Session IDs</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat.GetActiveSession"/>GetActiveSession ()</title><indexterm><primary>GetActiveSession</primary><secondary>Seat</secondary></indexterm><programlisting>GetActiveSession (out 'o' ssid)</programlisting></refsect2> + <variablelist role="params"><varlistentry><term><parameter>sessions</parameter>:</term><listitem><simpara>an array of Session IDs</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat.GetDevices"/>GetDevices ()</title><indexterm><primary>GetDevices</primary><secondary>Seat</secondary></indexterm><programlisting>GetDevices (out 'a(ss)' devices)</programlisting></refsect2> + <para>This gets a list of all the devices + that are currently associated with this seat.</para> + <para>Each device is an D-Bus structure that represents + the device type and the device id. + </para> + <variablelist role="params"><varlistentry><term><parameter>devices</parameter>:</term><listitem><simpara>an array of devices</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat.GetActiveSession"/>GetActiveSession ()</title><indexterm><primary>GetActiveSession</primary><secondary>Seat</secondary></indexterm><programlisting>GetActiveSession (out 'o' ssid)</programlisting></refsect2> <para>Gets the Session ID that is currently active on this Seat.</para> <para>Returns NULL if there is no active session.</para> <variablelist role="params"><varlistentry><term><parameter>ssid</parameter>:</term><listitem><simpara>Session ID</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat.CanActivateSessions"/>CanActivateSessions ()</title><indexterm><primary>CanActivateSessions</primary><secondary>Seat</secondary></indexterm><programlisting>CanActivateSessions (out 'b' can_activate)</programlisting></refsect2>Used to determine whether the seat supports session activation. @@ -67,7 +76,11 @@ See also: <para>Emitted when a session has been added to the seat.</para> <variablelist role="params"><varlistentry><term><parameter>ssid</parameter>:</term><listitem><simpara>Session ID</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat::SessionRemoved"/>The SessionRemoved signal</title><indexterm><primary>SessionRemoved</primary><secondary>Seat</secondary></indexterm><programlisting>SessionRemoved ('o' ssid)</programlisting></refsect2> <para>Emitted when a session has been removed from the seat.</para> - <variablelist role="params"><varlistentry><term><parameter>ssid</parameter>:</term><listitem><simpara>Session ID</simpara></listitem></varlistentry></variablelist></refsect1> + <variablelist role="params"><varlistentry><term><parameter>ssid</parameter>:</term><listitem><simpara>Session ID</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat::DeviceAdded"/>The DeviceAdded signal</title><indexterm><primary>DeviceAdded</primary><secondary>Seat</secondary></indexterm><programlisting>DeviceAdded ('(ss)' device)</programlisting></refsect2> + <para>Emitted when a device has been associated with the seat.</para> + <variablelist role="params"><varlistentry><term><parameter>device</parameter>:</term><listitem><simpara>Device structure</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat::DeviceRemoved"/>The DeviceRemoved signal</title><indexterm><primary>DeviceRemoved</primary><secondary>Seat</secondary></indexterm><programlisting>DeviceRemoved ('(ss)' device)</programlisting></refsect2> + <para>Emitted when a device has been dissociated from the seat.</para> + <variablelist role="params"><varlistentry><term><parameter>device</parameter>:</term><listitem><simpara>Device structure</simpara></listitem></varlistentry></variablelist></refsect1> <refsect1 role="property_details"> <title role="property_details.title">Property Details</title> </refsect1> diff --git a/libck-connector/Makefile.in b/libck-connector/Makefile.in index 7bd22f1..74828a3 100644 --- a/libck-connector/Makefile.in +++ b/libck-connector/Makefile.in @@ -159,6 +159,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ +KVM_LIBS = @KVM_LIBS@ LDFLAGS = @LDFLAGS@ LIBDBUS_CFLAGS = @LIBDBUS_CFLAGS@ LIBDBUS_LIBS = @LIBDBUS_LIBS@ diff --git a/libck-connector/ck-connector.c b/libck-connector/ck-connector.c index 34a8657..7f6f87f 100644 --- a/libck-connector/ck-connector.c +++ b/libck-connector/ck-connector.c @@ -79,7 +79,7 @@ static struct { { "remote-host-name", DBUS_TYPE_STRING }, { "session-type", DBUS_TYPE_STRING }, { "is-local", DBUS_TYPE_BOOLEAN }, - { "user", DBUS_TYPE_INT32 }, + { "unix-user", DBUS_TYPE_INT32 }, }; static int @@ -500,7 +500,7 @@ out: * dbus_error_init (&error); * ck_connector_open_session_with_parameters (connector, * &error, - * "user", &v_INT32, + * "unix-user", &v_INT32, * "display-device", &v_STRING, * NULL); * @endcode @@ -566,7 +566,7 @@ ck_connector_open_session_for_user (CkConnector *connector, error, "display-device", &display_device, "x11-display", &x11_display, - "user", &user, + "unix-user", &user, NULL); return ret; } diff --git a/libck-connector/test-connector.c b/libck-connector/test-connector.c index 7f17426..66ddc61 100644 --- a/libck-connector/test-connector.c +++ b/libck-connector/test-connector.c @@ -58,7 +58,7 @@ main (int argc, char *argv[]) dbus_error_init (&error); res = ck_connector_open_session_with_parameters (connector, &error, - "user", &user, + "unix-user", &user, "display-device", &display_device, "x11-display", &x11_display, "remote-host-name", &remote_host_name, diff --git a/pam-ck-connector/Makefile.in b/pam-ck-connector/Makefile.in index d5e118d..4536e4e 100644 --- a/pam-ck-connector/Makefile.in +++ b/pam-ck-connector/Makefile.in @@ -164,6 +164,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ +KVM_LIBS = @KVM_LIBS@ LDFLAGS = @LDFLAGS@ LIBDBUS_CFLAGS = @LIBDBUS_CFLAGS@ LIBDBUS_LIBS = @LIBDBUS_LIBS@ diff --git a/pam-ck-connector/pam-ck-connector.c b/pam-ck-connector/pam-ck-connector.c index 253edd0..1c7ecd2 100644 --- a/pam-ck-connector/pam-ck-connector.c +++ b/pam-ck-connector/pam-ck-connector.c @@ -335,7 +335,7 @@ pam_sm_open_session (pam_handle_t *pamh, dbus_error_init (&error); res = ck_connector_open_session_with_parameters (ckc, &error, - "user", &uid, + "unix-user", &uid, "display-device", &display_device, "x11-display", &x11_display, "x11-display-device", &x11_display_device, diff --git a/src/Makefile.am b/src/Makefile.am index 0977591..3f142a3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,6 +23,38 @@ INCLUDES = \ $(DBUS_CFLAGS) \ $(NULL) +noinst_LTLIBRARIES = \ + libck.la \ + $(NULL) + +libck_la_SOURCES = \ + ck-sysdeps.h \ + ck-sysdeps-unix.c \ + $(NULL) + +if CK_COMPILE_LINUX +libck_la_SOURCES += \ + ck-sysdeps-linux.c \ + $(NULL) +endif +if CK_COMPILE_SOLARIS +libck_la_SOURCES += \ + ck-sysdeps-solaris.c \ + $(NULL) +endif +if CK_COMPILE_FREEBSD +libck_la_SOURCES += \ + ck-sysdeps-freebsd.c \ + $(NULL) +libck_la_LIBADD = $(KVM_LIBS) +endif + +EXTRA_libck_la_SOURCES = \ + ck-sysdeps-linux.c \ + ck-sysdeps-solaris.c \ + ck-sysdeps-freebsd.c \ + $(NULL) + sbin_PROGRAMS = \ console-kit-daemon \ $(NULL) @@ -49,10 +81,6 @@ ck-marshal.c: ck-marshal.list ck-marshal.h: ck-marshal.list @GLIB_GENMARSHAL@ $< --prefix=ck_marshal --header > $@ -PLATFORM_SOURCES = \ - proc-linux.c \ - $(NULL) - console_kit_daemon_SOURCES = \ main.c \ ck-manager.h \ @@ -70,9 +98,6 @@ console_kit_daemon_SOURCES = \ ck-session.c \ ck-log.h \ ck-log.c \ - getfd.c \ - proc.h \ - $(PLATFORM_SOURCES) \ $(BUILT_SOURCES) \ $(NULL) @@ -91,10 +116,23 @@ EXTRA_console_kit_daemon_SOURCES = \ console_kit_daemon_LDADD = \ $(CONSOLE_KIT_LIBS) \ + libck.la \ $(NULL) noinst_PROGRAMS = \ test-tty-idle-monitor \ + test-vt-monitor \ + $(NULL) + +test_vt_monitor_SOURCES = \ + ck-vt-monitor.h \ + ck-vt-monitor.c \ + test-vt-monitor.c \ + $(NULL) + +test_vt_monitor_LDADD = \ + $(CONSOLE_KIT_LIBS) \ + libck.la \ $(NULL) test_tty_idle_monitor_SOURCES = \ @@ -107,6 +145,7 @@ test_tty_idle_monitor_SOURCES = \ test_tty_idle_monitor_LDADD = \ $(CONSOLE_KIT_LIBS) \ + libck.la \ $(NULL) EXTRA_DIST = \ diff --git a/src/Makefile.in b/src/Makefile.in index 336a570..2e660af 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -14,6 +14,7 @@ @SET_MAKE@ + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -36,8 +37,21 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@CK_COMPILE_LINUX_TRUE@am__append_1 = \ +@CK_COMPILE_LINUX_TRUE@ ck-sysdeps-linux.c \ +@CK_COMPILE_LINUX_TRUE@ $(NULL) + +@CK_COMPILE_SOLARIS_TRUE@am__append_2 = \ +@CK_COMPILE_SOLARIS_TRUE@ ck-sysdeps-solaris.c \ +@CK_COMPILE_SOLARIS_TRUE@ $(NULL) + +@CK_COMPILE_FREEBSD_TRUE@am__append_3 = \ +@CK_COMPILE_FREEBSD_TRUE@ ck-sysdeps-freebsd.c \ +@CK_COMPILE_FREEBSD_TRUE@ $(NULL) + sbin_PROGRAMS = console-kit-daemon$(EXEEXT) $(am__EXEEXT_1) -noinst_PROGRAMS = test-tty-idle-monitor$(EXEEXT) $(am__EXEEXT_1) +noinst_PROGRAMS = test-tty-idle-monitor$(EXEEXT) \ + test-vt-monitor$(EXEEXT) $(am__EXEEXT_1) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -48,6 +62,22 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +@CK_COMPILE_FREEBSD_TRUE@libck_la_DEPENDENCIES = \ +@CK_COMPILE_FREEBSD_TRUE@ $(am__DEPENDENCIES_1) +am__libck_la_SOURCES_DIST = ck-sysdeps.h ck-sysdeps-unix.c \ + ck-sysdeps-linux.c ck-sysdeps-solaris.c ck-sysdeps-freebsd.c +am__objects_1 = +@CK_COMPILE_LINUX_TRUE@am__objects_2 = ck-sysdeps-linux.lo \ +@CK_COMPILE_LINUX_TRUE@ $(am__objects_1) +@CK_COMPILE_SOLARIS_TRUE@am__objects_3 = ck-sysdeps-solaris.lo \ +@CK_COMPILE_SOLARIS_TRUE@ $(am__objects_1) +@CK_COMPILE_FREEBSD_TRUE@am__objects_4 = ck-sysdeps-freebsd.lo \ +@CK_COMPILE_FREEBSD_TRUE@ $(am__objects_1) +am_libck_la_OBJECTS = ck-sysdeps-unix.lo $(am__objects_1) \ + $(am__objects_2) $(am__objects_3) $(am__objects_4) +libck_la_OBJECTS = $(am_libck_la_OBJECTS) am__EXEEXT_1 = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) @@ -56,33 +86,35 @@ am__console_kit_daemon_SOURCES_DIST = main.c ck-manager.h ck-manager.c \ ck-vt-monitor.h ck-vt-monitor.c ck-tty-idle-monitor.h \ ck-tty-idle-monitor.c ck-file-monitor.h ck-job.h ck-job.c \ ck-seat.h ck-seat.c ck-session.h ck-session.c ck-log.h \ - ck-log.c getfd.c proc.h proc-linux.c ck-manager-glue.h \ - ck-seat-glue.h ck-session-glue.h ck-marshal.c ck-marshal.h \ - ck-file-monitor-dummy.c ck-file-monitor-inotify.c -am__objects_1 = -am__objects_2 = proc-linux.$(OBJEXT) $(am__objects_1) -am__objects_3 = ck-marshal.$(OBJEXT) $(am__objects_1) -@ENABLE_INOTIFY_FALSE@am__objects_4 = ck-file-monitor-dummy.$(OBJEXT) -@ENABLE_INOTIFY_TRUE@am__objects_4 = \ + ck-log.c ck-manager-glue.h ck-seat-glue.h ck-session-glue.h \ + ck-marshal.c ck-marshal.h ck-file-monitor-dummy.c \ + ck-file-monitor-inotify.c +am__objects_5 = ck-marshal.$(OBJEXT) $(am__objects_1) +@ENABLE_INOTIFY_FALSE@am__objects_6 = ck-file-monitor-dummy.$(OBJEXT) +@ENABLE_INOTIFY_TRUE@am__objects_6 = \ @ENABLE_INOTIFY_TRUE@ ck-file-monitor-inotify.$(OBJEXT) am_console_kit_daemon_OBJECTS = main.$(OBJEXT) ck-manager.$(OBJEXT) \ ck-vt-monitor.$(OBJEXT) ck-tty-idle-monitor.$(OBJEXT) \ ck-job.$(OBJEXT) ck-seat.$(OBJEXT) ck-session.$(OBJEXT) \ - ck-log.$(OBJEXT) getfd.$(OBJEXT) $(am__objects_2) \ - $(am__objects_3) $(am__objects_1) $(am__objects_4) + ck-log.$(OBJEXT) $(am__objects_5) $(am__objects_1) \ + $(am__objects_6) console_kit_daemon_OBJECTS = $(am_console_kit_daemon_OBJECTS) -am__DEPENDENCIES_1 = -console_kit_daemon_DEPENDENCIES = $(am__DEPENDENCIES_1) \ +console_kit_daemon_DEPENDENCIES = $(am__DEPENDENCIES_1) libck.la \ $(am__DEPENDENCIES_1) am__test_tty_idle_monitor_SOURCES_DIST = ck-tty-idle-monitor.h \ ck-tty-idle-monitor.c ck-file-monitor.h \ ck-file-monitor-dummy.c ck-file-monitor-inotify.c \ test-tty-idle-monitor.c am_test_tty_idle_monitor_OBJECTS = ck-tty-idle-monitor.$(OBJEXT) \ - $(am__objects_4) test-tty-idle-monitor.$(OBJEXT) \ + $(am__objects_6) test-tty-idle-monitor.$(OBJEXT) \ $(am__objects_1) test_tty_idle_monitor_OBJECTS = $(am_test_tty_idle_monitor_OBJECTS) -test_tty_idle_monitor_DEPENDENCIES = $(am__DEPENDENCIES_1) \ +test_tty_idle_monitor_DEPENDENCIES = $(am__DEPENDENCIES_1) libck.la \ + $(am__DEPENDENCIES_1) +am_test_vt_monitor_OBJECTS = ck-vt-monitor.$(OBJEXT) \ + test-vt-monitor.$(OBJEXT) $(am__objects_1) +test_vt_monitor_OBJECTS = $(am_test_vt_monitor_OBJECTS) +test_vt_monitor_DEPENDENCIES = $(am__DEPENDENCIES_1) libck.la \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -95,12 +127,15 @@ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(console_kit_daemon_SOURCES) \ +SOURCES = $(libck_la_SOURCES) $(EXTRA_libck_la_SOURCES) \ + $(console_kit_daemon_SOURCES) \ $(EXTRA_console_kit_daemon_SOURCES) \ - $(test_tty_idle_monitor_SOURCES) -DIST_SOURCES = $(am__console_kit_daemon_SOURCES_DIST) \ + $(test_tty_idle_monitor_SOURCES) $(test_vt_monitor_SOURCES) +DIST_SOURCES = $(am__libck_la_SOURCES_DIST) $(EXTRA_libck_la_SOURCES) \ + $(am__console_kit_daemon_SOURCES_DIST) \ $(EXTRA_console_kit_daemon_SOURCES) \ - $(am__test_tty_idle_monitor_SOURCES_DIST) + $(am__test_tty_idle_monitor_SOURCES_DIST) \ + $(test_vt_monitor_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -176,6 +211,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ +KVM_LIBS = @KVM_LIBS@ LDFLAGS = @LDFLAGS@ LIBDBUS_CFLAGS = @LIBDBUS_CFLAGS@ LIBDBUS_LIBS = @LIBDBUS_LIBS@ @@ -286,6 +322,19 @@ INCLUDES = \ $(DBUS_CFLAGS) \ $(NULL) +noinst_LTLIBRARIES = \ + libck.la \ + $(NULL) + +libck_la_SOURCES = ck-sysdeps.h ck-sysdeps-unix.c $(NULL) \ + $(am__append_1) $(am__append_2) $(am__append_3) +@CK_COMPILE_FREEBSD_TRUE@libck_la_LIBADD = $(KVM_LIBS) +EXTRA_libck_la_SOURCES = \ + ck-sysdeps-linux.c \ + ck-sysdeps-solaris.c \ + ck-sysdeps-freebsd.c \ + $(NULL) + BUILT_SOURCES = \ ck-manager-glue.h \ ck-seat-glue.h \ @@ -294,16 +343,11 @@ BUILT_SOURCES = \ ck-marshal.h \ $(NULL) -PLATFORM_SOURCES = \ - proc-linux.c \ - $(NULL) - console_kit_daemon_SOURCES = main.c ck-manager.h ck-manager.c \ ck-vt-monitor.h ck-vt-monitor.c ck-tty-idle-monitor.h \ ck-tty-idle-monitor.c ck-file-monitor.h ck-job.h ck-job.c \ ck-seat.h ck-seat.c ck-session.h ck-session.c ck-log.h \ - ck-log.c getfd.c proc.h $(PLATFORM_SOURCES) $(BUILT_SOURCES) \ - $(NULL) $(FILE_MONITOR_BACKEND) + ck-log.c $(BUILT_SOURCES) $(NULL) $(FILE_MONITOR_BACKEND) @ENABLE_INOTIFY_FALSE@FILE_MONITOR_BACKEND = ck-file-monitor-dummy.c @ENABLE_INOTIFY_TRUE@FILE_MONITOR_BACKEND = ck-file-monitor-inotify.c EXTRA_console_kit_daemon_SOURCES = \ @@ -313,6 +357,18 @@ EXTRA_console_kit_daemon_SOURCES = \ console_kit_daemon_LDADD = \ $(CONSOLE_KIT_LIBS) \ + libck.la \ + $(NULL) + +test_vt_monitor_SOURCES = \ + ck-vt-monitor.h \ + ck-vt-monitor.c \ + test-vt-monitor.c \ + $(NULL) + +test_vt_monitor_LDADD = \ + $(CONSOLE_KIT_LIBS) \ + libck.la \ $(NULL) test_tty_idle_monitor_SOURCES = \ @@ -325,6 +381,7 @@ test_tty_idle_monitor_SOURCES = \ test_tty_idle_monitor_LDADD = \ $(CONSOLE_KIT_LIBS) \ + libck.la \ $(NULL) EXTRA_DIST = \ @@ -377,6 +434,17 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libck.la: $(libck_la_OBJECTS) $(libck_la_DEPENDENCIES) + $(LINK) $(libck_la_LDFLAGS) $(libck_la_OBJECTS) $(libck_la_LIBADD) $(LIBS) + clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ @@ -417,6 +485,9 @@ console-kit-daemon$(EXEEXT): $(console_kit_daemon_OBJECTS) $(console_kit_daemon_ test-tty-idle-monitor$(EXEEXT): $(test_tty_idle_monitor_OBJECTS) $(test_tty_idle_monitor_DEPENDENCIES) @rm -f test-tty-idle-monitor$(EXEEXT) $(LINK) $(test_tty_idle_monitor_LDFLAGS) $(test_tty_idle_monitor_OBJECTS) $(test_tty_idle_monitor_LDADD) $(LIBS) +test-vt-monitor$(EXEEXT): $(test_vt_monitor_OBJECTS) $(test_vt_monitor_DEPENDENCIES) + @rm -f test-vt-monitor$(EXEEXT) + $(LINK) $(test_vt_monitor_LDFLAGS) $(test_vt_monitor_OBJECTS) $(test_vt_monitor_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -432,12 +503,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-marshal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-seat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-session.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-sysdeps-freebsd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-sysdeps-linux.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-sysdeps-solaris.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-sysdeps-unix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-tty-idle-monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-vt-monitor.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getfd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc-linux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-tty-idle-monitor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vt-monitor.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @@ -647,7 +721,7 @@ distdir: $(DISTFILES) check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(PROGRAMS) +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)"; do \ @@ -683,8 +757,8 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - clean-sbinPROGRAMS mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS clean-sbinPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) @@ -735,9 +809,9 @@ uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-noinstPROGRAMS \ - clean-recursive clean-sbinPROGRAMS ctags ctags-recursive \ - distclean distclean-compile distclean-generic \ + clean clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS clean-recursive clean-sbinPROGRAMS ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ distclean-libtool distclean-recursive distclean-tags distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ diff --git a/src/ck-file-monitor-inotify.c b/src/ck-file-monitor-inotify.c index 6e775e2..4fdd6aa 100644 --- a/src/ck-file-monitor-inotify.c +++ b/src/ck-file-monitor-inotify.c @@ -407,7 +407,7 @@ handle_inotify_event (CkFileMonitor *monitor, static gboolean inotify_data_pending (GIOChannel *source, - GIOCondition condition, + GIOCondition condition, CkFileMonitor *monitor) { int len; diff --git a/src/ck-job.c b/src/ck-job.c index 1093629..891c743 100644 --- a/src/ck-job.c +++ b/src/ck-job.c @@ -28,6 +28,7 @@ #include <sys/types.h> #include <sys/wait.h> #include <errno.h> +#include <signal.h> #include <glib.h> #include <glib/gi18n.h> @@ -44,8 +45,8 @@ struct CkJobPrivate guint out_watch_id; char *command; - GString *stdout; - GString *stderr; + GString *std_out; + GString *std_err; GPid child_pid; }; @@ -138,7 +139,7 @@ error_watch (GIOChannel *source, switch (status) { case G_IO_STATUS_NORMAL: g_debug ("command error output: %s", line); - g_string_append (job->priv->stderr, line); + g_string_append (job->priv->std_err, line); break; case G_IO_STATUS_EOF: finished = TRUE; @@ -183,7 +184,7 @@ out_watch (GIOChannel *source, switch (status) { case G_IO_STATUS_NORMAL: g_debug ("command output: %s", line); - g_string_append (job->priv->stdout, line); + g_string_append (job->priv->std_out, line); break; case G_IO_STATUS_EOF: finished = TRUE; @@ -281,10 +282,10 @@ ck_job_execute (CkJob *job, gboolean ck_job_get_stdout (CkJob *job, - char **stdout) + char **std_outp) { - if (stdout != NULL) { - *stdout = g_strdup (job->priv->stdout->str); + if (std_outp != NULL) { + *std_outp = g_strdup (job->priv->std_out->str); } return TRUE; } @@ -335,8 +336,8 @@ ck_job_init (CkJob *job) { job->priv = CK_JOB_GET_PRIVATE (job); - job->priv->stderr = g_string_new (NULL); - job->priv->stdout = g_string_new (NULL); + job->priv->std_err = g_string_new (NULL); + job->priv->std_out = g_string_new (NULL); } gboolean @@ -374,8 +375,8 @@ ck_job_finalize (GObject *object) g_source_remove (job->priv->err_watch_id); } g_free (job->priv->command); - g_string_free (job->priv->stdout, TRUE); - g_string_free (job->priv->stderr, TRUE); + g_string_free (job->priv->std_out, TRUE); + g_string_free (job->priv->std_err, TRUE); G_OBJECT_CLASS (ck_job_parent_class)->finalize (object); } diff --git a/src/ck-log.c b/src/ck-log.c index 9f49352..e7ae05b 100644 --- a/src/ck-log.c +++ b/src/ck-log.c @@ -178,12 +178,18 @@ void ck_log_init (void) { const char *prg_name; + int options; g_log_set_default_handler (ck_log_default_handler, NULL); prg_name = g_get_prgname (); - openlog (prg_name, LOG_PERROR|LOG_PID, LOG_DAEMON); + options = LOG_PID; +#ifdef LOG_PERROR + options |= LOG_PERROR; +#endif + + openlog (prg_name, options, LOG_DAEMON); initialized = TRUE; } diff --git a/src/ck-manager-glue.h b/src/ck-manager-glue.h index 6172f7d..0def872 100644 --- a/src/ck-manager-glue.h +++ b/src/ck-manager-glue.h @@ -53,7 +53,7 @@ G_BEGIN_DECLS #endif /* !G_ENABLE_DEBUG */ -/* BOOLEAN:POINTER,POINTER (/tmp/dbus-binding-tool-c-marshallers.87ODQT:1) */ +/* BOOLEAN:POINTER,POINTER (/tmp/dbus-binding-tool-c-marshallers.2JLIYT:1) */ extern void dbus_glib_marshal_ck_manager_BOOLEAN__POINTER_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, @@ -100,11 +100,11 @@ dbus_glib_marshal_ck_manager_BOOLEAN__POINTER_POINTER (GClosure *closure, g_value_set_boolean (return_value, v_return); } -/* NONE:UINT,POINTER (/tmp/dbus-binding-tool-c-marshallers.87ODQT:2) */ +/* NONE:UINT,POINTER (/tmp/dbus-binding-tool-c-marshallers.2JLIYT:2) */ #define dbus_glib_marshal_ck_manager_VOID__UINT_POINTER g_cclosure_marshal_VOID__UINT_POINTER #define dbus_glib_marshal_ck_manager_NONE__UINT_POINTER dbus_glib_marshal_ck_manager_VOID__UINT_POINTER -/* NONE:STRING,POINTER (/tmp/dbus-binding-tool-c-marshallers.87ODQT:3) */ +/* NONE:STRING,POINTER (/tmp/dbus-binding-tool-c-marshallers.2JLIYT:3) */ extern void dbus_glib_marshal_ck_manager_VOID__STRING_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, @@ -148,11 +148,11 @@ dbus_glib_marshal_ck_manager_VOID__STRING_POINTER (GClosure *closure, } #define dbus_glib_marshal_ck_manager_NONE__STRING_POINTER dbus_glib_marshal_ck_manager_VOID__STRING_POINTER -/* NONE:POINTER (/tmp/dbus-binding-tool-c-marshallers.87ODQT:4) */ +/* NONE:POINTER (/tmp/dbus-binding-tool-c-marshallers.2JLIYT:4) */ #define dbus_glib_marshal_ck_manager_VOID__POINTER g_cclosure_marshal_VOID__POINTER #define dbus_glib_marshal_ck_manager_NONE__POINTER dbus_glib_marshal_ck_manager_VOID__POINTER -/* NONE:BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.87ODQT:5) */ +/* NONE:BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.2JLIYT:5) */ extern void dbus_glib_marshal_ck_manager_VOID__BOXED_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, diff --git a/src/ck-manager.c b/src/ck-manager.c index 99eeed6..377cef0 100644 --- a/src/ck-manager.c +++ b/src/ck-manager.c @@ -43,20 +43,22 @@ #include "ck-job.h" #include "ck-marshal.h" -#include "proc.h" +#include "ck-sysdeps.h" #define CK_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CK_TYPE_MANAGER, CkManagerPrivate)) +#define CK_SEAT_DIR SYSCONFDIR "/ConsoleKit/seats.d" + #define CK_DBUS_PATH "/org/freedesktop/ConsoleKit" #define CK_MANAGER_DBUS_PATH CK_DBUS_PATH "/Manager" #define CK_MANAGER_DBUS_NAME "org.freedesktop.ConsoleKit.Manager" #define CK_TYPE_PARAMETER_STRUCT (dbus_g_type_get_struct ("GValueArray", \ - G_TYPE_STRING, \ - G_TYPE_VALUE, \ - G_TYPE_INVALID)) + G_TYPE_STRING, \ + G_TYPE_VALUE, \ + G_TYPE_INVALID)) #define CK_TYPE_PARAMETER_LIST (dbus_g_type_get_collection ("GPtrArray", \ - CK_TYPE_PARAMETER_STRUCT)) + CK_TYPE_PARAMETER_STRUCT)) struct CkManagerPrivate { GHashTable *seats; @@ -514,13 +516,13 @@ _g_time_val_to_iso8601 (GTimeVal *time_) g_return_val_if_fail (time_->tv_usec >= 0 && time_->tv_usec < G_USEC_PER_SEC, NULL); -#define ISO_8601_LEN 21 +#define ISO_8601_LEN 21 #define ISO_8601_FORMAT "%Y-%m-%dT%H:%M:%SZ" retval = g_new0 (gchar, ISO_8601_LEN + 1); strftime (retval, ISO_8601_LEN, - ISO_8601_FORMAT, - gmtime (&(time_->tv_sec))); + ISO_8601_FORMAT, + gmtime (&(time_->tv_sec))); return retval; } @@ -694,7 +696,7 @@ typedef void (* CkAddParamFunc) (GPtrArray *arr, const char *value); static struct { - char *key; + char *key; CkAddParamFunc func; } parse_ops[] = { { "display-device", add_param_string }, @@ -931,15 +933,15 @@ ck_manager_get_session_for_cookie (CkManager *manager, const char *cookie, DBusGMethodInvocation *context) { - gboolean res; - char *sender; - uid_t calling_uid; - pid_t calling_pid; - proc_stat_t *stat; - char *ssid; - CkSession *session; - LeaderInfo *leader_info; - GError *local_error; + gboolean res; + char *sender; + uid_t calling_uid; + pid_t calling_pid; + CkProcessStat *stat; + char *ssid; + CkSession *session; + LeaderInfo *leader_info; + GError *local_error; ssid = NULL; @@ -962,7 +964,7 @@ ck_manager_get_session_for_cookie (CkManager *manager, } local_error = NULL; - res = proc_stat_new_for_pid (calling_pid, &stat, &local_error); + res = ck_process_stat_new_for_unix_pid (calling_pid, &stat, &local_error); if (! res) { GError *error; error = g_error_new (CK_MANAGER_ERROR, @@ -980,7 +982,7 @@ ck_manager_get_session_for_cookie (CkManager *manager, } /* FIXME: should we restrict this by uid? */ - proc_stat_free (stat); + ck_process_stat_free (stat); leader_info = g_hash_table_lookup (manager->priv->leaders, cookie); if (leader_info == NULL) { @@ -1021,7 +1023,7 @@ get_cookie_for_pid (CkManager *manager, /* FIXME: need a better way to get the cookie */ - cookie = proc_pid_get_env (pid, "XDG_SESSION_COOKIE"); + cookie = ck_unix_pid_get_env (pid, "XDG_SESSION_COOKIE"); return cookie; } @@ -1038,13 +1040,13 @@ ck_manager_get_session_for_unix_process (CkManager *manager, guint pid, DBusGMethodInvocation *context) { - gboolean res; - char *sender; - uid_t calling_uid; - pid_t calling_pid; - proc_stat_t *stat; - char *cookie; - GError *error; + gboolean res; + char *sender; + uid_t calling_uid; + pid_t calling_pid; + CkProcessStat *stat; + char *cookie; + GError *error; sender = dbus_g_method_get_sender (context); @@ -1065,7 +1067,7 @@ ck_manager_get_session_for_unix_process (CkManager *manager, } error = NULL; - res = proc_stat_new_for_pid (calling_pid, &stat, &error); + res = ck_process_stat_new_for_unix_pid (calling_pid, &stat, &error); if (! res) { GError *error; g_debug ("stat on pid %d failed", calling_pid); @@ -1080,7 +1082,7 @@ ck_manager_get_session_for_unix_process (CkManager *manager, /* FIXME: check stuff? */ - proc_stat_free (stat); + ck_process_stat_free (stat); cookie = get_cookie_for_pid (manager, pid); if (cookie == NULL) { @@ -1545,11 +1547,61 @@ ck_manager_get_seats (CkManager *manager, } static void -create_seats (CkManager *manager) +add_seat_for_file (CkManager *manager, + const char *filename) { + char *sid; CkSeat *seat; - seat = add_new_seat (manager, CK_SEAT_KIND_STATIC); + sid = generate_seat_id (manager); + + seat = ck_seat_new_from_file (sid, filename); + if (seat == NULL) { + /* returns null if connection to bus fails */ + g_free (sid); + return; + } + + g_hash_table_insert (manager->priv->seats, sid, seat); + + g_debug ("Added seat: %s", sid); + + g_signal_emit (manager, signals [SEAT_ADDED], 0, sid); +} + +static gboolean +load_seats_from_dir (CkManager *manager) +{ + GDir *d; + GError *error; + const char *file; + + error = NULL; + d = g_dir_open (CK_SEAT_DIR, + 0, + &error); + if (d == NULL) { + g_warning ("Couldn't open seat dir: %s", error->message); + g_error_free (error); + return FALSE; + } + + while ((file = g_dir_read_name (d)) != NULL) { + char *path; + path = g_build_filename (CK_SEAT_DIR, file, NULL); + add_seat_for_file (manager, path); + g_free (path); + } + + g_dir_close (d); + + return TRUE; +} + +static void +create_seats (CkManager *manager) +{ + load_seats_from_dir (manager); } static void diff --git a/src/ck-seat-glue.h b/src/ck-seat-glue.h index af823bc..d6cbca1 100644 --- a/src/ck-seat-glue.h +++ b/src/ck-seat-glue.h @@ -53,7 +53,7 @@ G_BEGIN_DECLS #endif /* !G_ENABLE_DEBUG */ -/* BOOLEAN:POINTER,POINTER (/tmp/dbus-binding-tool-c-marshallers.NT25PT:1) */ +/* BOOLEAN:POINTER,POINTER (/tmp/dbus-binding-tool-c-marshallers.33NIYT:1) */ extern void dbus_glib_marshal_ck_seat_BOOLEAN__POINTER_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, @@ -100,7 +100,7 @@ dbus_glib_marshal_ck_seat_BOOLEAN__POINTER_POINTER (GClosure *closure, g_value_set_boolean (return_value, v_return); } -/* NONE:BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.NT25PT:2) */ +/* NONE:BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.33NIYT:2) */ extern void dbus_glib_marshal_ck_seat_VOID__BOXED_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, @@ -152,17 +152,18 @@ G_END_DECLS static const DBusGMethodInfo dbus_glib_ck_seat_methods[] = { { (GCallback) ck_seat_get_id, dbus_glib_marshal_ck_seat_BOOLEAN__POINTER_POINTER, 0 }, { (GCallback) ck_seat_get_sessions, dbus_glib_marshal_ck_seat_BOOLEAN__POINTER_POINTER, 53 }, - { (GCallback) ck_seat_get_active_session, dbus_glib_marshal_ck_seat_BOOLEAN__POINTER_POINTER, 118 }, - { (GCallback) ck_seat_can_activate_sessions, dbus_glib_marshal_ck_seat_BOOLEAN__POINTER_POINTER, 183 }, - { (GCallback) ck_seat_activate_session, dbus_glib_marshal_ck_seat_NONE__BOXED_POINTER, 259 }, + { (GCallback) ck_seat_get_devices, dbus_glib_marshal_ck_seat_BOOLEAN__POINTER_POINTER, 118 }, + { (GCallback) ck_seat_get_active_session, dbus_glib_marshal_ck_seat_BOOLEAN__POINTER_POINTER, 184 }, + { (GCallback) ck_seat_can_activate_sessions, dbus_glib_marshal_ck_seat_BOOLEAN__POINTER_POINTER, 249 }, + { (GCallback) ck_seat_activate_session, dbus_glib_marshal_ck_seat_NONE__BOXED_POINTER, 325 }, }; const DBusGObjectInfo dbus_glib_ck_seat_object_info = { 0, dbus_glib_ck_seat_methods, - 5, -"org.freedesktop.ConsoleKit.Seat\0GetId\0S\0sid\0O\0F\0N\0o\0\0org.freedesktop.ConsoleKit.Seat\0GetSessions\0S\0sessions\0O\0F\0N\0ao\0\0org.freedesktop.ConsoleKit.Seat\0GetActiveSession\0S\0ssid\0O\0F\0N\0o\0\0org.freedesktop.ConsoleKit.Seat\0CanActivateSessions\0S\0can_activate\0O\0F\0N\0b\0\0org.freedesktop.ConsoleKit.Seat\0ActivateSession\0A\0ssid\0I\0o\0\0\0", -"org.freedesktop.ConsoleKit.Seat\0ActiveSessionChanged\0org.freedesktop.ConsoleKit.Seat\0SessionAdded\0org.freedesktop.ConsoleKit.Seat\0SessionRemoved\0\0", + 6, +"org.freedesktop.ConsoleKit.Seat\0GetId\0S\0sid\0O\0F\0N\0o\0\0org.freedesktop.ConsoleKit.Seat\0GetSessions\0S\0sessions\0O\0F\0N\0ao\0\0org.freedesktop.ConsoleKit.Seat\0GetDevices\0S\0devices\0O\0F\0N\0a(ss)\0\0org.freedesktop.ConsoleKit.Seat\0GetActiveSession\0S\0ssid\0O\0F\0N\0o\0\0org.freedesktop.ConsoleKit.Seat\0CanActivateSessions\0S\0can_activate\0O\0F\0N\0b\0\0org.freedesktop.ConsoleKit.Seat\0ActivateSession\0A\0ssid\0I\0o\0\0\0", +"org.freedesktop.ConsoleKit.Seat\0ActiveSessionChanged\0org.freedesktop.ConsoleKit.Seat\0SessionAdded\0org.freedesktop.ConsoleKit.Seat\0SessionRemoved\0org.freedesktop.ConsoleKit.Seat\0DeviceAdded\0org.freedesktop.ConsoleKit.Seat\0DeviceRemoved\0\0", "\0" }; diff --git a/src/ck-seat.c b/src/ck-seat.c index a77e0b1..e04b569 100644 --- a/src/ck-seat.c +++ b/src/ck-seat.c @@ -25,13 +25,6 @@ #include <fcntl.h> #include <unistd.h> #include <string.h> -#ifdef HAVE_PATHS_H -#include <paths.h> -#endif /* HAVE_PATHS_H */ - -#ifndef _PATH_TTY -#define _PATH_TTY "/dev/tty" -#endif #include <glib.h> #include <glib/gi18n.h> @@ -41,6 +34,8 @@ #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-lowlevel.h> +#include "ck-sysdeps.h" + #include "ck-seat.h" #include "ck-seat-glue.h" #include "ck-marshal.h" @@ -53,11 +48,13 @@ #define CK_DBUS_PATH "/org/freedesktop/ConsoleKit" #define CK_DBUS_NAME "org.freedesktop.ConsoleKit" + struct CkSeatPrivate { char *id; CkSeatKind kind; GHashTable *sessions; + GPtrArray *devices; CkSession *active_session; @@ -70,6 +67,8 @@ enum { ACTIVE_SESSION_CHANGED, SESSION_ADDED, SESSION_REMOVED, + DEVICE_ADDED, + DEVICE_REMOVED, LAST_SIGNAL }; @@ -169,6 +168,7 @@ _seat_activate_session (CkSeat *seat, CkSession *session, DBusGMethodInvocation *context) { + gboolean res; gboolean ret; guint num; char *device; @@ -202,7 +202,8 @@ _seat_activate_session (CkSeat *seat, ck_session_get_display_device (session, &device, NULL); - if (device == NULL || (sscanf (device, _PATH_TTY "%u", &num) != 1)) { + res = ck_get_console_num_from_device (device, &num); + if (! res) { GError *error; error = g_error_new (CK_SEAT_ERROR, CK_SEAT_ERROR_GENERAL, @@ -486,7 +487,7 @@ update_active_vt (CkSeat *seat, CkSession *session; char *device; - device = g_strdup_printf (_PATH_TTY "%u", num); + device = ck_get_console_device_for_num (num); g_debug ("Active device: %s", device); @@ -605,6 +606,60 @@ ck_seat_can_activate_sessions (CkSeat *seat, return TRUE; } +static gboolean +ck_seat_has_device (CkSeat *seat, + GValueArray *device, + gboolean *result, + GError *error) +{ + g_return_val_if_fail (CK_IS_SEAT (seat), FALSE); + + return TRUE; +} + +gboolean +ck_seat_add_device (CkSeat *seat, + GValueArray *device, + GError **error) +{ + gboolean present; + + g_return_val_if_fail (CK_IS_SEAT (seat), FALSE); + + /* FIXME: check if already present */ + present = FALSE; + ck_seat_has_device (seat, device, &present, NULL); + if (present) { + g_set_error (error, CK_SEAT_ERROR, CK_SEAT_ERROR_GENERAL, "%s", "Device already present"); + return FALSE; + } + + g_ptr_array_add (seat->priv->devices, g_boxed_copy (CK_TYPE_DEVICE, device)); + + g_debug ("Emitting device added signal"); + + g_signal_emit (seat, signals [DEVICE_ADDED], 0, device); + + return TRUE; +} + +gboolean +ck_seat_remove_device (CkSeat *seat, + GValueArray *device, + GError **error) +{ + g_return_val_if_fail (CK_IS_SEAT (seat), FALSE); + + /* FIXME: check if already present */ + if (0) { + g_debug ("Emitting device removed signal"); + + g_signal_emit (seat, signals [DEVICE_REMOVED], 0, device); + } + + return TRUE; +} + gboolean ck_seat_get_kind (CkSeat *seat, CkSeatKind *kind, @@ -689,6 +744,38 @@ ck_seat_get_sessions (CkSeat *seat, } static void +copy_devices (gpointer data, + GPtrArray **array) +{ + g_ptr_array_add (*array, data); +} + +/* + Example: + dbus-send --system --dest=org.freedesktop.ConsoleKit \ + --type=method_call --print-reply --reply-timeout=2000 \ + /org/freedesktop/ConsoleKit/Seat1 \ + org.freedesktop.ConsoleKit.Seat.GetDevices +*/ + +gboolean +ck_seat_get_devices (CkSeat *seat, + GPtrArray **devices, + GError **error) +{ + g_return_val_if_fail (CK_IS_SEAT (seat), FALSE); + + if (devices == NULL) { + return FALSE; + } + + *devices = g_ptr_array_sized_new (seat->priv->devices->len); + g_ptr_array_foreach (seat->priv->devices, (GFunc)copy_devices, devices); + + return TRUE; +} + +static void _ck_seat_set_id (CkSeat *seat, const char *id) { @@ -809,6 +896,25 @@ ck_seat_class_init (CkSeatClass *klass) G_TYPE_NONE, 1, G_TYPE_STRING); + signals [DEVICE_ADDED] = g_signal_new ("device-added", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (CkSeatClass, device_added), + NULL, + NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, + 1, CK_TYPE_DEVICE); + signals [DEVICE_REMOVED] = g_signal_new ("device-removed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (CkSeatClass, device_removed), + NULL, + NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, + 1, CK_TYPE_DEVICE); + g_object_class_install_property (object_class, PROP_ID, g_param_spec_string ("id", @@ -839,6 +945,7 @@ ck_seat_init (CkSeat *seat) g_str_equal, g_free, (GDestroyNotify) g_object_unref); + seat->priv->devices = g_ptr_array_new (); } static void @@ -861,6 +968,7 @@ ck_seat_finalize (GObject *object) g_object_unref (seat->priv->active_session); } + g_ptr_array_free (seat->priv->devices, TRUE); g_hash_table_destroy (seat->priv->sessions); g_free (seat->priv->id); @@ -887,3 +995,111 @@ ck_seat_new (const char *sid, return CK_SEAT (object); } + +CkSeat * +ck_seat_new_with_devices (const char *sid, + CkSeatKind kind, + GPtrArray *devices) +{ + GObject *object; + gboolean res; + int i; + + object = g_object_new (CK_TYPE_SEAT, + "id", sid, + "kind", kind, + NULL); + + if (devices != NULL) { + for (i = 0; i < devices->len; i++) { + ck_seat_add_device (CK_SEAT (object), g_ptr_array_index (devices, i), NULL); + } + } + + res = register_seat (CK_SEAT (object)); + if (! res) { + g_object_unref (object); + return NULL; + } + + return CK_SEAT (object); +} + +CkSeat * +ck_seat_new_from_file (const char *sid, + const char *path) +{ + GKeyFile *key_file; + gboolean res; + GError *error; + char *group; + CkSeat *seat; + gboolean hidden; + GPtrArray *devices; + char **device_list; + gsize ndevices; + gsize i; + + key_file = g_key_file_new (); + error = NULL; + res = g_key_file_load_from_file (key_file, + path, + G_KEY_FILE_NONE, + &error); + if (! res) { + g_warning ("Unable to load seats from file %s: %s", path, error->message); + g_error_free (error); + return NULL; + } + + group = g_key_file_get_start_group (key_file); + if (group == NULL || strcmp (group, "Seat Entry") != 0) { + g_warning ("Not a seat file: %s", path); + return NULL; + } + + hidden = g_key_file_get_boolean (key_file, group, "Hidden", NULL); + if (hidden) { + g_debug ("Seat is hidden"); + return NULL; + } + + device_list = g_key_file_get_string_list (key_file, group, "Devices", &ndevices, NULL); + + g_debug ("Creating seat %s with %d devices", sid, ndevices); + + devices = g_ptr_array_sized_new (ndevices); + + for (i = 0; i < ndevices; i++) { + char **split; + GValue device_val = { 0, }; + + split = g_strsplit (device_list[i], ":", 2); + + if (split == NULL) { + continue; + } + + g_debug ("Adding device: %s %s", split[0], split[1]); + + g_value_init (&device_val, CK_TYPE_DEVICE); + g_value_take_boxed (&device_val, + dbus_g_type_specialized_construct (CK_TYPE_DEVICE)); + dbus_g_type_struct_set (&device_val, + 0, split[0], + 1, split[1], + G_MAXUINT); + + g_ptr_array_add (devices, g_value_get_boxed (&device_val)); + + g_strfreev (split); + } + + g_free (group); + + seat = ck_seat_new_with_devices (sid, CK_SEAT_KIND_STATIC, devices); + + g_ptr_array_free (devices, TRUE); + + return seat; +} diff --git a/src/ck-seat.h b/src/ck-seat.h index 4707bf9..63ab3d5 100644 --- a/src/ck-seat.h +++ b/src/ck-seat.h @@ -47,12 +47,16 @@ typedef struct { GObjectClass parent_class; - void (* active_session_changed) (CkSeat *seat, - const char *ssid); - void (* session_added) (CkSeat *seat, - const char *ssid); - void (* session_removed) (CkSeat *seat, - const char *ssid); + void (* active_session_changed) (CkSeat *seat, + const char *ssid); + void (* session_added) (CkSeat *seat, + const char *ssid); + void (* session_removed) (CkSeat *seat, + const char *ssid); + void (* device_added) (CkSeat *seat, + GValueArray *device); + void (* device_removed) (CkSeat *seat, + GValueArray *device); } CkSeatClass; typedef enum @@ -71,10 +75,21 @@ typedef enum #define CK_SEAT_ERROR ck_seat_error_quark () + +#define CK_TYPE_DEVICE (dbus_g_type_get_struct ("GValueArray", \ + G_TYPE_STRING, \ + G_TYPE_STRING, \ + G_TYPE_INVALID)) + GQuark ck_seat_error_quark (void); GType ck_seat_get_type (void); CkSeat * ck_seat_new (const char *sid, CkSeatKind kind); +CkSeat * ck_seat_new_from_file (const char *sid, + const char *path); +CkSeat * ck_seat_new_with_devices (const char *sid, + CkSeatKind kind, + GPtrArray *devices); gboolean ck_seat_get_kind (CkSeat *seat, CkSeatKind *kind, GError **error); @@ -87,6 +102,12 @@ gboolean ck_seat_remove_session (CkSeat *seat, gboolean ck_seat_set_active_session (CkSeat *seat, CkSession *session, GError **error); +gboolean ck_seat_add_device (CkSeat *seat, + GValueArray *device, + GError **error); +gboolean ck_seat_remove_device (CkSeat *seat, + GValueArray *device, + GError **error); /* exported methods */ gboolean ck_seat_get_id (CkSeat *seat, @@ -95,6 +116,9 @@ gboolean ck_seat_get_id (CkSeat *seat, gboolean ck_seat_get_sessions (CkSeat *seat, GPtrArray **sessions, GError **error); +gboolean ck_seat_get_devices (CkSeat *seat, + GPtrArray **devices, + GError **error); gboolean ck_seat_get_active_session (CkSeat *seat, char **ssid, GError **error); diff --git a/src/ck-seat.xml b/src/ck-seat.xml index 5fda057..b66fcaa 100644 --- a/src/ck-seat.xml +++ b/src/ck-seat.xml @@ -7,6 +7,9 @@ <method name="GetSessions"> <arg name="sessions" direction="out" type="ao"/> </method> + <method name="GetDevices"> + <arg name="devices" direction="out" type="a(ss)"/> + </method> <method name="GetActiveSession"> <arg name="ssid" direction="out" type="o"/> </method> @@ -26,5 +29,11 @@ <signal name="SessionRemoved"> <arg name="ssid" type="o"/> </signal> + <signal name="DeviceAdded"> + <arg name="device" type="(ss)"/> + </signal> + <signal name="DeviceRemoved"> + <arg name="device" type="(ss)"/> + </signal> </interface> </node> diff --git a/src/ck-session-glue.h b/src/ck-session-glue.h index 9323c73..cabded2 100644 --- a/src/ck-session-glue.h +++ b/src/ck-session-glue.h @@ -53,7 +53,7 @@ G_BEGIN_DECLS #endif /* !G_ENABLE_DEBUG */ -/* BOOLEAN:POINTER,POINTER (/tmp/dbus-binding-tool-c-marshallers.CVG6PT:1) */ +/* BOOLEAN:POINTER,POINTER (/tmp/dbus-binding-tool-c-marshallers.8HEIYT:1) */ extern void dbus_glib_marshal_ck_session_BOOLEAN__POINTER_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, @@ -100,7 +100,7 @@ dbus_glib_marshal_ck_session_BOOLEAN__POINTER_POINTER (GClosure *closure, g_value_set_boolean (return_value, v_return); } -/* NONE:BOOLEAN,POINTER (/tmp/dbus-binding-tool-c-marshallers.CVG6PT:2) */ +/* NONE:BOOLEAN,POINTER (/tmp/dbus-binding-tool-c-marshallers.8HEIYT:2) */ extern void dbus_glib_marshal_ck_session_VOID__BOOLEAN_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, @@ -144,7 +144,7 @@ dbus_glib_marshal_ck_session_VOID__BOOLEAN_POINTER (GClosure *closure, } #define dbus_glib_marshal_ck_session_NONE__BOOLEAN_POINTER dbus_glib_marshal_ck_session_VOID__BOOLEAN_POINTER -/* NONE:POINTER (/tmp/dbus-binding-tool-c-marshallers.CVG6PT:3) */ +/* NONE:POINTER (/tmp/dbus-binding-tool-c-marshallers.8HEIYT:3) */ #define dbus_glib_marshal_ck_session_VOID__POINTER g_cclosure_marshal_VOID__POINTER #define dbus_glib_marshal_ck_session_NONE__POINTER dbus_glib_marshal_ck_session_VOID__POINTER diff --git a/src/ck-session.c b/src/ck-session.c index c4e286a..f136333 100644 --- a/src/ck-session.c +++ b/src/ck-session.c @@ -321,13 +321,13 @@ _g_time_val_to_iso8601 (GTimeVal *time_) g_return_val_if_fail (time_->tv_usec >= 0 && time_->tv_usec < G_USEC_PER_SEC, NULL); -#define ISO_8601_LEN 21 +#define ISO_8601_LEN 21 #define ISO_8601_FORMAT "%Y-%m-%dT%H:%M:%SZ" retval = g_new0 (gchar, ISO_8601_LEN + 1); strftime (retval, ISO_8601_LEN, - ISO_8601_FORMAT, - gmtime (&(time_->tv_sec))); + ISO_8601_FORMAT, + gmtime (&(time_->tv_sec))); return retval; } @@ -1103,7 +1103,7 @@ ck_session_new_with_parameters (const char *ssid, guint n_allocated_params; guint n_params; GObjectClass *class; - GType object_type; + GType object_type; object_type = CK_TYPE_SESSION; class = g_type_class_ref (object_type); diff --git a/src/ck-sysdeps-freebsd.c b/src/ck-sysdeps-freebsd.c new file mode 100644 index 0000000..d7c7c0c --- /dev/null +++ b/src/ck-sysdeps-freebsd.c @@ -0,0 +1,423 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2006 William Jon McCann <mccann@jhu.edu> + * Copyright (C) 2007 Joe Marcus Clarke <marcus@FreeBSD.org> + * + * 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 <sys/consio.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_proc *p) +{ + int mib[4]; + size_t len; + + len = 4; + sysctlnametomib ("kern.proc.pid", mib, &len); + + len = sizeof(struct kinfo_proc); + mib[3] = pid; + + if (sysctl (mib, 4, p, &len, NULL, 0) == -1) { + 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 = OCOMMLEN; + if (num >= sizeof P->cmd) { + num = sizeof P->cmd - 1; + } + + memcpy (P->cmd, p.ki_ocomm, num); + + P->cmd[num] = '\0'; + P->pid = p.ki_pid; + P->ppid = p.ki_ppid; + P->pgrp = p.ki_pgid; + P->session = p.ki_sid; + P->rss = p.ki_rssize; + P->vsize = p.ki_size; + P->start_time = p.ki_start.tv_sec; + P->wchan = (unsigned long) p.ki_wchan; + P->state = p.ki_stat; + P->nice = p.ki_nice; + P->flags = p.ki_sflag; + P->tpgid = p.ki_tpgid; + P->processor = p.ki_oncpu; + P->nlwp = p.ki_numthreads; + + /* we like it Linux-encoded :-) */ + tty_maj = major (p.ki_tdev); + tty_min = minor (p.ki_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.ki_tdev != NODEV && (ttname = devname (p.ki_tdev, S_IFCHR)) != NULL) { + memcpy (P->tty_text, ttname, sizeof P->tty_text); + } + + if (p.ki_tdev == NODEV) { + memcpy (P->tty_text, " ? ", 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; + GError *local_error; + 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 { + g_propagate_error (error, local_error); + *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; + char **penv; + kvm_t *kd; + struct kinfo_proc p; + int i; + + kd = kvm_openfiles (_PATH_DEVNULL, _PATH_DEVNULL, NULL, O_RDONLY, NULL); + if (kd == NULL) { + return NULL; + } + + if (! get_kinfo_proc (pid, &p)) { + return NULL; + } + + penv = kvm_getenvv (kd, &p, 0); + if (penv == NULL) { + return NULL; + } + + 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; + + 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); + } + } + + kvm_close (kd); + + return hash; +} + +char * +ck_unix_pid_get_env (pid_t pid, + const char *var) +{ + GHashTable *hash; + char *val; + + /* + * 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); + 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.ki_uid; + } + + return uid; +} + +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, "ttyv", 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; +} + +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/ttyv%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/ttyv%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 (ttyv%d)", active, active - 1); + ret = TRUE; + + out: + if (num != NULL) { + *num = active; + } + + return ret; +} diff --git a/src/proc-linux.c b/src/ck-sysdeps-linux.c index d704e18..7dc99f7 100644 --- a/src/proc-linux.c +++ b/src/ck-sysdeps-linux.c @@ -25,17 +25,27 @@ #include <fcntl.h> #include <unistd.h> #include <string.h> +#include <errno.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/ioctl.h> + +#include <sys/vt.h> +#include <linux/tty.h> +#include <linux/kd.h> #ifdef HAVE_PATHS_H #include <paths.h> #endif /* HAVE_PATHS_H */ -#include "proc.h" +#include "ck-sysdeps.h" + +#ifndef ERROR +#define ERROR -1 +#endif /* adapted from procps */ -struct _proc_stat_t +struct _CkProcessStat { int pid; int ppid; /* stat,status pid of parent process */ @@ -111,7 +121,7 @@ load_drivers (void) buf[bytes] = '\0'; p = buf; - while ((p = strstr (p, " " _PATH_DEV))){ + while ((p = strstr (p, " " _PATH_DEV))) { tty_map_node *tmn; int len; char *end; @@ -263,7 +273,7 @@ link_name (guint maj, } pid_t -proc_stat_get_ppid (proc_stat_t *stat) +ck_process_stat_get_ppid (CkProcessStat *stat) { g_return_val_if_fail (stat != NULL, -1); @@ -271,7 +281,7 @@ proc_stat_get_ppid (proc_stat_t *stat) } char * -proc_stat_get_cmd (proc_stat_t *stat) +ck_process_stat_get_cmd (CkProcessStat *stat) { g_return_val_if_fail (stat != NULL, NULL); @@ -280,7 +290,7 @@ proc_stat_get_cmd (proc_stat_t *stat) /* adapted from procps */ char * -proc_stat_get_tty (proc_stat_t *stat) +ck_process_stat_get_tty (CkProcessStat *stat) { guint dev; char *tty; @@ -328,8 +338,8 @@ proc_stat_get_tty (proc_stat_t *stat) #define KLF "l" /* adapted from procps */ static void -stat2proc (const char *S, - proc_stat_t *P) +stat2proc (const char *S, + CkProcessStat *P) { unsigned num; char * tmp; @@ -392,16 +402,16 @@ stat2proc (const char *S, } gboolean -proc_stat_new_for_pid (pid_t pid, - proc_stat_t **stat, - GError **error) +ck_process_stat_new_for_unix_pid (pid_t pid, + CkProcessStat **stat, + GError **error) { - char *path; - char *contents; - gsize length; - gboolean res; - GError *local_error; - proc_stat_t *proc; + char *path; + char *contents; + gsize length; + gboolean res; + GError *local_error; + CkProcessStat *proc; g_return_val_if_fail (pid > 1, FALSE); @@ -418,7 +428,7 @@ proc_stat_new_for_pid (pid_t pid, &length, &local_error); if (res) { - proc = g_new0 (proc_stat_t, 1); + proc = g_new0 (CkProcessStat, 1); proc->pid = pid; stat2proc (contents, proc); *stat = proc; @@ -434,13 +444,13 @@ proc_stat_new_for_pid (pid_t pid, } void -proc_stat_free (proc_stat_t *stat) +ck_process_stat_free (CkProcessStat *stat) { g_free (stat); } GHashTable * -proc_pid_get_env_hash (pid_t pid) +ck_unix_pid_get_env_hash (pid_t pid) { char *path; gboolean res; @@ -484,7 +494,10 @@ proc_pid_get_env_hash (pid_t pid) char **vals; vals = g_strsplit (contents + i, "=", 2); if (vals != NULL) { - g_hash_table_insert (hash, vals[0], vals[1]); + g_hash_table_insert (hash, + g_strdup (vals[0]), + g_strdup (vals[1])); + g_strfreev (vals); } } last_was_null = FALSE; @@ -498,8 +511,8 @@ proc_pid_get_env_hash (pid_t pid) } char * -proc_pid_get_env (pid_t pid, - const char *var) +ck_unix_pid_get_env (pid_t pid, + const char *var) { char *path; gboolean res; @@ -558,7 +571,7 @@ proc_pid_get_env (pid_t pid, } uid_t -proc_pid_get_uid (pid_t pid) +ck_unix_pid_get_uid (pid_t pid) { struct stat st; char *path; @@ -581,25 +594,113 @@ proc_pid_get_uid (pid_t pid) } pid_t -proc_pid_get_ppid (pid_t pid) +ck_unix_pid_get_ppid (pid_t pid) { - int ppid; - gboolean res; - proc_stat_t *stat; + int ppid; + gboolean res; + CkProcessStat *stat; g_return_val_if_fail (pid > 1, 0); ppid = -1; - res = proc_stat_new_for_pid (pid, &stat, NULL); + res = ck_process_stat_new_for_unix_pid (pid, &stat, NULL); if (! res) { goto out; } - ppid = proc_stat_get_ppid (stat); + ppid = ck_process_stat_get_ppid (stat); - proc_stat_free (stat); + ck_process_stat_free (stat); out: return ppid; } + +gboolean +ck_get_max_num_consoles (guint *num) +{ + if (num != NULL) { + *num = MAX_NR_CONSOLES; + } + + return TRUE; +} + +char * +ck_get_console_device_for_num (guint num) +{ + char *device; + + device = g_strdup_printf (_PATH_TTY "%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, _PATH_TTY "%u", &n) == 1) { + ret = TRUE; + } + + if (num != NULL) { + *num = n; + } + + return ret; +} + +gboolean +ck_get_active_console_num (int console_fd, + guint *num) +{ + gboolean ret; + int res; + guint active; + struct vt_stat stat; + + g_assert (console_fd != -1); + + active = 0; + ret = FALSE; + + res = ioctl (console_fd, VT_GETSTATE, &stat); + if (res == ERROR) { + perror ("ioctl VT_GETSTATE"); + goto out; + } + + { + int i; + + g_debug ("Current VT: tty%d", stat.v_active); + for (i = 1; i <= 16; i++) { + gboolean is_on; + is_on = stat.v_state & (1 << i); + + g_debug ("VT %d:%s", i, is_on ? "on" : "off"); + } + } + + active = stat.v_active; + ret = TRUE; + + out: + if (num != NULL) { + *num = active; + } + + return ret; +} diff --git a/src/ck-sysdeps-solaris.c b/src/ck-sysdeps-solaris.c new file mode 100644 index 0000000..9cfec2e --- /dev/null +++ b/src/ck-sysdeps-solaris.c @@ -0,0 +1,469 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2006 William Jon McCann <mccann@jhu.edu> + * + * 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 <sys/types.h> +#include <sys/stat.h> +#include <sys/ioctl.h> + +#define DEV_ENCODE(M,m) ( \ + ( (M&0xfff) << 8) | ( (m&0xfff00) << 12) | (m&0xff) \ +) + +#include <sys/int_types.h> +#include <sys/mkdev.h> +#define _STRUCTURED_PROC 1 +#include <sys/procfs.h> +#define NO_TTY_VALUE DEV_ENCODE(-1,-1) + +#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); +} + +/* adapted from procps */ +char * +ck_process_stat_get_tty (CkProcessStat *stat) +{ + guint dev; + char *tty; + guint dev_maj; + guint dev_min; + pid_t pid; + + g_return_val_if_fail (stat != NULL, NULL); + + return g_strdup (stat->tty_text); +} + +/* return 1 if it works, or 0 for failure */ +static gboolean +stat2proc (pid_t pid, + CkProcessStat *P) +{ + struct psinfo p; + char buf[32]; + int num; + int fd; + int tty_maj; + int tty_min; + + snprintf (buf, sizeof buf, "/proc/%d/psinfo", pid); + + if ((fd = open (buf, O_RDONLY, 0) ) == -1 ) { + return FALSE; + } + + num = read (fd, &p, sizeof p); + close (fd); + + if (num != sizeof p) { + return FALSE; + } + + num = PRFNSZ; + if (num >= sizeof P->cmd) { + num = sizeof P->cmd - 1; + } + + memcpy (P->cmd, p.pr_fname, num); /* p.pr_fname or p.pr_lwp.pr_name */ + + P->cmd[num] = '\0'; + P->pid = p.pr_pid; + P->ppid = p.pr_ppid; + P->pgrp = p.pr_pgid; + P->session = p.pr_sid; + P->rss = p.pr_rssize; + P->vsize = p.pr_size; + P->start_time = p.pr_start.tv_sec; + P->wchan = p.pr_lwp.pr_wchan; + P->state = p.pr_lwp.pr_sname; + P->nice = p.pr_lwp.pr_nice; + P->priority = p.pr_lwp.pr_pri; /* or pr_oldpri */ + P->penv = p.pr_envp; + + /* we like it Linux-encoded :-) */ + tty_maj = major (p.pr_ttydev); + tty_min = minor (p.pr_ttydev); + P->tty = DEV_ENCODE (tty_maj,tty_min); + + snprintf (P->tty_text, sizeof P->tty_text, "%3d,%-3d", tty_maj, tty_min); + + if (tty_maj == 24) { + snprintf (P->tty_text, sizeof P->tty_text, "pts/%-3u", tty_min); + } + + if (P->tty == NO_TTY_VALUE) { + memcpy (P->tty_text, " ? ", 8); + } + + if (P->tty == DEV_ENCODE(0,0)) { + memcpy (P->tty_text, "console", 8); + } + + if (P->pid != pid) { + return FALSE; + } + + return TRUE; +} + +gboolean +ck_process_stat_new_for_unix_pid (pid_t pid, + CkProcessStat **stat, + GError **error) +{ + char *path; + char *contents; + gsize length; + gboolean res; + GError *local_error; + 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 { + g_propagate_error (error, local_error); + *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; + char *cmd; + char buf[BUFSIZ]; + FILE *fp; + int i; + + hash = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_free); + + cmd = g_strdup_printf ("pargs -e %d", pid); + fp = popen (cmd, "r"); + g_free (cmd); + + while (fgets (buf, BUFSIZ, fp) != NULL) { + g_strchomp (buf); + if (g_str_has_prefix (buf, "envp[")) { + char *skip_prefix; + + skip_prefix = strstr (buf, " "); + + if (skip_prefix != NULL) { + char **vals; + vals = g_strsplit (buf, "=", 2); + if (vals != NULL) { + g_hash_table_insert (hash, + g_strdup (vals[0]), + g_strdup (vals[1])); + g_strfreev (vals); + } + } + } + } + + out: + return hash; +} + +char * +ck_unix_pid_get_env (pid_t pid, + const char *var) +{ + GHashTable *hash; + char *val; + + /* + * 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); + 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) +{ + struct stat st; + char *path; + int uid; + int res; + + g_return_val_if_fail (pid > 1, 0); + + uid = -1; + + path = g_strdup_printf ("/proc/%u", (guint)pid); + res = stat (path, &st); + g_free (path); + + if (res == 0) { + uid = st.st_uid; + } + + return uid; +} + +pid_t +ck_unix_pid_get_ppid (pid_t pid) +{ + int ppid; + gboolean res; + CkProcessStat *stat; + + g_return_val_if_fail (pid > 1, 0); + + ppid = -1; + + res = ck_process_stat_new_for_unix_pid (pid, &stat, NULL); + if (! res) { + goto out; + } + + ppid = ck_process_stat_get_ppid (stat); + + ck_process_stat_free (stat); + + out: + return ppid; +} + +gboolean +ck_get_max_num_consoles (guint *num) +{ + GError *error; + char *svcprop_stdout; + int status; + int max_consoles; + gboolean res; + gboolean ret; + + ret = FALSE; + + /* + * On Solaris, the default number of VT's is determined by + * resources and is stored in the vtdaemon SVC property + * options/vtnodecount. If the svcprop command fails, then it can + * be safely assumed that VT is not supported on this release of + * Solaris. + */ + + error = NULL; + svcprop_stdout = NULL; + status = 0; + res = g_spawn_command_line_sync ("/usr/bin/svcprop -p options/vtnodecount vtdaemon", + &svcprop_stdout, + NULL, + &status, + &error); + + if (res) { + if (error == NULL && svcprop_stdout != NULL) { + char *end; + + end = NULL; + errno = 0; + max_consoles = strtol (svcprop_stdout, &end, 0); + if (end == NULL || end == svcprop_stdout || errno != 0) { + max_consoles = 0; + } else { + ret = TRUE; + } + } + } + + if (num != NULL) { + *num = max_consoles; + } + + g_free (svcprop_stdout); + + return ret; +} + +char * +ck_get_console_device_for_num (guint num) +{ + char *device; + + device = g_strdup_printf ("/dev/vt/%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/vt/%u", &n) == 1) { + ret = TRUE; + } + + if (num != NULL) { + *num = n; + } + + return ret; +} + +gboolean +ck_get_active_console_num (int console_fd, + guint *num) +{ + gboolean ret; + int res; + guint active; + struct vt_stat stat; + + g_assert (console_fd != -1); + + active = 0; + ret = FALSE; + + res = ioctl (console_fd, VT_GETSTATE, &stat); + if (res == ERROR) { + perror ("ioctl VT_GETSTATE"); + goto out; + } + + { + int i; + + g_debug ("Current VT: tty%d", stat.v_active); + for (i = 1; i <= 16; i++) { + gboolean is_on; + is_on = stat.v_state & (1 << i); + + g_debug ("VT %d:%s", i, is_on ? "on" : "off"); + } + } + + active = stat.v_active; + ret = TRUE; + + out: + if (num != NULL) { + *num = active; + } + + return ret; +} diff --git a/src/ck-sysdeps-unix.c b/src/ck-sysdeps-unix.c new file mode 100644 index 0000000..0001b6b --- /dev/null +++ b/src/ck-sysdeps-unix.c @@ -0,0 +1,305 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2006 William Jon McCann <mccann@jhu.edu> + * + * 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 <sys/types.h> +#include <sys/stat.h> +#include <sys/socket.h> +#include <sys/ioctl.h> + +#ifdef __linux__ +#include <linux/kd.h> +#include <sys/vt.h> +#endif + +#ifdef __FreeBSD__ +#include <sys/consio.h> +#endif + +#ifdef HAVE_GETPEERUCRED +#include <ucred.h> +#endif + +#include "ck-sysdeps.h" + +#ifndef ERROR +#define ERROR -1 +#endif + +/* Adapted from dbus-sysdeps-unix.c:_dbus_read_credentials_socket() */ +gboolean +ck_get_socket_peer_credentials (int socket_fd, + pid_t *pid, + uid_t *uid, + GError **error) +{ + gboolean ret; + uid_t uid_read; + pid_t pid_read; + + pid_read = -1; + uid_read = -1; + ret = FALSE; + +#ifdef SO_PEERCRED + struct ucred cr; + socklen_t cr_len; + + cr_len = sizeof (cr); + + if (getsockopt (socket_fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) == 0 && cr_len == sizeof (cr)) { + pid_read = cr.pid; + uid_read = cr.uid; + ret = TRUE; + } else { + g_warning ("Failed to getsockopt() credentials, returned len %d/%d: %s\n", + cr_len, + (int) sizeof (cr), + g_strerror (errno)); + } +#elif defined(HAVE_GETPEERUCRED) + ucred_t *ucred; + + ucred = NULL; + if (getpeerucred (socket_fd, &ucred) == 0) { + pid_read = ucred_getpid (ucred); + uid_read = ucred_geteuid (ucred); + ret = TRUE; + } else { + g_warning ("Failed to getpeerucred() credentials: %s\n", + g_strerror (errno)); + } + if (ucred != NULL) { + ucred_free (ucred); + } +#else /* !SO_PEERCRED && !HAVE_GETPEERUCRED */ + g_warning ("Socket credentials not supported on this OS\n"); +#endif + + if (pid != NULL) { + *pid = pid_read; + } + + if (uid != NULL) { + *uid = uid_read; + } + + return ret; +} + + +/* + * getfd.c + * + * Get an fd for use with kbd/console ioctls. + * We try several things because opening /dev/console will fail + * if someone else used X (which does a chown on /dev/console). + */ + +gboolean +ck_fd_is_a_console (int fd) +{ +#ifdef __linux__ + char arg = 0; +#elif defined(__FreeBSD__) + int vers; +#endif + int kb_ok; + +#ifdef __linux__ + kb_ok = (ioctl (fd, KDGKBTYPE, &arg) == 0 + && ((arg == KB_101) || (arg == KB_84))); +#elif defined(__FreeBSD__) + kb_ok = (ioctl (fd, CONS_GETVERS, &vers) == 0); +#else + kb_ok = 1; +#endif + + return (isatty (fd) && kb_ok); +} + +static int +open_a_console (char *fnam) +{ + int fd; + + fd = open (fnam, O_RDONLY | O_NOCTTY); + if (fd < 0 && errno == EACCES) + fd = open (fnam, O_WRONLY | O_NOCTTY); + + if (fd < 0) + return -1; + + if (! ck_fd_is_a_console (fd)) { + close (fd); + fd = -1; + } + + return fd; +} + +int +ck_get_a_console_fd (void) +{ + int fd; + + fd = -1; + +#ifdef __sun + /* On Solaris, first try Sun VT device. */ + fd = open_a_console ("/dev/vt/active"); + if (fd >= 0) { + goto done; + } + fd = open_a_console ("/dev/vt/0"); + if (fd >= 0) { + goto done; + } +#endif + +#ifdef _PATH_TTY + fd = open_a_console (_PATH_TTY); + if (fd >= 0) { + goto done; + } +#endif + + fd = open_a_console ("/dev/tty"); + if (fd >= 0) { + goto done; + } + +#ifdef _PATH_CONSOLE + fd = open_a_console (_PATH_CONSOLE); + if (fd >= 0) { + goto done; + } +#endif + + fd = open_a_console ("/dev/console"); + if (fd >= 0) { + goto done; + } + + for (fd = 0; fd < 3; fd++) { + if (ck_fd_is_a_console (fd)) { + goto done; + } + } + done: + return fd; +} + +gboolean +ck_is_root_user (void) +{ +#ifndef G_OS_WIN32 + uid_t ruid, euid, suid; /* Real, effective and saved user ID's */ + gid_t rgid, egid, sgid; /* Real, effective and saved group ID's */ + +#ifdef HAVE_GETRESUID + if (getresuid (&ruid, &euid, &suid) != 0 || + getresgid (&rgid, &egid, &sgid) != 0) +#endif /* HAVE_GETRESUID */ + { + suid = ruid = getuid (); + sgid = rgid = getgid (); + euid = geteuid (); + egid = getegid (); + } + + if (ruid == 0) { + return TRUE; + } + +#endif + return FALSE; +} + +gboolean +ck_wait_for_active_console_num (int console_fd, + guint num) +{ + gboolean ret; + int res; + + g_assert (console_fd != -1); + + again: + ret = FALSE; + + g_debug ("VT_WAITACTIVE for vt %d", num); + errno = 0; + res = ioctl (console_fd, VT_WAITACTIVE, num); + + g_debug ("VT_WAITACTIVE for vt %d returned %d", num, ret); + + if (res == ERROR) { + const char *errmsg; + + errmsg = g_strerror (errno); + + if (errno == EINTR) { + g_debug ("Interrupted waiting for native console %d activation: %s", + num, + errmsg); + goto again; + } else { + g_warning ("Error waiting for native console %d activation: %s", + num, + errmsg); + } + goto out; + } + + ret = TRUE; + + out: + return ret; +} + +gboolean +ck_activate_console_num (int console_fd, + guint num) +{ + gboolean ret; + int res; + + g_assert (console_fd != -1); + + ret = FALSE; + + errno = 0; + res = ioctl (console_fd, VT_ACTIVATE, num); + if (res == 0) { + ret = TRUE; + } else { + g_warning ("Unable to activate console: %s", g_strerror (errno)); + } + + return ret; +} diff --git a/src/ck-sysdeps.h b/src/ck-sysdeps.h new file mode 100644 index 0000000..f0fceb7 --- /dev/null +++ b/src/ck-sysdeps.h @@ -0,0 +1,75 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2006 William Jon McCann <mccann@jhu.edu> + * + * 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. + * + */ + +#ifndef __CK_SYSDEPS_H +#define __CK_SYSDEPS_H + +#include "config.h" + +#include <glib.h> + +G_BEGIN_DECLS + +typedef struct _CkProcessStat CkProcessStat; + +gboolean ck_process_stat_new_for_unix_pid (pid_t pid, + CkProcessStat **stat, + GError **error); +pid_t ck_process_stat_get_ppid (CkProcessStat *stat); +char *ck_process_stat_get_tty (CkProcessStat *stat); +char *ck_process_stat_get_cmd (CkProcessStat *stat); +void ck_process_stat_free (CkProcessStat *stat); + + +char *ck_unix_pid_get_env (pid_t pid, + const char *var); + +GHashTable *ck_unix_pid_get_env_hash (pid_t pid); + +pid_t ck_unix_pid_get_ppid (pid_t pid); +uid_t ck_unix_pid_get_uid (pid_t pid); + + +gboolean ck_get_socket_peer_credentials (int socket_fd, + pid_t *pid, + uid_t *uid, + GError **error); + +int ck_get_a_console_fd (void); + +gboolean ck_fd_is_a_console (int fd); + +gboolean ck_is_root_user (void); + +gboolean ck_get_max_num_consoles (guint *num); + +char * ck_get_console_device_for_num (guint num); +gboolean ck_get_console_num_from_device (const char *device, + guint *num); +gboolean ck_get_active_console_num (int console_fd, + guint *num); +gboolean ck_activate_console_num (int console_fd, + guint num); +gboolean ck_wait_for_active_console_num (int console_fd, + guint num); + +G_END_DECLS + +#endif /* __CK_SYSDEPS_H */ diff --git a/src/ck-vt-monitor.c b/src/ck-vt-monitor.c index 40f834a..59d3d1c 100644 --- a/src/ck-vt-monitor.c +++ b/src/ck-vt-monitor.c @@ -26,13 +26,6 @@ #include <unistd.h> #include <string.h> #include <errno.h> -#include <sys/ioctl.h> -#include <sys/vt.h> - -#if defined (__linux__) -#include <linux/tty.h> -#include <linux/kd.h> -#endif /* linux */ #include <glib.h> #include <glib/gi18n.h> @@ -44,9 +37,12 @@ #include <dbus/dbus-glib-lowlevel.h> #include "ck-vt-monitor.h" +#include "ck-sysdeps.h" #include "ck-marshal.h" +#ifndef ERROR #define ERROR -1 +#endif #define CK_VT_MONITOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CK_TYPE_VT_MONITOR, CkVtMonitorPrivate)) @@ -121,8 +117,8 @@ ck_vt_monitor_set_active (CkVtMonitor *vt_monitor, return FALSE; } - res = ioctl (vt_monitor->priv->vfd, VT_ACTIVATE, num); - if (res == 0) { + res = ck_activate_console_num (vt_monitor->priv->vfd, num); + if (res) { ret = TRUE; } else { g_set_error (error, @@ -272,35 +268,16 @@ static void * vt_thread_start (ThreadData *data) { CkVtMonitor *vt_monitor; + gboolean res; int ret; gint32 num; vt_monitor = data->vt_monitor; num = data->num; - again: - g_debug ("VT_WAITACTIVE for vt %d", num); - ret = ioctl (vt_monitor->priv->vfd, VT_WAITACTIVE, num); - - g_debug ("VT_WAITACTIVE for vt %d returned %d", num, ret); - - if (ret == ERROR) { - const char *errmsg; - - errmsg = g_strerror (errno); - - if (errno == EINTR) { - g_debug ("Interrupted waiting for native console %d activation: %s", - num, - errmsg); - goto again; - } else { - g_warning ("Error waiting for native console %d activation: %s", - num, - errmsg); - } - - g_free (data); + res = ck_wait_for_active_console_num (vt_monitor->priv->vfd, num); + if (! res) { + /* FIXME: what do we do if it fails? */ } else { EventData *event; @@ -357,6 +334,7 @@ vt_add_watch_unlocked (CkVtMonitor *vt_monitor, static void vt_add_watches (CkVtMonitor *vt_monitor) { + guint max_consoles; int i; gint32 current_num; @@ -364,7 +342,13 @@ vt_add_watches (CkVtMonitor *vt_monitor) current_num = vt_monitor->priv->active_num; - for (i = 1; i < MAX_NR_CONSOLES; i++) { + max_consoles = 1; + + if (! ck_get_max_num_consoles (&max_consoles)) { + /* FIXME: this can fail on solaris and freebsd */ + } + + for (i = 1; i < max_consoles; i++) { gpointer id; /* don't wait on the active vc */ @@ -383,33 +367,6 @@ vt_add_watches (CkVtMonitor *vt_monitor) G_UNLOCK (hash_lock); } -static guint -get_active_native (CkVtMonitor *vt_monitor) -{ - int ret; - struct vt_stat stat; - - ret = ioctl (vt_monitor->priv->vfd, VT_GETSTATE, &stat); - if (ret == ERROR) { - perror ("ioctl VT_GETSTATE"); - return -1; - } - - { - int i; - - g_debug ("Current VT: tty%d", stat.v_active); - for (i = 1; i <= 16; i++) { - gboolean is_on; - is_on = stat.v_state & (1 << i); - - g_debug ("VT %d:%s", i, is_on ? "on" : "off"); - } - } - - return stat.v_active; -} - static void ck_vt_monitor_class_init (CkVtMonitorClass *klass) { @@ -430,8 +387,6 @@ ck_vt_monitor_class_init (CkVtMonitorClass *klass) g_type_class_add_private (klass, sizeof (CkVtMonitorPrivate)); } -extern int getfd (void); - static void ck_vt_monitor_init (CkVtMonitor *vt_monitor) { @@ -439,7 +394,7 @@ ck_vt_monitor_init (CkVtMonitor *vt_monitor) vt_monitor->priv = CK_VT_MONITOR_GET_PRIVATE (vt_monitor); - fd = getfd (); + fd = ck_get_a_console_fd (); vt_monitor->priv->vfd = fd; if (fd == ERROR) { @@ -447,11 +402,20 @@ ck_vt_monitor_init (CkVtMonitor *vt_monitor) errmsg = g_strerror (errno); g_warning ("Unable to open a console: %s", errmsg); } else { + gboolean res; + guint active; + + res = ck_get_active_console_num (fd, &active); + if (! res) { + /* FIXME: handle failure */ + g_warning ("Could not determine active console"); + active = 0; + } + + vt_monitor->priv->active_num = active; vt_monitor->priv->event_queue = g_async_queue_new (); vt_monitor->priv->vt_thread_hash = g_hash_table_new (g_direct_hash, g_direct_equal); - vt_monitor->priv->active_num = get_active_native (vt_monitor); - vt_add_watches (vt_monitor); } } diff --git a/src/getfd.c b/src/getfd.c deleted file mode 100644 index 69c37a3..0000000 --- a/src/getfd.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Adapted from kbd-1.12 - * License: GPL - * - */ - -#include "config.h" - -#include <stdio.h> -#include <fcntl.h> -#include <errno.h> -#include <linux/kd.h> -#include <sys/ioctl.h> - -#ifdef HAVE_PATHS_H -#include <paths.h> -#endif /* HAVE_PATHS_H */ - -/* - * getfd.c - * - * Get an fd for use with kbd/console ioctls. - * We try several things because opening /dev/console will fail - * if someone else used X (which does a chown on /dev/console). - */ - -static int -is_a_console (int fd) -{ - char arg; - - arg = 0; - return (ioctl (fd, KDGKBTYPE, &arg) == 0 - && ((arg == KB_101) || (arg == KB_84))); -} - -static int -open_a_console (char *fnam) -{ - int fd; - - fd = open (fnam, O_RDONLY); - if (fd < 0 && errno == EACCES) - fd = open(fnam, O_WRONLY); - if (fd < 0 || ! is_a_console (fd)) - return -1; - return fd; -} - -int getfd (void) -{ - int fd; - - fd = open_a_console (_PATH_TTY); - if (fd >= 0) - return fd; - - fd = open_a_console ("/dev/tty"); - if (fd >= 0) - return fd; - - fd = open_a_console (_PATH_CONSOLE); - if (fd >= 0) - return fd; - - fd = open_a_console ("/dev/console"); - if (fd >= 0) - return fd; - - for (fd = 0; fd < 3; fd++) - if (is_a_console (fd)) - return fd; - - return -1; -} @@ -38,6 +38,7 @@ #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-lowlevel.h> +#include "ck-sysdeps.h" #include "ck-manager.h" #include "ck-log.h" @@ -49,8 +50,8 @@ static void bus_proxy_destroyed_cb (DBusGProxy *bus_proxy, static gboolean timed_exit_cb (GMainLoop *loop) { - g_main_loop_quit (loop); - return FALSE; + g_main_loop_quit (loop); + return FALSE; } static DBusGProxy * @@ -58,7 +59,7 @@ get_bus_proxy (DBusGConnection *connection) { DBusGProxy *bus_proxy; - bus_proxy = dbus_g_proxy_new_for_name (connection, + bus_proxy = dbus_g_proxy_new_for_name (connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); @@ -80,7 +81,7 @@ acquire_name_on_proxy (DBusGProxy *bus_proxy) } error = NULL; - res = dbus_g_proxy_call (bus_proxy, + res = dbus_g_proxy_call (bus_proxy, "RequestName", &error, G_TYPE_STRING, CK_DBUS_NAME, @@ -96,9 +97,9 @@ acquire_name_on_proxy (DBusGProxy *bus_proxy) g_warning ("Failed to acquire %s", CK_DBUS_NAME); } goto out; - } + } - if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { if (error != NULL) { g_warning ("Failed to acquire %s: %s", CK_DBUS_NAME, error->message); g_error_free (error); @@ -283,6 +284,11 @@ main (int argc, dbus_g_thread_init (); g_type_init (); + if (! ck_is_root_user ()) { + g_warning ("Must be run as root"); + exit (1); + } + context = g_option_context_new (_("Console kit daemon")); g_option_context_add_main_entries (context, entries, NULL); g_option_context_parse (context, &argc, &argv, NULL); diff --git a/src/proc.h b/src/proc.h deleted file mode 100644 index 8c3fc64..0000000 --- a/src/proc.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2006 William Jon McCann <mccann@jhu.edu> - * - * 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. - * - */ - -#ifndef __PROC_H -#define __PROC_H - -#include <glib.h> - -G_BEGIN_DECLS - -typedef struct _proc_stat_t proc_stat_t; - -gboolean proc_stat_new_for_pid (pid_t pid, - proc_stat_t **stat, - GError **error); -pid_t proc_stat_get_ppid (proc_stat_t *stat); -char *proc_stat_get_tty (proc_stat_t *stat); -char *proc_stat_get_cmd (proc_stat_t *stat); -void proc_stat_free (proc_stat_t *stat); - -char *proc_pid_get_env (pid_t pid, - const char *var); - -GHashTable *proc_pid_get_env_hash (pid_t pid); - -pid_t proc_pid_get_ppid (pid_t pid); -uid_t proc_pid_get_uid (pid_t pid); - -G_END_DECLS - -#endif /* __PROC_H */ diff --git a/src/test-tty-idle-monitor.c b/src/test-tty-idle-monitor.c index 7d44b26..f56b37f 100644 --- a/src/test-tty-idle-monitor.c +++ b/src/test-tty-idle-monitor.c @@ -23,16 +23,20 @@ #include <stdlib.h> #include <stdio.h> +#include <unistd.h> #include <sys/types.h> +#include <sys/stat.h> +#include <sys/ioctl.h> +#include <fcntl.h> #include <pwd.h> #include <string.h> #include <errno.h> - #include <locale.h> #include <glib.h> #include "ck-tty-idle-monitor.h" +#include "ck-sysdeps.h" static void idle_changed_cb (CkTtyIdleMonitor *monitor, @@ -42,6 +46,26 @@ idle_changed_cb (CkTtyIdleMonitor *monitor, g_message ("idle hint changed: %s", idle_hint ? "idle" : "not idle"); } +static gboolean +is_console (const char *device) +{ + int fd; + gboolean ret; + + ret = FALSE; + fd = open (device, O_RDONLY | O_NOCTTY); + if (fd < 0) { + goto out; + } + + ret = ck_fd_is_a_console (fd); + + close (fd); + + out: + return ret; +} + int main (int argc, char **argv) { @@ -52,15 +76,18 @@ main (int argc, char **argv) g_type_init (); if (argc < 2) { - device = g_file_read_link ("/proc/self/fd/0", NULL); - if (device == NULL) { - g_warning ("%s not a link", "/proc/self/fd/0"); - exit (1); - } + device = ttyname (0); } else { device = g_strdup (argv[1]); } + if (! is_console (device)) { + g_warning ("Device is not a console"); + exit (1); + } + + g_message ("Testing the TTY idle monitor.\n1. Wait for idleness to be detected.\n2. Hit keys on the keyboard to see if activity is noticed."); + monitor = ck_tty_idle_monitor_new (device); g_signal_connect (monitor, diff --git a/src/test-vt-monitor.c b/src/test-vt-monitor.c new file mode 100644 index 0000000..c445865 --- /dev/null +++ b/src/test-vt-monitor.c @@ -0,0 +1,95 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2007 William Jon McCann <mccann@jhu.edu> + * + * 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 <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/ioctl.h> +#include <fcntl.h> +#include <pwd.h> +#include <string.h> +#include <errno.h> + +#include <locale.h> + +#include <glib.h> + +#include "ck-vt-monitor.h" +#include "ck-sysdeps.h" + +static void +activated_cb (CkVtMonitor *monitor, + guint num, + gpointer data) +{ + g_message ("VT %u activated", num); +} + +int +main (int argc, char **argv) +{ + GMainLoop *loop; + CkVtMonitor *monitor; + GError *error; + guint num; + gboolean res; + + if (! g_thread_supported ()) { + g_thread_init (NULL); + } + g_type_init (); + + if (! ck_is_root_user ()) { + g_warning ("Must be run as root"); + exit (1); + } + + g_message ("Testing the VT monitor.\n Should print messages when VT is switched."); + + monitor = ck_vt_monitor_new (); + + res = ck_vt_monitor_get_active (monitor, &num, &error); + if (! res) { + g_warning ("Couldn't determine active VT: %s", error->message); + exit (1); + } + + g_message ("VT %u is currently active", num); + + g_signal_connect (monitor, + "active-changed", + G_CALLBACK (activated_cb), + NULL); + + loop = g_main_loop_new (NULL, FALSE); + + g_main_loop_run (loop); + + g_object_unref (monitor); + + g_main_loop_unref (loop); + + return 0; +} diff --git a/tools/Makefile.am b/tools/Makefile.am index b7f515a..5283e18 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -17,6 +17,7 @@ DIST_SUBDIRS = \ INCLUDES = \ -I. \ -I$(srcdir) \ + -I$(top_srcdir)/src \ $(CONSOLE_KIT_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) \ -DPREFIX=\""$(prefix)"\" \ @@ -42,6 +43,41 @@ ck_list_sessions_LDADD = \ $(CONSOLE_KIT_LIBS) \ $(NULL) + +libexec_PROGRAMS = \ + ck-collect-session-info \ + ck-get-x11-server-pid \ + ck-get-x11-display-device \ + $(NULL) + +ck_collect_session_info_SOURCES = \ + ck-collect-session-info.c \ + $(NULL) + +ck_collect_session_info_LDADD = \ + $(TOOLS_LIBS) \ + $(top_builddir)/src/libck.la \ + $(NULL) + +ck_get_x11_server_pid_SOURCES = \ + ck-get-x11-server-pid.c \ + $(NULL) + +ck_get_x11_server_pid_LDADD = \ + $(TOOLS_LIBS) \ + $(top_builddir)/src/libck.la \ + $(NULL) + +ck_get_x11_display_device_SOURCES = \ + ck-get-x11-display-device.c \ + $(NULL) + +ck_get_x11_display_device_LDADD = \ + $(TOOLS_LIBS) \ + $(top_builddir)/src/libck.la \ + $(NULL) + + EXTRA_DIST = \ $(NULL) diff --git a/tools/Makefile.in b/tools/Makefile.in index f46aac8..a876d3b 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -38,6 +38,9 @@ build_triplet = @build@ host_triplet = @host@ @CK_COMPILE_LINUX_TRUE@am__append_1 = linux bin_PROGRAMS = ck-list-sessions$(EXEEXT) $(am__EXEEXT_1) +libexec_PROGRAMS = ck-collect-session-info$(EXEEXT) \ + ck-get-x11-server-pid$(EXEEXT) \ + ck-get-x11-display-device$(EXEEXT) $(am__EXEEXT_1) subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -49,13 +52,31 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__EXEEXT_1 = -am__installdirs = "$(DESTDIR)$(bindir)" +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) +libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) am__objects_1 = +am_ck_collect_session_info_OBJECTS = \ + ck-collect-session-info.$(OBJEXT) $(am__objects_1) +ck_collect_session_info_OBJECTS = \ + $(am_ck_collect_session_info_OBJECTS) +am__DEPENDENCIES_1 = +ck_collect_session_info_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(top_builddir)/src/libck.la $(am__DEPENDENCIES_1) +am_ck_get_x11_display_device_OBJECTS = \ + ck-get-x11-display-device.$(OBJEXT) $(am__objects_1) +ck_get_x11_display_device_OBJECTS = \ + $(am_ck_get_x11_display_device_OBJECTS) +ck_get_x11_display_device_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(top_builddir)/src/libck.la $(am__DEPENDENCIES_1) +am_ck_get_x11_server_pid_OBJECTS = ck-get-x11-server-pid.$(OBJEXT) \ + $(am__objects_1) +ck_get_x11_server_pid_OBJECTS = $(am_ck_get_x11_server_pid_OBJECTS) +ck_get_x11_server_pid_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(top_builddir)/src/libck.la $(am__DEPENDENCIES_1) am_ck_list_sessions_OBJECTS = list-sessions.$(OBJEXT) $(am__objects_1) ck_list_sessions_OBJECTS = $(am_ck_list_sessions_OBJECTS) -am__DEPENDENCIES_1 = ck_list_sessions_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) @@ -69,8 +90,12 @@ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(ck_list_sessions_SOURCES) -DIST_SOURCES = $(ck_list_sessions_SOURCES) +SOURCES = $(ck_collect_session_info_SOURCES) \ + $(ck_get_x11_display_device_SOURCES) \ + $(ck_get_x11_server_pid_SOURCES) $(ck_list_sessions_SOURCES) +DIST_SOURCES = $(ck_collect_session_info_SOURCES) \ + $(ck_get_x11_display_device_SOURCES) \ + $(ck_get_x11_server_pid_SOURCES) $(ck_list_sessions_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -145,6 +170,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ +KVM_LIBS = @KVM_LIBS@ LDFLAGS = @LDFLAGS@ LIBDBUS_CFLAGS = @LIBDBUS_CFLAGS@ LIBDBUS_LIBS = @LIBDBUS_LIBS@ @@ -243,6 +269,7 @@ DIST_SUBDIRS = \ INCLUDES = \ -I. \ -I$(srcdir) \ + -I$(top_srcdir)/src \ $(CONSOLE_KIT_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) \ -DPREFIX=\""$(prefix)"\" \ @@ -264,6 +291,33 @@ ck_list_sessions_LDADD = \ $(CONSOLE_KIT_LIBS) \ $(NULL) +ck_collect_session_info_SOURCES = \ + ck-collect-session-info.c \ + $(NULL) + +ck_collect_session_info_LDADD = \ + $(TOOLS_LIBS) \ + $(top_builddir)/src/libck.la \ + $(NULL) + +ck_get_x11_server_pid_SOURCES = \ + ck-get-x11-server-pid.c \ + $(NULL) + +ck_get_x11_server_pid_LDADD = \ + $(TOOLS_LIBS) \ + $(top_builddir)/src/libck.la \ + $(NULL) + +ck_get_x11_display_device_SOURCES = \ + ck-get-x11-display-device.c \ + $(NULL) + +ck_get_x11_display_device_LDADD = \ + $(TOOLS_LIBS) \ + $(top_builddir)/src/libck.la \ + $(NULL) + EXTRA_DIST = \ $(NULL) @@ -332,6 +386,43 @@ clean-binPROGRAMS: echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done +install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" + @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ + done + +clean-libexecPROGRAMS: + @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +ck-collect-session-info$(EXEEXT): $(ck_collect_session_info_OBJECTS) $(ck_collect_session_info_DEPENDENCIES) + @rm -f ck-collect-session-info$(EXEEXT) + $(LINK) $(ck_collect_session_info_LDFLAGS) $(ck_collect_session_info_OBJECTS) $(ck_collect_session_info_LDADD) $(LIBS) +ck-get-x11-display-device$(EXEEXT): $(ck_get_x11_display_device_OBJECTS) $(ck_get_x11_display_device_DEPENDENCIES) + @rm -f ck-get-x11-display-device$(EXEEXT) + $(LINK) $(ck_get_x11_display_device_LDFLAGS) $(ck_get_x11_display_device_OBJECTS) $(ck_get_x11_display_device_LDADD) $(LIBS) +ck-get-x11-server-pid$(EXEEXT): $(ck_get_x11_server_pid_OBJECTS) $(ck_get_x11_server_pid_DEPENDENCIES) + @rm -f ck-get-x11-server-pid$(EXEEXT) + $(LINK) $(ck_get_x11_server_pid_LDFLAGS) $(ck_get_x11_server_pid_OBJECTS) $(ck_get_x11_server_pid_LDADD) $(LIBS) ck-list-sessions$(EXEEXT): $(ck_list_sessions_OBJECTS) $(ck_list_sessions_DEPENDENCIES) @rm -f ck-list-sessions$(EXEEXT) $(LINK) $(ck_list_sessions_LDFLAGS) $(ck_list_sessions_OBJECTS) $(ck_list_sessions_LDADD) $(LIBS) @@ -342,6 +433,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-collect-session-info.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-get-x11-display-device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-get-x11-server-pid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list-sessions.Po@am__quote@ .c.o: @@ -554,7 +648,7 @@ check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive @@ -584,7 +678,8 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \ + clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) @@ -604,7 +699,7 @@ info-am: install-data-am: -install-exec-am: install-binPROGRAMS +install-exec-am: install-binPROGRAMS install-libexecPROGRAMS install-info: install-info-recursive @@ -630,24 +725,27 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-info-am +uninstall-am: uninstall-binPROGRAMS uninstall-info-am \ + uninstall-libexecPROGRAMS uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-binPROGRAMS clean-generic clean-libtool \ - clean-recursive ctags ctags-recursive distclean \ + clean clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \ + clean-libtool clean-recursive ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ - pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-info-am + install-info install-info-am install-libexecPROGRAMS \ + install-man install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am \ + uninstall-libexecPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/tools/linux/ck-collect-session-info.c b/tools/ck-collect-session-info.c index 5e8e07d..45abb07 100644 --- a/tools/linux/ck-collect-session-info.c +++ b/tools/ck-collect-session-info.c @@ -32,7 +32,7 @@ #include <glib.h> -#include "proc.h" +#include "ck-sysdeps.h" typedef struct { uid_t uid; @@ -108,7 +108,7 @@ get_filtered_environment (pid_t pid) g_ptr_array_add (env, g_strdup ("PATH=/bin:/usr/bin")); - hash = proc_pid_get_env_hash (pid); + hash = ck_unix_pid_get_env_hash (pid); for (i = 0; i < G_N_ELEMENTS (allowed_env_vars); i++) { const char *var; @@ -221,14 +221,14 @@ get_x11_server_pid (SessionInfo *si, static void fill_x11_info (SessionInfo *si) { - guint xorg_pid; - gboolean can_connect; - gboolean res; - proc_stat_t *xorg_stat; - GError *error; + guint xorg_pid; + gboolean can_connect; + gboolean res; + CkProcessStat *xorg_stat; + GError *error; /* assume this is true then check it */ - si->x11_display = proc_pid_get_env (si->pid, "DISPLAY"); + si->x11_display = ck_unix_pid_get_env (si->pid, "DISPLAY"); if (si->x11_display == NULL) { /* no point continuing */ @@ -261,7 +261,7 @@ fill_x11_info (SessionInfo *si) } error = NULL; - res = proc_stat_new_for_pid (xorg_pid, &xorg_stat, &error); + res = ck_process_stat_new_for_unix_pid (xorg_pid, &xorg_stat, &error); if (! res) { if (error != NULL) { g_warning ("stat on pid %d failed: %s", xorg_pid, error->message); @@ -271,8 +271,8 @@ fill_x11_info (SessionInfo *si) return; } - si->x11_display_device = proc_stat_get_tty (xorg_stat); - proc_stat_free (xorg_stat); + si->x11_display_device = ck_process_stat_get_tty (xorg_stat); + ck_process_stat_free (xorg_stat); si->is_local = TRUE; si->is_local_is_set = TRUE; @@ -284,12 +284,12 @@ fill_x11_info (SessionInfo *si) static gboolean fill_session_info (SessionInfo *si) { - proc_stat_t *stat; - GError *error; - gboolean res; + CkProcessStat *stat; + GError *error; + gboolean res; error = NULL; - res = proc_stat_new_for_pid (si->pid, &stat, &error); + res = ck_process_stat_new_for_unix_pid (si->pid, &stat, &error); if (! res) { if (error != NULL) { g_warning ("stat on pid %d failed: %s", si->pid, error->message); @@ -299,9 +299,9 @@ fill_session_info (SessionInfo *si) return FALSE; } - si->display_device = proc_stat_get_tty (stat); - si->session_type = proc_stat_get_cmd (stat); - proc_stat_free (stat); + si->display_device = ck_process_stat_get_tty (stat); + si->session_type = ck_process_stat_get_cmd (stat); + ck_process_stat_free (stat); fill_x11_info (si); diff --git a/tools/ck-get-x11-display-device.c b/tools/ck-get-x11-display-device.c new file mode 100644 index 0000000..b349cc7 --- /dev/null +++ b/tools/ck-get-x11-display-device.c @@ -0,0 +1,127 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2007 William Jon McCann <mccann@jhu.edu> + * + * 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. + * + * Authors: William Jon McCann <mccann@jhu.edu> + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> + +#include <X11/Xlib.h> +#include <glib.h> + +#include "ck-sysdeps.h" + +static char * +get_tty_for_pid (int pid) +{ + GError *error; + char *device; + gboolean res; + CkProcessStat *xorg_stat; + + error = NULL; + res = ck_process_stat_new_for_unix_pid (pid, &xorg_stat, &error); + if (! res) { + if (error != NULL) { + g_warning ("stat on pid %d failed: %s", pid, error->message); + g_error_free (error); + } + /* keep the tty value */ + return NULL; + } + + device = ck_process_stat_get_tty (xorg_stat); + ck_process_stat_free (xorg_stat); + return device; +} + +static Display * +display_init (const char *display_name) +{ + Display *xdisplay; + + if (display_name == NULL) { + display_name = g_getenv ("DISPLAY"); + } + + if (display_name == NULL) { + g_warning ("DISPLAY is not set"); + exit (1); + } + + xdisplay = XOpenDisplay (display_name); + if (xdisplay == NULL) { + g_warning ("cannot open display: %s", display_name ? display_name : ""); + exit (1); + } + + return xdisplay; +} + +int +main (int argc, + char **argv) +{ + int fd; + int ret; + Display *xdisplay; + static char *display = NULL; + GError *error; + GOptionContext *context; + static GOptionEntry entries [] = { + { "display", 0, 0, G_OPTION_ARG_STRING, &display, "display name", NULL }, + { NULL } + }; + + ret = 1; + + context = g_option_context_new (NULL); + g_option_context_add_main_entries (context, entries, NULL); + error = NULL; + ret = g_option_context_parse (context, &argc, &argv, &error); + g_option_context_free (context); + + xdisplay = display_init (display); + + fd = ConnectionNumber (xdisplay); + + if (fd > 0) { + int pid; + char *device; + gboolean res; + + ret = 0; + res = ck_get_socket_peer_credentials (fd, &pid, NULL, NULL); + if (res) { + if (pid > 0) { + device = get_tty_for_pid (pid); + if (device != NULL) { + printf ("%s\n", device); + g_free (device); + } + } + } + } + + return ret; +} diff --git a/tools/linux/ck-get-x11-server-pid.c b/tools/ck-get-x11-server-pid.c index cd48cd1..3324164 100644 --- a/tools/linux/ck-get-x11-server-pid.c +++ b/tools/ck-get-x11-server-pid.c @@ -32,28 +32,7 @@ #include <X11/Xlib.h> #include <glib.h> -static void -print_peer_pid (int fd) -{ -#ifdef SO_PEERCRED - struct ucred cr; - socklen_t cr_len; - - cr_len = sizeof (cr); - - if (getsockopt (fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) == 0 && cr_len == sizeof (cr)) { - /* paranoia check for peer running as root */ - if (cr.uid == 0) { - printf ("%u\n", cr.pid); - } - } else { - g_warning ("Failed to getsockopt() credentials, returned len %d/%d: %s\n", - cr_len, - (int) sizeof (cr), - g_strerror (errno)); - } -#endif -} +#include "ck-sysdeps.h" static Display * display_init (int *argc, char ***argv) @@ -92,8 +71,16 @@ main (int argc, fd = ConnectionNumber (xdisplay); if (fd > 0) { + int pid; + gboolean res; + ret = 0; - print_peer_pid (fd); + res = ck_get_socket_peer_credentials (fd, &pid, NULL, NULL); + if (res) { + if (pid > 0) { + printf ("%d\n", pid); + } + } } return ret; diff --git a/tools/linux/Makefile.am b/tools/linux/Makefile.am index 3283b5e..0830734 100644 --- a/tools/linux/Makefile.am +++ b/tools/linux/Makefile.am @@ -23,28 +23,6 @@ INCLUDES = \ $(TOOLS_CFLAGS) \ $(NULL) -libexec_PROGRAMS = \ - ck-collect-session-info \ - ck-get-x11-server-pid \ - $(NULL) - -ck_collect_session_info_SOURCES = \ - $(top_srcdir)/src/proc.h \ - $(top_srcdir)/src/proc-linux.c \ - ck-collect-session-info.c \ - $(NULL) - -ck_collect_session_info_LDADD = \ - $(TOOLS_LIBS) \ - $(NULL) - -ck_get_x11_server_pid_SOURCES = \ - ck-get-x11-server-pid.c \ - $(NULL) - -ck_get_x11_server_pid_LDADD = \ - $(TOOLS_LIBS) \ - $(NULL) EXTRA_DIST = \ $(NULL) diff --git a/tools/linux/Makefile.in b/tools/linux/Makefile.in index dca43be..39209cb 100644 --- a/tools/linux/Makefile.in +++ b/tools/linux/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -36,8 +35,6 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -libexec_PROGRAMS = ck-collect-session-info$(EXEEXT) \ - ck-get-x11-server-pid$(EXEEXT) $(am__EXEEXT_1) subdir = tools/linux DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -48,38 +45,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -am__EXEEXT_1 = -am__installdirs = "$(DESTDIR)$(libexecdir)" -libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(libexec_PROGRAMS) -am__objects_1 = -am_ck_collect_session_info_OBJECTS = proc-linux.$(OBJEXT) \ - ck-collect-session-info.$(OBJEXT) $(am__objects_1) -ck_collect_session_info_OBJECTS = \ - $(am_ck_collect_session_info_OBJECTS) -am__DEPENDENCIES_1 = -ck_collect_session_info_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am_ck_get_x11_server_pid_OBJECTS = ck-get-x11-server-pid.$(OBJEXT) \ - $(am__objects_1) -ck_get_x11_server_pid_OBJECTS = $(am_ck_get_x11_server_pid_OBJECTS) -ck_get_x11_server_pid_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(ck_collect_session_info_SOURCES) \ - $(ck_get_x11_server_pid_SOURCES) -DIST_SOURCES = $(ck_collect_session_info_SOURCES) \ - $(ck_get_x11_server_pid_SOURCES) +SOURCES = +DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -155,6 +122,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ +KVM_LIBS = @KVM_LIBS@ LDFLAGS = @LDFLAGS@ LIBDBUS_CFLAGS = @LIBDBUS_CFLAGS@ LIBDBUS_LIBS = @LIBDBUS_LIBS@ @@ -265,24 +233,6 @@ INCLUDES = \ $(TOOLS_CFLAGS) \ $(NULL) -ck_collect_session_info_SOURCES = \ - $(top_srcdir)/src/proc.h \ - $(top_srcdir)/src/proc-linux.c \ - ck-collect-session-info.c \ - $(NULL) - -ck_collect_session_info_LDADD = \ - $(TOOLS_LIBS) \ - $(NULL) - -ck_get_x11_server_pid_SOURCES = \ - ck-get-x11-server-pid.c \ - $(NULL) - -ck_get_x11_server_pid_LDADD = \ - $(TOOLS_LIBS) \ - $(NULL) - EXTRA_DIST = \ $(NULL) @@ -293,7 +243,6 @@ MAINTAINERCLEANFILES = \ all: all-recursive .SUFFIXES: -.SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -323,85 +272,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libexecPROGRAMS: $(libexec_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-libexecPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ - rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ - done - -clean-libexecPROGRAMS: - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -ck-collect-session-info$(EXEEXT): $(ck_collect_session_info_OBJECTS) $(ck_collect_session_info_DEPENDENCIES) - @rm -f ck-collect-session-info$(EXEEXT) - $(LINK) $(ck_collect_session_info_LDFLAGS) $(ck_collect_session_info_OBJECTS) $(ck_collect_session_info_LDADD) $(LIBS) -ck-get-x11-server-pid$(EXEEXT): $(ck_get_x11_server_pid_OBJECTS) $(ck_get_x11_server_pid_DEPENDENCIES) - @rm -f ck-get-x11-server-pid$(EXEEXT) - $(LINK) $(ck_get_x11_server_pid_LDFLAGS) $(ck_get_x11_server_pid_OBJECTS) $(ck_get_x11_server_pid_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-collect-session-info.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-get-x11-server-pid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc-linux.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -proc-linux.o: $(top_srcdir)/src/proc-linux.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc-linux.o -MD -MP -MF "$(DEPDIR)/proc-linux.Tpo" -c -o proc-linux.o `test -f '$(top_srcdir)/src/proc-linux.c' || echo '$(srcdir)/'`$(top_srcdir)/src/proc-linux.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/proc-linux.Tpo" "$(DEPDIR)/proc-linux.Po"; else rm -f "$(DEPDIR)/proc-linux.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/proc-linux.c' object='proc-linux.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc-linux.o `test -f '$(top_srcdir)/src/proc-linux.c' || echo '$(srcdir)/'`$(top_srcdir)/src/proc-linux.c - -proc-linux.obj: $(top_srcdir)/src/proc-linux.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc-linux.obj -MD -MP -MF "$(DEPDIR)/proc-linux.Tpo" -c -o proc-linux.obj `if test -f '$(top_srcdir)/src/proc-linux.c'; then $(CYGPATH_W) '$(top_srcdir)/src/proc-linux.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/proc-linux.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/proc-linux.Tpo" "$(DEPDIR)/proc-linux.Po"; else rm -f "$(DEPDIR)/proc-linux.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/proc-linux.c' object='proc-linux.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc-linux.obj `if test -f '$(top_srcdir)/src/proc-linux.c'; then $(CYGPATH_W) '$(top_srcdir)/src/proc-linux.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/proc-linux.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -589,12 +459,9 @@ distdir: $(DISTFILES) done check-am: all-am check: check-recursive -all-am: Makefile $(PROGRAMS) +all-am: Makefile installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(libexecdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -622,14 +489,12 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive -clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ - mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive - -rm -rf ./$(DEPDIR) -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags dvi: dvi-recursive @@ -643,7 +508,7 @@ info-am: install-data-am: -install-exec-am: install-libexecPROGRAMS +install-exec-am: install-info: install-info-recursive @@ -652,14 +517,12 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool +mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive @@ -669,24 +532,22 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS +uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libexecPROGRAMS clean-libtool \ - clean-recursive ctags ctags-recursive distclean \ - distclean-compile distclean-generic distclean-libtool \ + clean clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ - install-info-am install-libexecPROGRAMS install-man \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ - pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-info-am uninstall-libexecPROGRAMS + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. |