Bugzilla – Attachment 802 Details for
Bug 980
sshd does not write the session leader pid to utmp when priv-separation is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
pass session pid to monitor for login recording
openssh-session-pid.patch (text/plain), 4.06 KB, created by
Darren Tucker
on 2005-02-04 00:22:06 AEDT
(
hide
)
Description:
pass session pid to monitor for login recording
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2005-02-04 00:22:06 AEDT
Size:
4.06 KB
patch
obsolete
>Index: monitor.c >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/monitor.c,v >retrieving revision 1.78 >diff -u -p -r1.78 monitor.c >--- monitor.c 2 Feb 2005 13:20:53 -0000 1.78 >+++ monitor.c 3 Feb 2005 13:19:25 -0000 >@@ -1236,20 +1236,22 @@ mm_session_close(Session *s) > int > mm_answer_pty(int sock, Buffer *m) > { >- extern struct monitor *pmonitor; > Session *s; > int res, fd0; >+ pid_t pid; > > debug3("%s entering", __func__); > >+ pid = (pid_t)buffer_get_int(m); > buffer_clear(m); > s = session_new(); > if (s == NULL) > goto error; > s->authctxt = authctxt; > s->pw = authctxt->pw; >- s->pid = pmonitor->m_pid; >- res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)); >+ s->pid = pid; >+ res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty), >+ s->pid); > if (res == 0) > goto error; > pty_setowner(authctxt->pw, s->tty); >Index: monitor_wrap.c >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/monitor_wrap.c,v >retrieving revision 1.50 >diff -u -p -r1.50 monitor_wrap.c >--- monitor_wrap.c 2 Feb 2005 13:20:53 -0000 1.50 >+++ monitor_wrap.c 3 Feb 2005 13:08:37 -0000 >@@ -641,13 +641,14 @@ mm_send_keystate(struct monitor *monitor > } > > int >-mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) >+mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen, pid_t pid) > { > Buffer m; > char *p, *msg; > int success = 0; > > buffer_init(&m); >+ buffer_put_int(&m, (int)pid); > mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTY, &m); > > debug3("%s: waiting for MONITOR_ANS_PTY", __func__); >Index: monitor_wrap.h >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/monitor_wrap.h,v >retrieving revision 1.20 >diff -u -p -r1.20 monitor_wrap.h >--- monitor_wrap.h 2 Feb 2005 13:20:53 -0000 1.20 >+++ monitor_wrap.h 3 Feb 2005 13:12:37 -0000 >@@ -82,7 +82,7 @@ void mm_audit_run_command(const char *); > > struct Session; > void mm_terminate(void); >-int mm_pty_allocate(int *, int *, char *, int); >+int mm_pty_allocate(int *, int *, char *, int, pid_t); > void mm_session_pty_cleanup2(struct Session *); > > /* SSHv1 interfaces */ >Index: session.c >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/session.c,v >retrieving revision 1.293 >diff -u -p -r1.293 session.c >--- session.c 2 Feb 2005 13:20:53 -0000 1.293 >+++ session.c 3 Feb 2005 13:17:00 -0000 >@@ -1754,7 +1754,8 @@ session_pty_req(Session *s) > > /* Allocate a pty and open it. */ > debug("Allocating pty."); >- if (!PRIVSEP(pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)))) { >+ if (!PRIVSEP(pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty), >+ s->pid))) { > if (s->term) > xfree(s->term); > s->term = NULL; >Index: sshpty.c >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/sshpty.c,v >retrieving revision 1.25 >diff -u -p -r1.25 sshpty.c >--- sshpty.c 22 Jun 2004 02:56:02 -0000 1.25 >+++ sshpty.c 3 Feb 2005 13:09:16 -0000 >@@ -38,7 +38,7 @@ RCSID("$OpenBSD: sshpty.c,v 1.12 2004/06 > */ > > int >-pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) >+pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen, pid_t pid) > { > /* openpty(3) exists in OSF/1 and some other os'es */ > char *name; >Index: sshpty.h >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/sshpty.h,v >retrieving revision 1.7 >diff -u -p -r1.7 sshpty.h >--- sshpty.h 13 May 2004 06:06:47 -0000 1.7 >+++ sshpty.h 3 Feb 2005 13:08:46 -0000 >@@ -21,7 +21,7 @@ struct termios get_saved_tio(void); > void leave_raw_mode(void); > void enter_raw_mode(void); > >-int pty_allocate(int *, int *, char *, int); >+int pty_allocate(int *, int *, char *, int, pid_t); > void pty_release(const char *); > void pty_make_controlling_tty(int *, const char *); > void pty_change_window_size(int, int, int, int, int);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 980
:
802
|
821
|
916