diff options
author | damien <damien> | 2000-03-02 12:56:12 +0000 |
---|---|---|
committer | damien <damien> | 2000-03-02 12:56:12 +0000 |
commit | 38ef88cf568a31e5d58987d7140735955817adc3 (patch) | |
tree | 4c436060e703711ea7fb31ae55329ae414cf86f8 /pty.c | |
parent | 9b176d2f922b72ab23937139a38b937f7951f38c (diff) | |
download | openssh-38ef88cf568a31e5d58987d7140735955817adc3.tar.gz |
- Warning was valid - possible race condition on PTYs. Avoided using
platform-specific code.
- Document some common problems
Diffstat (limited to 'pty.c')
-rw-r--r-- | pty.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$Id: pty.c,v 1.13 2000/03/02 12:31:50 damien Exp $"); +RCSID("$Id: pty.c,v 1.14 2000/03/02 12:56:13 damien Exp $"); #ifdef HAVE_UTIL_H # include <util.h> @@ -187,10 +187,12 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) void pty_release(const char *ttyname) { - if ((chown(ttyname, (uid_t) 0, (gid_t) 0) < 0) && (errno != ENOENT)) +#ifndef PTY_REMOVED_ON_CLOSE + if (chown(ttyname, (uid_t) 0, (gid_t) 0) < 0) error("chown %.100s 0 0 failed: %.100s", ttyname, strerror(errno)); - if ((chmod(ttyname, (mode_t) 0666) < 0) && (errno != ENOENT)) + if (chmod(ttyname, (mode_t) 0666) < 0) error("chmod %.100s 0666 failed: %.100s", ttyname, strerror(errno)); +#endif /* PTY_REMOVED_ON_CLOSE */ } /* Makes the tty the processes controlling tty and sets it to sane modes. */ |