| Age | Commit message (Collapse) | Author |
|
|
|
It is possible that reading the entire error string requires multiple
read() calls.
|
|
dtach was assuming that writes with a small byte count could never fail,
and was not handling partial writes for larger byte counts in a few
places.
This should also suppress unused result warnings from gcc on systems
that define _FORTIFY_SOURCE by default.
|
|
dtach was not checking if the fchdir back to the old directory worked
when it tried to get around the sun_path length limit.
|
|
Also change the execvp error exit from 127 to 1 to be consistent between
dtach -n and dtach -N.
|
|
This allows one to have executables starting with -; another side-effect
of this patch is that in case dtach is used in a script where we can't
trust the user input, now the user is not able to inject new options
that are interpreted by dtach; (for example it is used like dtach -c
socket -- ${@}
(cherry picked from commit ff35a7e791225f8d28a27033658070bbb4caa5ff)
|
|
Just wrapping the socket system call with umask doesn't work.
|
|
Use umask(077) to avoid a race condition between the creation of the
dtach socket and the chmod system call on the socket.
This race condition can potentially be exploited when the dtach socket
is created in a directory such as /tmp.
(cherry picked from commit b71dfb2e2c02dfe14738781214a5734d63eeb772)
|
|
gcc now warns that sig is an unused parameter:
attach.c: In function 'win_change':
attach.c:99:16: warning: unused parameter 'sig' [-Wunused-parameter]
99 | win_change(int sig)
| ~~~~^~~
|
|
The sourceforge website warns that their users.sourceforge.net email
forwarding feature is "discouraged and no longer available to new
accounts."
|
|
|
|
Use http://www.gnu.org/licenses/ instead of a postal address as
suggested in PR #7.
|
|
As learned by RPMLINT when building a package for openSUSE.
|
|
|
|
|
|
Also add some documentation mentioning the devices that dtach usually
needs access to on Linux.
Bug reported by David Bremner at https://bugs.debian.org/804944
|
|
Signals set to SIG_IGN (such as SIGPIPE) are not reset when execve is
called, which causes programs executed by dtach to start in a different
state than what they expect. Calling init_pty first is the simplest way
to fix this bug.
Bug reported by Robert de Bath at https://bugs.debian.org/805417
|
|
|
|
dtach -p copies the contents of standard input to a session.
Based on an initial patch by @johnlane.
|
|
If a socket's path name would overflow sun_path, try to make it fit by
temporarily changing to the directory the socket is in and using the
path's basename in sun_path.
This should help for the case where the basename of the socket does fit
in sun_path, even if the rest of the path doesn't.
|
|
The code wasn't checking for overflow before copying the socket path
name to to the sun_path field, which is usually much smaller than
PATH_MAX.
Report and initial patch by Paul Wilkinson.
|
|
valgrind reports:
Syscall param write(buf) points to uninitialised byte(s)
In this case, it is a false positive, but adding this single memset at
attach start-up means the program is now clean when run with "valgrind
--trace-children=yes dtach -c ...", which can make future debugging
easier.
|
|
dtach -N is similar to dtach -n, except dtach will not daemonize.
Based on patches by Ciprian Dorin Craciun and Frank Hunleth.
|
|
Based on dtach-0.8-socket-exec-bit.diff by Kodest.
|
|
|
|
Patch by Ross Mohn.
|
|
attach.c did not correctly handle a read from stdin when read returned
an error. The code assigned the return value of read to pkt.len (an
unsigned char) before checking the value. This prevented the error check
from working correctly, since an unsigned integer can never be < 0.
A packet with an invalid length was then sent to the master, which then
sent 255 bytes of garbage to the program.
Fix the bug in attach.c and the unchecked packet length bug in master.c.
Report and initial patch by Enrico Scholz.
|
|
|
|
|
|
|
|
|
|
while trying to execute the program.
|
|
printing an error message.
|
|
page.
|
|
paranoid about this, and only remove the specified file if connect says
the connection was refused and stat says the file is a socket.
Also dtach -A now only tries to create the socket if the connection was
refused or the socket did not exist, instead of on any random error as
before.
|
|
|
|
exiting silently.
Also make sure the master process waits until the client attaches when using
the -A and -c modes, so that the error message has a chance of being seen.
|
|
present when dtach is started, we now rely on whatever default terminal
settings the kernel uses.
|
|
the clients until at least one write worked and no error (other than EAGAIN)
occurred when writing to any of the clients. This way, complete data loss can
be avoided since at least one client must get all of the data.
Also make sure that stdin/stdout/stderr point to /dev/null instead of just
closing them, to avoid confusion.
|
|
|
|
command-line options.
|
|
the cursor size, which is handled incorrectly by some terminal emulators.
|
|
|
|
handler isn't reset on certain systems.
|
|
|
|
character method again.
|
|
|
|
select when checking the file descriptors for activity.
|
|
|
|
|