summaryrefslogtreecommitdiff
path: root/debian/patches/consolekit.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/consolekit.patch')
-rw-r--r--debian/patches/consolekit.patch221
1 files changed, 28 insertions, 193 deletions
diff --git a/debian/patches/consolekit.patch b/debian/patches/consolekit.patch
index e50c77f62..0438b8f74 100644
--- a/debian/patches/consolekit.patch
+++ b/debian/patches/consolekit.patch
@@ -1,15 +1,14 @@
1From f51fe0c55e54c12db952624e980d18f39c41e581 Mon Sep 17 00:00:00 2001 1From 8b3111d597316954caaf8ddf2e7746491976c248 Mon Sep 17 00:00:00 2001
2From: Colin Watson <cjwatson@ubuntu.com> 2From: Colin Watson <cjwatson@ubuntu.com>
3Date: Sun, 9 Feb 2014 16:09:57 +0000 3Date: Sun, 9 Feb 2014 16:09:57 +0000
4Subject: Add support for registering ConsoleKit sessions on login 4Subject: Add support for registering ConsoleKit sessions on login
5 5
6Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1450 6Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1450
7Last-Updated: 2014-10-07 7Last-Updated: 2015-08-19
8 8
9Patch-Name: consolekit.patch 9Patch-Name: consolekit.patch
10--- 10---
11 Makefile.in | 3 +- 11 Makefile.in | 3 +-
12 configure | 132 +++++++++++++++++++++++++++++++
13 configure.ac | 25 ++++++ 12 configure.ac | 25 ++++++
14 consolekit.c | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 13 consolekit.c | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15 consolekit.h | 24 ++++++ 14 consolekit.h | 24 ++++++
@@ -19,15 +18,15 @@ Patch-Name: consolekit.patch
19 monitor_wrap.h | 4 + 18 monitor_wrap.h | 4 +
20 session.c | 13 ++++ 19 session.c | 13 ++++
21 session.h | 6 ++ 20 session.h | 6 ++
22 11 files changed, 521 insertions(+), 1 deletion(-) 21 10 files changed, 389 insertions(+), 1 deletion(-)
23 create mode 100644 consolekit.c 22 create mode 100644 consolekit.c
24 create mode 100644 consolekit.h 23 create mode 100644 consolekit.h
25 24
26diff --git a/Makefile.in b/Makefile.in 25diff --git a/Makefile.in b/Makefile.in
27index 086d8dd..c4cb8ea 100644 26index 3d2a328..c406aec 100644
28--- a/Makefile.in 27--- a/Makefile.in
29+++ b/Makefile.in 28+++ b/Makefile.in
30@@ -107,7 +107,8 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ 29@@ -111,7 +111,8 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \
31 sftp-server.o sftp-common.o \ 30 sftp-server.o sftp-common.o \
32 roaming_common.o roaming_serv.o \ 31 roaming_common.o roaming_serv.o \
33 sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ 32 sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \
@@ -37,175 +36,11 @@ index 086d8dd..c4cb8ea 100644
37 36
38 MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out sshd_config.5.out ssh_config.5.out 37 MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out sshd_config.5.out ssh_config.5.out
39 MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 sshd_config.5 ssh_config.5 38 MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 sshd_config.5 ssh_config.5
40diff --git a/configure b/configure
41index ea5f200..7be478a 100755
42--- a/configure
43+++ b/configure
44@@ -739,6 +739,7 @@ with_privsep_user
45 with_sandbox
46 with_selinux
47 with_kerberos5
48+with_consolekit
49 with_privsep_path
50 with_xauth
51 enable_strip
52@@ -1430,6 +1431,7 @@ Optional Packages:
53 --with-sandbox=style Specify privilege separation sandbox (no, darwin, rlimit, systrace, seccomp_filter, capsicum)
54 --with-selinux Enable SELinux support
55 --with-kerberos5=PATH Enable Kerberos 5 support
56+ --with-consolekit Enable ConsoleKit support
57 --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)
58 --with-xauth=PATH Specify path to xauth program
59 --with-maildir=/path/to/mail Specify your system mail directory
60@@ -17211,6 +17213,135 @@ fi
61
62
63
64+# Check whether user wants ConsoleKit support
65+CONSOLEKIT_MSG="no"
66+LIBCK_CONNECTOR=""
67+
68+# Check whether --with-consolekit was given.
69+if test "${with_consolekit+set}" = set; then :
70+ withval=$with_consolekit; if test "x$withval" != "xno" ; then
71+ if test -n "$ac_tool_prefix"; then
72+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
73+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
74+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
75+$as_echo_n "checking for $ac_word... " >&6; }
76+if ${ac_cv_path_PKGCONFIG+:} false; then :
77+ $as_echo_n "(cached) " >&6
78+else
79+ case $PKGCONFIG in
80+ [\\/]* | ?:[\\/]*)
81+ ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path.
82+ ;;
83+ *)
84+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
85+for as_dir in $PATH
86+do
87+ IFS=$as_save_IFS
88+ test -z "$as_dir" && as_dir=.
89+ for ac_exec_ext in '' $ac_executable_extensions; do
90+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
91+ ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext"
92+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
93+ break 2
94+ fi
95+done
96+ done
97+IFS=$as_save_IFS
98+
99+ ;;
100+esac
101+fi
102+PKGCONFIG=$ac_cv_path_PKGCONFIG
103+if test -n "$PKGCONFIG"; then
104+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5
105+$as_echo "$PKGCONFIG" >&6; }
106+else
107+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
108+$as_echo "no" >&6; }
109+fi
110+
111+
112+fi
113+if test -z "$ac_cv_path_PKGCONFIG"; then
114+ ac_pt_PKGCONFIG=$PKGCONFIG
115+ # Extract the first word of "pkg-config", so it can be a program name with args.
116+set dummy pkg-config; ac_word=$2
117+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
118+$as_echo_n "checking for $ac_word... " >&6; }
119+if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then :
120+ $as_echo_n "(cached) " >&6
121+else
122+ case $ac_pt_PKGCONFIG in
123+ [\\/]* | ?:[\\/]*)
124+ ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path.
125+ ;;
126+ *)
127+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
128+for as_dir in $PATH
129+do
130+ IFS=$as_save_IFS
131+ test -z "$as_dir" && as_dir=.
132+ for ac_exec_ext in '' $ac_executable_extensions; do
133+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
134+ ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext"
135+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
136+ break 2
137+ fi
138+done
139+ done
140+IFS=$as_save_IFS
141+
142+ ;;
143+esac
144+fi
145+ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG
146+if test -n "$ac_pt_PKGCONFIG"; then
147+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5
148+$as_echo "$ac_pt_PKGCONFIG" >&6; }
149+else
150+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
151+$as_echo "no" >&6; }
152+fi
153+
154+ if test "x$ac_pt_PKGCONFIG" = x; then
155+ PKGCONFIG="no"
156+ else
157+ case $cross_compiling:$ac_tool_warned in
158+yes:)
159+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
160+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
161+ac_tool_warned=yes ;;
162+esac
163+ PKGCONFIG=$ac_pt_PKGCONFIG
164+ fi
165+else
166+ PKGCONFIG="$ac_cv_path_PKGCONFIG"
167+fi
168+
169+ if test "$PKGCONFIG" != "no"; then
170+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ck-connector" >&5
171+$as_echo_n "checking for ck-connector... " >&6; }
172+ if $PKGCONFIG --exists ck-connector; then
173+ CKCON_CFLAGS=`$PKGCONFIG --cflags ck-connector`
174+ CKCON_LIBS=`$PKGCONFIG --libs ck-connector`
175+ CPPFLAGS="$CPPFLAGS $CKCON_CFLAGS"
176+ SSHDLIBS="$SSHDLIBS $CKCON_LIBS"
177+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
178+$as_echo "yes" >&6; }
179+
180+$as_echo "#define USE_CONSOLEKIT 1" >>confdefs.h
181+
182+ CONSOLEKIT_MSG="yes"
183+ else
184+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
185+$as_echo "no" >&6; }
186+ fi
187+ fi
188+ fi
189+
190+fi
191+
192+
193 # Looking for programs, paths and files
194
195 PRIVSEP_PATH=/var/empty
196@@ -19739,6 +19870,7 @@ echo " MD5 password support: $MD5_MSG"
197 echo " libedit support: $LIBEDIT_MSG"
198 echo " Solaris process contract support: $SPC_MSG"
199 echo " Solaris project support: $SP_MSG"
200+echo " ConsoleKit support: $CONSOLEKIT_MSG"
201 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
202 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
203 echo " BSD Auth support: $BSD_AUTH_MSG"
204diff --git a/configure.ac b/configure.ac 39diff --git a/configure.ac b/configure.ac
205index 7f160f1..f5c65c5 100644 40index 5f606ea..f7ce777 100644
206--- a/configure.ac 41--- a/configure.ac
207+++ b/configure.ac 42+++ b/configure.ac
208@@ -4113,6 +4113,30 @@ AC_ARG_WITH([kerberos5], 43@@ -4180,6 +4180,30 @@ AC_ARG_WITH([kerberos5],
209 AC_SUBST([GSSLIBS]) 44 AC_SUBST([GSSLIBS])
210 AC_SUBST([K5LIBS]) 45 AC_SUBST([K5LIBS])
211 46
@@ -236,7 +71,7 @@ index 7f160f1..f5c65c5 100644
236 # Looking for programs, paths and files 71 # Looking for programs, paths and files
237 72
238 PRIVSEP_PATH=/var/empty 73 PRIVSEP_PATH=/var/empty
239@@ -4914,6 +4938,7 @@ echo " MD5 password support: $MD5_MSG" 74@@ -4981,6 +5005,7 @@ echo " MD5 password support: $MD5_MSG"
240 echo " libedit support: $LIBEDIT_MSG" 75 echo " libedit support: $LIBEDIT_MSG"
241 echo " Solaris process contract support: $SPC_MSG" 76 echo " Solaris process contract support: $SPC_MSG"
242 echo " Solaris project support: $SP_MSG" 77 echo " Solaris project support: $SP_MSG"
@@ -522,20 +357,20 @@ index 0000000..8ce3716
522+ 357+
523+#endif /* USE_CONSOLEKIT */ 358+#endif /* USE_CONSOLEKIT */
524diff --git a/monitor.c b/monitor.c 359diff --git a/monitor.c b/monitor.c
525index 94b194d..cc15ce4 100644 360index 6ff05e4..ce7ba07 100644
526--- a/monitor.c 361--- a/monitor.c
527+++ b/monitor.c 362+++ b/monitor.c
528@@ -100,6 +100,9 @@ 363@@ -104,6 +104,9 @@
529 #include "ssh2.h"
530 #include "roaming.h"
531 #include "authfd.h" 364 #include "authfd.h"
365 #include "match.h"
366 #include "ssherr.h"
532+#ifdef USE_CONSOLEKIT 367+#ifdef USE_CONSOLEKIT
533+#include "consolekit.h" 368+#include "consolekit.h"
534+#endif 369+#endif
535 370
536 #ifdef GSSAPI 371 #ifdef GSSAPI
537 static Gssctxt *gsscontext = NULL; 372 static Gssctxt *gsscontext = NULL;
538@@ -190,6 +193,10 @@ int mm_answer_audit_command(int, Buffer *); 373@@ -169,6 +172,10 @@ int mm_answer_audit_command(int, Buffer *);
539 374
540 static int monitor_read_log(struct monitor *); 375 static int monitor_read_log(struct monitor *);
541 376
@@ -546,7 +381,7 @@ index 94b194d..cc15ce4 100644
546 static Authctxt *authctxt; 381 static Authctxt *authctxt;
547 382
548 #ifdef WITH_SSH1 383 #ifdef WITH_SSH1
549@@ -282,6 +289,9 @@ struct mon_table mon_dispatch_postauth20[] = { 384@@ -261,6 +268,9 @@ struct mon_table mon_dispatch_postauth20[] = {
550 {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, 385 {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event},
551 {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command}, 386 {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command},
552 #endif 387 #endif
@@ -556,7 +391,7 @@ index 94b194d..cc15ce4 100644
556 {0, 0, NULL} 391 {0, 0, NULL}
557 }; 392 };
558 393
559@@ -327,6 +337,9 @@ struct mon_table mon_dispatch_postauth15[] = { 394@@ -306,6 +316,9 @@ struct mon_table mon_dispatch_postauth15[] = {
560 {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, 395 {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event},
561 {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT|MON_ONCE, mm_answer_audit_command}, 396 {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT|MON_ONCE, mm_answer_audit_command},
562 #endif 397 #endif
@@ -566,7 +401,7 @@ index 94b194d..cc15ce4 100644
566 #endif /* WITH_SSH1 */ 401 #endif /* WITH_SSH1 */
567 {0, 0, NULL} 402 {0, 0, NULL}
568 }; 403 };
569@@ -509,6 +522,9 @@ monitor_child_postauth(struct monitor *pmonitor) 404@@ -488,6 +501,9 @@ monitor_child_postauth(struct monitor *pmonitor)
570 monitor_permit(mon_dispatch, MONITOR_REQ_PTY, 1); 405 monitor_permit(mon_dispatch, MONITOR_REQ_PTY, 1);
571 monitor_permit(mon_dispatch, MONITOR_REQ_PTYCLEANUP, 1); 406 monitor_permit(mon_dispatch, MONITOR_REQ_PTYCLEANUP, 1);
572 } 407 }
@@ -576,7 +411,7 @@ index 94b194d..cc15ce4 100644
576 411
577 for (;;) 412 for (;;)
578 monitor_read(pmonitor, mon_dispatch, NULL); 413 monitor_read(pmonitor, mon_dispatch, NULL);
579@@ -2296,3 +2312,29 @@ mm_answer_gss_updatecreds(int socket, Buffer *m) { 414@@ -2187,3 +2203,29 @@ mm_answer_gss_updatecreds(int socket, Buffer *m) {
580 415
581 #endif /* GSSAPI */ 416 #endif /* GSSAPI */
582 417
@@ -607,7 +442,7 @@ index 94b194d..cc15ce4 100644
607+} 442+}
608+#endif /* USE_CONSOLEKIT */ 443+#endif /* USE_CONSOLEKIT */
609diff --git a/monitor.h b/monitor.h 444diff --git a/monitor.h b/monitor.h
610index 4d5e8fa..10ba59e 100644 445index 2d82b8b..fd8d92c 100644
611--- a/monitor.h 446--- a/monitor.h
612+++ b/monitor.h 447+++ b/monitor.h
613@@ -70,6 +70,8 @@ enum monitor_reqtype { 448@@ -70,6 +70,8 @@ enum monitor_reqtype {
@@ -620,10 +455,10 @@ index 4d5e8fa..10ba59e 100644
620 455
621 struct mm_master; 456 struct mm_master;
622diff --git a/monitor_wrap.c b/monitor_wrap.c 457diff --git a/monitor_wrap.c b/monitor_wrap.c
623index 6dc890a..4c57d4d 100644 458index 5aa9c47..a5f4e9d 100644
624--- a/monitor_wrap.c 459--- a/monitor_wrap.c
625+++ b/monitor_wrap.c 460+++ b/monitor_wrap.c
626@@ -1363,3 +1363,33 @@ mm_ssh_gssapi_update_creds(ssh_gssapi_ccache *store) 461@@ -1150,3 +1150,33 @@ mm_ssh_gssapi_update_creds(ssh_gssapi_ccache *store)
627 462
628 #endif /* GSSAPI */ 463 #endif /* GSSAPI */
629 464
@@ -658,11 +493,11 @@ index 6dc890a..4c57d4d 100644
658+} 493+}
659+#endif /* USE_CONSOLEKIT */ 494+#endif /* USE_CONSOLEKIT */
660diff --git a/monitor_wrap.h b/monitor_wrap.h 495diff --git a/monitor_wrap.h b/monitor_wrap.h
661index 9c2ee49..00e93fe 100644 496index 4d1e899..f99c31c 100644
662--- a/monitor_wrap.h 497--- a/monitor_wrap.h
663+++ b/monitor_wrap.h 498+++ b/monitor_wrap.h
664@@ -111,4 +111,8 @@ void *mm_zalloc(struct mm_master *, u_int, u_int); 499@@ -108,4 +108,8 @@ int mm_skey_respond(void *, u_int, char **);
665 void mm_zfree(struct mm_master *, void *); 500 /* zlib allocation hooks */
666 void mm_init_compression(struct mm_master *); 501 void mm_init_compression(struct mm_master *);
667 502
668+#ifdef USE_CONSOLEKIT 503+#ifdef USE_CONSOLEKIT
@@ -671,10 +506,10 @@ index 9c2ee49..00e93fe 100644
671+ 506+
672 #endif /* _MM_WRAP_H_ */ 507 #endif /* _MM_WRAP_H_ */
673diff --git a/session.c b/session.c 508diff --git a/session.c b/session.c
674index 6f389ac..6250c20 100644 509index d4b7725..785833f 100644
675--- a/session.c 510--- a/session.c
676+++ b/session.c 511+++ b/session.c
677@@ -93,6 +93,7 @@ 512@@ -94,6 +94,7 @@
678 #include "kex.h" 513 #include "kex.h"
679 #include "monitor_wrap.h" 514 #include "monitor_wrap.h"
680 #include "sftp.h" 515 #include "sftp.h"
@@ -682,7 +517,7 @@ index 6f389ac..6250c20 100644
682 517
683 #if defined(KRB5) && defined(USE_AFS) 518 #if defined(KRB5) && defined(USE_AFS)
684 #include <kafs.h> 519 #include <kafs.h>
685@@ -1143,6 +1144,9 @@ do_setup_env(Session *s, const char *shell) 520@@ -1144,6 +1145,9 @@ do_setup_env(Session *s, const char *shell)
686 #if !defined (HAVE_LOGIN_CAP) && !defined (HAVE_CYGWIN) 521 #if !defined (HAVE_LOGIN_CAP) && !defined (HAVE_CYGWIN)
687 char *path = NULL; 522 char *path = NULL;
688 #endif 523 #endif
@@ -692,7 +527,7 @@ index 6f389ac..6250c20 100644
692 527
693 /* Initialize the environment. */ 528 /* Initialize the environment. */
694 envsize = 100; 529 envsize = 100;
695@@ -1287,6 +1291,11 @@ do_setup_env(Session *s, const char *shell) 530@@ -1288,6 +1292,11 @@ do_setup_env(Session *s, const char *shell)
696 child_set_env(&env, &envsize, "KRB5CCNAME", 531 child_set_env(&env, &envsize, "KRB5CCNAME",
697 s->authctxt->krb5_ccname); 532 s->authctxt->krb5_ccname);
698 #endif 533 #endif
@@ -704,7 +539,7 @@ index 6f389ac..6250c20 100644
704 #ifdef USE_PAM 539 #ifdef USE_PAM
705 /* 540 /*
706 * Pull in any environment variables that may have 541 * Pull in any environment variables that may have
707@@ -2350,6 +2359,10 @@ session_pty_cleanup2(Session *s) 542@@ -2351,6 +2360,10 @@ session_pty_cleanup2(Session *s)
708 543
709 debug("session_pty_cleanup: session %d release %s", s->self, s->tty); 544 debug("session_pty_cleanup: session %d release %s", s->self, s->tty);
710 545