search for: _path_devnull

Displaying 20 results from an estimated 28 matches for "_path_devnull".

2007 Dec 26
1
sshd's -e doesn't work as expected
...hd.c 26 Dec 2007 20:12:22 -0000 @@ -1485,8 +1485,16 @@ main(int ac, char **av) if (!(debug_flag || inetd_flag || no_daemon_flag)) { int fd; - if (daemon(0, 0) < 0) + if (daemon(0, 1) < 0) fatal("daemon() failed: %.200s", strerror(errno)); + close(STDIN_FILENO); + open(_PATH_DEVNULL, O_RDONLY); + close(STDOUT_FILENO); + open(_PATH_DEVNULL, O_WRONLY); + if (!log_stderr) { + close(STDERR_FILENO); + open(_PATH_DEVNULL, O_WRONLY); + } /* Disconnect from the controlling tty. */ fd = open(_PATH_TTY, O_RDWR | O_NOCTTY); -- Julio M. Merino Vidal <jmmv at NetBSD.or...
2018 Apr 27
4
[PATCH] allow indefinite ForwardX11Timeout by setting it to 0
...x11_timeout_real = UINT_MAX; else x11_timeout_real = timeout + X11_TIMEOUT_SLACK; + if ((r = snprintf(cmd, sizeof(cmd), "%s -f %s generate %s " SSH_X11_PROTO " untrusted timeout %u 2>" _PATH_DEVNULL, @@ -355,7 +361,7 @@ client_x11_get_proto(struct ssh *ssh, const char *display, (size_t)r >= sizeof(cmd)) fatal("%s: cmd too long", __func__); debug2("%s: %s", __func__, cmd); - if (x11_refuse_time == 0) { +...
2017 Oct 09
5
Why dup()?
Hello all, My scripts, which read stdout from ssh, weren't seeing EOF from the remote session.? It was being sent, but lost.? I tracked it down to the following code, in ssh.c, at ssh_session2_open: ??????? if (stdin_null_flag) { ??????????????? in = open(_PATH_DEVNULL, O_RDONLY); ??????? } else { ??????????????? in = dup(STDIN_FILENO); ??????? } ??????? out = dup(STDOUT_FILENO); ??????? err = dup(STDERR_FILENO); The remote session did close stdout.? The sshd from which it was spawned signaled to close stdout.? The ssh program received that signal and clo...
1999 Nov 22
3
status of openssh for solaris?
...-g -O2 -Wall -I/usr/local/ssl/include -DETCDIR=\"/usr/local/etc\" -DSSH_PR >OGRAM=\"/usr/local/bin/ssh\" -DASKPASS_PROGRAM=\"/usr/local/libexec/ssh/ssh-as >kpass\" -DHAVE_CONFIG_H -c bsd-daemon.c >bsd-daemon.c: In function `daemon': >bsd-daemon.c:70: `_PATH_DEVNULL' undeclared (first use in this function) >bsd-daemon.c:70: (Each undeclared identifier is reported only once >bsd-daemon.c:70: for each function it appears in.) >*** Error code 1 >make: Fatal error: Command failed for target `bsd-daemon.o' > >I cannot find any reference to...
2006 Jan 03
2
Bug ? on ssh-agent
...implementation. What happens is that the agent is apparently launched without any opened file descriptors (as far as I can see). So the auth socket gets the fd 0. We therefore fall on the "/* XXX might close listen socket */" case... I suggest a simple patch here : if ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { if (sock == 0) { dup2(sock, fd+1) ; close(sock) ; sock = fd+1 ; } (void)dup2(fd, STDIN_FILENO); (void)dup2(fd, STDOUT_FILENO); (void)dup2(fd, STDERR_FILENO); if (fd > 2) close(fd); } It wou...
2005 Sep 08
1
[Bug 1082] xauth list invocation has bogus "." argument
...g "." argument which causes xauth to unnecessarily try to lookup a display called "." after reporting about the display that we actually care about. Fix is to change the: snprintf(cmd, sizeof(cmd), "%s %s%s list %s . 2>" _PATH_DEVNULL, to: snprintf(cmd, sizeof(cmd), "%s %s%s list %s 2>" _PATH_DEVNULL, Sorry I don't have the actual line number or a real patch but visual inspection should spot this fairly easily. ------- You are receiving this mail because: ------- You...
1999 Nov 22
0
Solaris 7 and /dev/null ...
As far as I can tell, it isn't defined anywhere, so bsd-login.c fails: bsd-daemon.c: In function `daemon': bsd-daemon.c:70: `_PATH_DEVNULL' undeclared (first use in this function) bsd-daemon.c:70: (Each undeclared identifier is reported only once bsd-daemon.c:70: for each function it appears in.) I dont' know if anyone actually puts /dev/null in a different place...is there a reason why _PATH_DEVNULL isn't just changed to...
1999 Nov 23
2
Fixes for Solaris
...f HAVE_SYS_TIME_H # include <sys/time.h> /* For timersub */ #endif +#ifdef HAVE_MAILLOCK_H +#include <maillock.h> +#endif + #ifndef SHUT_RDWR enum { @@ -174,6 +182,10 @@ #ifndef _PATH_STDPATH # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin:" +#endif + +#ifndef _PATH_DEVNULL +# define _PATH_DEVNULL "/dev/null" #endif #ifndef _PATH_MAILDIR Index: configure.in =================================================================== RCS file: /var/cvs/openssh/configure.in,v retrieving revision 1.25 retrieving revision 1.27 diff -u -r1.25 -r1.27 --- configure.in 1...
2005 Jun 12
2
%h,%p,%u expansion for ControlPath
This allows me to set 'ControlPath ~/.ssh/sockets/%h.%p.%u' for example. Have I missed a good reason why ssh_connect finds the default port number for itself instead of just having it in options.port (like we do for the the default in options.user)? --- openssh-4.1p1/ssh.c~ 2005-06-12 09:47:18.000000000 +0100 +++ openssh-4.1p1/ssh.c 2005-06-12 09:40:53.000000000 +0100 @@ -604,6 +604,17
2002 Feb 04
1
forkoff()
...;stdin_buffer) == 0) { packet_start(SSH_CMSG_EOF); packet_send(); } } if (detach) { /* * There should be a chan_wont_read()/chan_wont_write() * API, differing only in the debug messages used. */ chan_read_failed(c); chan_write_failed(c); channel_close_fds(c); fd = open(_PATH_DEVNULL, O_RDWR, 0); if (fd < 0) return; (void) dup2(fd, STDIN_FILENO); (void) dup2(fd, STDOUT_FILENO); (void) dup2(fd, STDERR_FILENO); if (fd > 2) (void) close(fd); (void) setsid(); } } -- -DISCLAIMER: an automatically appended disclaimer may follow. By posting- -to a public e-ma...
1999 Dec 21
0
Problem with UTMP recording
...f WTMP_FILE # define _PATH_WTMP WTMP_FILE # else # define _PATH_WTMP "/var/adm/wtmp" # endif # endif #endif #ifndef _PATH_BSHELL # define _PATH_BSHELL "/bin/sh" #endif #ifndef _PATH_STDPATH # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin:" #endif #ifndef _PATH_DEVNULL # define _PATH_DEVNULL "/dev/null" #endif #ifndef _PATH_MAILDIR # ifdef MAILDIR # define _PATH_MAILDIR MAILDIR # endif #endif #ifndef MAX # define MAX(a,b) (((a)>(b))?(a):(b)) # define MIN(a,b) (((a)<(b))?(a):(b)) #endif #ifndef timersub #define timersub(a, b, result)...
1999 Nov 19
0
[openssh-1.2pre13] patch for solaris 7 ...
...efine in config.h.in 2. fixes a bug in config.h.in where paths.h is included, yet HAVE_PATHS_H is undefined 3. fixes a bug in bsd-daemon.c where paths.h is included, yet HAVE_PATHS_H is undefined 4. add config.h to bsd-login.h, which is required to define UTMP_PATH 5. adds a define for _PATH_DEVNULL to be /dev/null, since Solaris doesn't define that path *anywhere* ... Thsi patch requires autoconf to be run, as there are changes to configure.in in here... expect a few more patches to be forthcoming... Marc G. Fournier marc.fournier at acadiau.ca Senior...
1999 Nov 23
0
status of Solaris build
Howdy, Well, I finally made it through a complete build of OpenSSH on Solaris 7/x86. I've included a few notes below. Most of them are either simple enough or too complex (i.e. I'm not sure how to do it without breaking other platforms) to generate patches for here. 1) _PATH_DEVNULL, _PATH_UTMP and _PATH_WTMP aren't defined anywhere, since Solaris doesn't appear to have a paths.h include. When the compile bailed, I dropped in a literal string and reran the make. 1a) There are some conflicting declarations of __progname in the application *.c files (s...
1999 Dec 26
0
ALERT: potential for `.' in _PATH_STDPATH [OpenSSH-1.2.1pre21]
..../config.h.in.orig-pathdot Sat Dec 25 22:25:22 1999 +++ ./config.h.in Sun Dec 26 02:06:52 1999 @@ -371,7 +371,7 @@ #endif #ifndef _PATH_STDPATH -# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin:" +# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" #endif #ifndef _PATH_DEVNULL
2019 Sep 16
2
ssh client is setting O_NONBLOCK on a pipe shared with other processes
> Case in point; EAGAIN can come if you give your fd to another process > and continue using it yourself. > Short counts; It is documented behavior that read() and write() may > return short counts. It is not documented why, so you can not make > any assumptions. You might be right about short counts but if you're right about EAGAIN, there are bugs everywhere. My first
2001 Jan 04
2
Patch to allow openssh-2.2.0-p1 to be started from /etc/inittab
...; ! case 0: ! break; ! default: ! _exit(0); ! } ! } ! ! signal(SIGTTOU, SIG_IGN); ! signal(SIGTTIN, SIG_IGN); ! ! if (setsid() == -1 && getppid() != 1) ! return (-1); ! ! if (!nochdir) ! (void)chdir("/"); ! ! if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { ! (void)dup2(fd, STDIN_FILENO); ! (void)dup2(fd, STDOUT_FILENO); ! (void)dup2(fd, STDERR_FILENO); ! if (fd > 2) ! (void)close (fd); ! } ! return (0); ! } diff -c -r openssh-2.2.0p1/bsd-daemon.h openssh-2.2.0p1-pen1/bsd-daemon.h *** openssh-2.2.0p1/bsd-daemon...
2002 Feb 01
1
FEATURE: -f -f - fork after successful open of fwd port/display/agent
...ut_string("\004", 1); + packet_send(); + /* Close stdin. */ + stdin_eof = 1; + if (buffer_len(&stdin_buffer) == 0) { + packet_start(SSH_CMSG_EOF); + packet_send(); + } + } + + if (detach) { + chan_read_failed(c); + chan_write_failed(c); + channel_close_fds(c); + fd = open(_PATH_DEVNULL, O_RDWR, 0); + if (fd < 0) + return; + (void) dup2(fd, STDIN_FILENO); + (void) dup2(fd, STDOUT_FILENO); + (void) dup2(fd, STDERR_FILENO); + if (fd > 2) + (void) close(fd); + (void) setsid(); + } +} + static void client_input_stdout_data(int type, int plen, void *ctxt) { @@ -1187,...
2002 Feb 05
0
New forkoff() and chan_wont_read/write() API
...cket_start(SSH_CMSG_EOF); + packet_send(); + } + } + + if (!compat20) + return; + + c = channel_lookup(session_ident); + if (c == NULL) + error("couldn't lookup session channel"); + + if (detach) { + chan_wont_read(c); + chan_wont_write(c); + channel_close_fds(c); + fd = open(_PATH_DEVNULL, O_RDWR, 0); + if (fd < 0) + return; + (void) dup2(fd, STDIN_FILENO); + (void) dup2(fd, STDOUT_FILENO); + (void) dup2(fd, STDERR_FILENO); + if (fd > 2) + (void) close(fd); + (void) setsid(); + } +} + static void client_input_stdout_data(int type, int plen, void *ctxt) { Index: 3_...
2001 Feb 12
3
add scp path to _PATH_STDPATH
...--- defines.h 2001/02/09 11:55:17 1.54 +++ defines.h 2001/02/12 14:47:53 @@ -267,7 +267,7 @@ #endif #ifndef _PATH_STDPATH -# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" +# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" ":" _PATH_SCP #endif #ifndef _PATH_DEVNULL
2002 Jan 11
1
X11 forwarding, -f, error handling
I'd like a feature whereby ssh puts itself in the background after the first successful X11 (or other port) forwarding. The reason for this is simple: error handling. If the application fails to open the X display and exits, then the client can still exit with the application's exit code. But if the application opens the X display successfully, then it can just display any errors by