summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/sshpty.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2009-05-22 18:46:28 +0000
committerdes <des@FreeBSD.org>2009-05-22 18:46:28 +0000
commit8bf56a9772e08d79d1a808bb69be82ca688afc76 (patch)
treed3b23c04145e95d8d26c4e6efa1cd05fa34fd795 /crypto/openssh/sshpty.c
parent56fa0af6738b5c4466957197aaa372d30e74440b (diff)
parentf4c3a2131f559534b5693fd15df8d89049db7cbb (diff)
downloadFreeBSD-src-8bf56a9772e08d79d1a808bb69be82ca688afc76.zip
FreeBSD-src-8bf56a9772e08d79d1a808bb69be82ca688afc76.tar.gz
Upgrade to OpenSSH 5.2p1.
MFC after: 3 months
Diffstat (limited to 'crypto/openssh/sshpty.c')
-rw-r--r--crypto/openssh/sshpty.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/openssh/sshpty.c b/crypto/openssh/sshpty.c
index 5a0d1a7..bbbc0fe 100644
--- a/crypto/openssh/sshpty.c
+++ b/crypto/openssh/sshpty.c
@@ -46,6 +46,13 @@
#define O_NOCTTY 0
#endif
+#ifdef __APPLE__
+# include <AvailabilityMacros.h>
+# if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
+# define __APPLE_PRIVPTY__
+# endif
+#endif
+
/*
* Allocates and opens a pty. Returns 0 if no pty could be allocated, or
* nonzero if a pty was successfully allocated. On success, open file
@@ -78,10 +85,12 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen)
void
pty_release(const char *tty)
{
+#ifndef __APPLE_PRIVPTY__
if (chown(tty, (uid_t) 0, (gid_t) 0) < 0)
error("chown %.100s 0 0 failed: %.100s", tty, strerror(errno));
if (chmod(tty, (mode_t) 0666) < 0)
error("chmod %.100s 0666 failed: %.100s", tty, strerror(errno));
+#endif /* __APPLE_PRIVPTY__ */
}
/* Makes the tty the process's controlling tty and sets it to sane modes. */
OpenPOWER on IntegriCloud