search for: ttyfd

Displaying 20 results from an estimated 75 matches for "ttyfd".

2002 Dec 21
6
[PATCH] PAM chauthtok + Privsep
...patch, MONITOR_REQ_PTY, 1); monitor_permit(mon_dispatch, MONITOR_REQ_PTYCLEANUP, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_PAM_CHAUTHTOK, 1); } for (;;) @@ -746,6 +754,56 @@ xfree(user); return (0); +} + +int +mm_answer_pam_chauthtok(int socket, Buffer *m) +{ + pid_t pid; + int ttyfd, status; + mysig_t old_signal; + + old_signal = mysignal(SIGCHLD, SIG_DFL); + + ttyfd = mm_receive_fd(socket); + debug3("%s: ttyfd=%d, ttyname=%s", __func__, ttyfd, ttyname(ttyfd)); + + if ((pid = fork()) == 0) { + /* acquire controlling tty */ + pty_make_controlling_tty(ttyfd, ttyname(...
2002 Dec 10
5
[PATCH] Password expiry with Privsep and PAM
...patch, MONITOR_REQ_PTY, 1); monitor_permit(mon_dispatch, MONITOR_REQ_PTYCLEANUP, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_PAM_CHAUTHTOK, 1); } for (;;) @@ -746,6 +754,49 @@ xfree(user); return (0); +} + +int +mm_answer_pam_chauthtok(int socket, Buffer *m) +{ + pid_t pid; + int ttyfd, status; + mysig_t old_signal; + + old_signal = mysignal(SIGCHLD, SIG_DFL); + + ttyfd = mm_receive_fd(socket); + debug("%s: ttyfd=%d, ttyname=%s", __func__, ttyfd, ttyname(ttyfd)); + + if ((pid = fork()) == 0) { + close(socket); + if (dup2(ttyfd, 0) < 0) + error("dup2 stdin: %...
2004 Aug 25
2
[patch] sshd with re-exec disabled causes stdin to get closed.
...aemon is forked to handle a client, the child closes stdin by accident. This causes FD 0 to get re-used by the next open call which eventually you end up with a mess. In the perticual case I saw, the pty fd ended up on FD 0 was closed by do_exec_pty(), pty_make_controlling_tty() then opened a new ttyfd as 0, and do_exec_pty() duped it dup2(0,0), dup2(0,1), dup2(0,2), then called close(ttyfd); which closed 0! Patch against openssh-3.9p1 is attached. -- Dave
2002 Jun 28
3
AIX usrinfo() cleanup.
...e will be no way of setting the TTY= correctly while using privsep (Mainly for multiple streams over single session). The only thing we really could do is do: In do_setusercontext() if (use_privsep) aix_usrinfo(pw, NULL); and back in the old spot put: if (!use_privsep) aix_usrinfo(pw, s->ttyfd == -1 ? NULL : s->tty); that should allow users who need TTY set to at least have a working OpenSSH. Maybe add in a line to INSTALL or README about this issue. I'm more in favor of totally dumping TTY= setting until someone screams. - Ben Index: session.c ==============================...
2002 Feb 12
1
openssh + pam errors (fwd)
...sword change required but no " @@ -494,6 +493,9 @@ #endif /* USE_PIPES */ /* Do processing for the child (exec command etc). */ +#if defined(USE_PAM) + do_pam_session(s->pw->pw_name, NULL); +#endif /* USE_PAM */ do_child(s, command); /* NOTREACHED */ } @@ -555,7 +557,6 @@ ttyfd = s->ttyfd; #if defined(USE_PAM) - do_pam_session(s->pw->pw_name, s->tty); do_pam_setcred(1); #endif @@ -580,6 +581,9 @@ /* Close the extra descriptor for the pseudo tty. */ close(ttyfd); +#if defined(USE_PAM) + do_pam_session(s->pw->pw_name, s->tty); +#endif /* U...
2001 Jun 18
2
Patch for changing expired passwords
...*********** *** 270,286 **** command = NULL; packet_integrity_check(plen, 0, type); } ! if (forced_command != NULL) { ! original_command = command; ! command = forced_command; ! debug("Forced command '%.500s'", forced_command); ! } ! if (s->ttyfd != -1) ! do_exec_pty(s, command); ! else ! do_exec_no_pty(s, command); ! if (command != NULL) ! xfree(command); session_close(s); return; --- 271,277 ---- command = NULL; packet_integrity_check(plen, 0, type); } ! do_exec(s, command); session_...
2001 Nov 27
2
3.0.1p1 losing tty modes?
...c Tue Nov 27 02:33:45 2001 @@ -252,6 +252,7 @@ int fd; #ifdef USE_VHANGUP void *old; + struct termios tio; #endif /* USE_VHANGUP */ #ifdef _CRAY @@ -310,6 +311,7 @@ #endif /* HAVE_NEWS4 */ #ifdef USE_VHANGUP old = mysignal(SIGHUP, SIG_IGN); + tcgetattr(*ttyfd,&tio); vhangup(); mysignal(SIGHUP, old); #endif /* USE_VHANGUP */ @@ -320,6 +322,7 @@ #ifdef USE_VHANGUP close(*ttyfd); *ttyfd = fd; + tcsetattr(*ttyfd,TCSANOW,&tio); #else /* USE_VHANGUP */ close(fd); #endif...
2004 Apr 12
1
Regarding SSH_ASKPASS
...only other way to get ssh_askpass() to get called is for open(_PATH_TTY, O_RDWR) to fail. But /dev/tty is a+rw in the normal case. >From readpass.c: char * read_passphrase(const char *prompt, int flags) { char *askpass = NULL, *ret, buf[1024]; int rppflags, use_askpass = 0, ttyfd; rppflags = (flags & RP_ECHO) ? RPP_ECHO_ON : RPP_ECHO_OFF; if (flags & RP_ALLOW_STDIN) { if (!isatty(STDIN_FILENO)) use_askpass = 1; } else { rppflags |= RPP_REQUIRE_TTY; ttyfd = open(_PATH_TTY...
2001 Oct 12
2
bug report: last login time vs PAM in portability release
...lastlog file and reports the time :of the session just started. To fix this, I moved the pam_open_session :call into do_login: : :--- session.c Fri Oct 12 13:05:58 2001 :+++ .snapshot/nightly.3/session.c Mon Oct 8 15:52:02 2001 :@@ -541,6 +541,11 @@ : ptyfd = s->ptyfd; : ttyfd = s->ttyfd; : :+#if defined(USE_PAM) :+ do_pam_session(s->pw->pw_name, s->tty); :+ do_pam_setcred(1); :+#endif :+ : /* Fork the child. */ : if ((pid = fork()) == 0) { : :@@ -698,11 +703,6 @@ : last_login_time = get_last_login_time(pw->pw_uid,...
2015 Aug 31
3
COLUMNS and LINES environment variables
Hello openssh developers, Instead of just playing nethack, I've been building a client that would log in to nethack at alt.org and using a pipe to get the login data from pwsafe directly onto the server. All of this works brilliantly after playing with some stty magic (full script in [0]), however, this way the terminal size is burned into 80x24, which is way smaller than my graphical
2001 Feb 17
2
Where is OpenSSH 2.5.0p1?
...trieving revision 1.31 diff -u -r1.31 pty.c --- pty.c 2001/02/09 02:11:24 1.31 +++ pty.c 2001/02/17 16:06:49 @@ -49,15 +49,19 @@ { #if defined(HAVE_OPENPTY) || defined(BSD4_4) /* openpty(3) exists in OSF/1 and some other os'es */ - char buf[64]; + char *name; int i; - i = openpty(ptyfd, ttyfd, buf, NULL, NULL); + i = openpty(ptyfd, ttyfd, NULL, NULL, NULL); if (i < 0) { error("openpty: %.100s", strerror(errno)); return 0; } - strlcpy(namebuf, buf, namebuflen); /* possible truncation */ + name = ttyname(*ttyfd); + if (!name) + fatal("openpty returns device fo...
2001 Mar 21
1
Tru64 UNIX SIA in 2.5.2p1 is hosed (still)
...it before the call to do_child() in do_exec_no_pty(). On further thought, perhaps the call to sia_ses_init should be left alone and the call to session_setup_sia() in session.c changed from: session_setup_sia(pw->pw_name, s->tty); to: session_setup_sia(pw->pw_name, s->ttyfd != -1 ? s->tty : NULL); Can someone who knows the code better than I do shed some light on the correct solution here. - Mike -- Mike Battersby <mib at unimelb.edu.au> The University of Melbourne Fetch my pgp key from: http://ariel.ucs.unimelb.edu.au/~mib/pgpkey.txt ----------...
2000 Nov 14
0
2.3.0p1, Solaris 7 and last login (fwd)
...that in general, OpenSSH rocks? :) -- UNIX System Administrator - Boi Sletterink Phone: +31-15-278 2504 -------------- next part -------------- *** session.c.orig Sat Oct 28 05:19:58 2000 --- session.c Tue Nov 14 16:04:21 2000 *************** *** 590,600 **** --- 590,616 ---- int fdout, ptyfd, ttyfd, ptymaster; pid_t pid; + #define BOIS_DIRTY_PATCH + #ifdef BOIS_DIRTY_PATCH + char hostname[MAXHOSTNAMELEN]; + time_t last_login_time; + struct passwd * pw = s->pw; + char *time_string; + #endif + if (s == NULL) fatal("do_exec_p...
2002 Jan 30
0
[Bug 87] New: Last logon that gets reported upon login is the current login time
..., const char *); void do_exec(Session *, const char *); -void do_login(Session *, const char *); +void do_login(Session *, const char *, const time_t, const char *); #ifdef LOGIN_NEEDS_UTMPX static void do_pre_login(Session *s); #endif @@ -548,11 +548,17 @@ { int fdout, ptyfd, ttyfd, ptymaster; pid_t pid; + char hostname[MAXHOSTNAMELEN]; + time_t last_login_time; if (s == NULL) fatal("do_exec_pty: no session"); ptyfd = s->ptyfd; ttyfd = s->ttyfd; + /* Get the time and hostname when the user las...
2002 Jun 29
0
Privsep for osf/1 .. still need a bit of help
...wrap.c =================================================================== RCS file: /var/cvs/openssh/monitor_wrap.c,v retrieving revision 1.13 diff -u -r1.13 monitor_wrap.c --- monitor_wrap.c 27 Jun 2002 00:23:03 -0000 1.13 +++ monitor_wrap.c 29 Jun 2002 03:19:30 -0000 @@ -649,6 +649,24 @@ s->ttyfd = -1; } +#ifdef HAVE_OSF_SIA +void +mm_setup_sia(char *name, char *tty) +{ + Buffer m; + + debug3("%s entering", __func__); + + buffer_init(&m); + buffer_put_cstring(&m, name); + buffer_put_cstring(&m, tty); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SETUP_SIA, &...
2002 Jun 28
0
Newer OSF patch.
...wrap.c =================================================================== RCS file: /var/cvs/openssh/monitor_wrap.c,v retrieving revision 1.13 diff -u -r1.13 monitor_wrap.c --- monitor_wrap.c 27 Jun 2002 00:23:03 -0000 1.13 +++ monitor_wrap.c 28 Jun 2002 20:29:12 -0000 @@ -649,6 +649,24 @@ s->ttyfd = -1; } +#ifdef HAVE_OSF_SIA +void +mm_setup_sia(char *name, char *tty) +{ + Buffer m; + + debug3("mm_setup_sia: entering"); + + buffer_init(&m); + buffer_put_cstring(&m, name); + buffer_put_cstring(&m, tty); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SETUP_SIA,...
2002 Aug 01
0
Tru64 and OSF/1 Privsep patch
...SARESPONSE, MONITOR_REQ_PAM_START, + MONITOR_REQ_SETUP_SIA, MONITOR_REQ_TERM }; diff -ur openssh-3.4p1/monitor_wrap.c openssh-3.4p1+/monitor_wrap.c --- openssh-3.4p1/monitor_wrap.c Thu Jun 20 20:43:43 2002 +++ openssh-3.4p1+/monitor_wrap.c Sun Jul 21 22:53:14 2002 @@ -649,6 +649,24 @@ s->ttyfd = -1; } +#ifdef HAVE_OSF_SIA +void +mm_setup_sia(char *name, char *tty) +{ + Buffer m; + + debug3("%s entering", __func__); + + buffer_init(&m); + buffer_put_cstring(&m, name); + buffer_put_cstring(&m, tty); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SETUP_SIA, &...
2018 Nov 29
2
Where to implement user limit settings ?
...9;m not using PAM so I need it in the sshd itself. The task is very simple - just to put one line calling setup_limits(pw); and link with -lshadow. But the problem is, where to put this line. I did it in session.c, in do_child(), like this: #ifdef HAVE_OSF_SIA session_setup_sia(pw, s->ttyfd == -1 ? NULL : s->tty); if (!check_quietlogin(s, command)) do_motd(); #else /* HAVE_OSF_SIA */ /* When PAM is enabled we rely on it to do the nologin check */ if (!options.use_pam) { do_nologin(pw); setup_limits(pw); /* Set...
2001 Feb 22
0
Solaris and Latest snapshot (2001-02-21) (fwd)
...session_proctitle(s); > > +#ifdef USE_PAM > + do_pam_setcred(); > +#endif /* USE_PAM */ > + > /* Fork the child. */ > if ((pid = fork()) == 0) { > /* Child. Reinitialize the log since the pid has changed. */ > @@ -593,6 +597,11 @@ > ptyfd = s->ptyfd; > ttyfd = s->ttyfd; > > +#ifdef USE_PAM > + do_pam_session(pw->pw_name, s->tty); > + do_pam_setcred(); > +#endif /* USE_PAM */ > + > /* Fork the child. */ > if ((pid = fork()) == 0) { > /* Child. Reinitialize the log because the pid has changed. */ > @@ -1142,1...
2003 Apr 02
0
TIOCSCTTY problem/fix
...ailed - could not set controlling tty: Device not configured The effect is that ^Z's are mostly ignored (but not by vi) and ^C kills the session, rather than a running program. After poking around the net and the code a bit, I found that changing line 318 in sshpty.c from: if (ioctl(*ttyfd, TIOCSCTTY, NULL) < 0) to if (ioctl(*ttyfd, TIOCSCTTY, 1) < 0) seems to fix things. Is this a known bug or something peculiar to my installation? Let me know if there is any further information I can provide. Thanks for any input. --Frank.