summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-09-29 21:15:55 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-09-29 21:15:55 +0000
commitf9076603b6939d18addee72664abdd41bae3fe47 (patch)
treeaa38931690e69cb605f9213cb46780c0616d0b44
parentbd42b4ae82b68c101d7026b390103e5c550cf0f7 (diff)
we have setsid
-rw-r--r--usr.bin/ssh/config.h6
-rw-r--r--usr.bin/ssh/pty.c8
-rw-r--r--usr.bin/ssh/scp.c12
-rw-r--r--usr.bin/ssh/ssh.c4
-rw-r--r--usr.bin/ssh/sshd.c4
5 files changed, 7 insertions, 27 deletions
diff --git a/usr.bin/ssh/config.h b/usr.bin/ssh/config.h
index d99dfcc7545..0c9545a60ee 100644
--- a/usr.bin/ssh/config.h
+++ b/usr.bin/ssh/config.h
@@ -20,9 +20,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
-/* Define if your struct stat has st_blksize. */
-#define HAVE_ST_BLKSIZE 1
-
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#define HAVE_SYS_WAIT_H 1
@@ -295,9 +292,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
/* Define if you have the setrlimit function. */
#define HAVE_SETRLIMIT 1
-/* Define if you have the setsid function. */
-#define HAVE_SETSID 1
-
/* Define if you have the strchr function. */
#define HAVE_STRCHR 1
diff --git a/usr.bin/ssh/pty.c b/usr.bin/ssh/pty.c
index 189c570bcbf..a76a7a97c8e 100644
--- a/usr.bin/ssh/pty.c
+++ b/usr.bin/ssh/pty.c
@@ -14,7 +14,7 @@ Allocating a pseudo-terminal, and making it the controlling tty.
*/
#include "includes.h"
-RCSID("$Id: pty.c,v 1.1 1999/09/26 20:53:36 deraadt Exp $");
+RCSID("$Id: pty.c,v 1.2 1999/09/29 21:15:54 deraadt Exp $");
#include "pty.h"
#include "ssh.h"
@@ -246,14 +246,8 @@ void pty_make_controlling_tty(int *ttyfd, const char *ttyname)
close(fd);
}
#endif /* TIOCNOTTY */
-#ifdef HAVE_SETSID
-#ifdef ultrix
- setpgrp(0, 0);
-#else /* ultrix */
if (setsid() < 0)
error("setsid: %.100s", strerror(errno));
-#endif /* ultrix */
-#endif /* HAVE_SETSID */
/* Verify that we are successfully disconnected from the controlling tty. */
fd = open("/dev/tty", O_RDWR|O_NOCTTY);
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c
index e6667029eff..ae9bf4278d6 100644
--- a/usr.bin/ssh/scp.c
+++ b/usr.bin/ssh/scp.c
@@ -42,11 +42,11 @@ and ssh has the necessary privileges.)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scp.c,v 1.2 1999/09/29 18:16:20 dugsong Exp $
+ * $Id: scp.c,v 1.3 1999/09/29 21:15:54 deraadt Exp $
*/
#include "includes.h"
-RCSID("$Id: scp.c,v 1.2 1999/09/29 18:16:20 dugsong Exp $");
+RCSID("$Id: scp.c,v 1.3 1999/09/29 21:15:54 deraadt Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -957,7 +957,7 @@ run_err(const char *fmt, ...)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scp.c,v 1.2 1999/09/29 18:16:20 dugsong Exp $
+ * $Id: scp.c,v 1.3 1999/09/29 21:15:54 deraadt Exp $
*/
char *
@@ -1018,7 +1018,6 @@ allocbuf(bp, fd, blksize)
int fd, blksize;
{
size_t size;
-#ifdef HAVE_ST_BLKSIZE
struct stat stb;
if (fstat(fd, &stb) < 0) {
@@ -1029,10 +1028,7 @@ allocbuf(bp, fd, blksize)
size = blksize;
else
size = blksize + (stb.st_blksize - blksize % stb.st_blksize) %
- stb.st_blksize;
-#else /* HAVE_ST_BLKSIZE */
- size = blksize;
-#endif /* HAVE_ST_BLKSIZE */
+ stb.st_blksize;
if (bp->cnt >= size)
return (bp);
if (bp->buf == NULL)
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index bb7802886cd..043c3ff94ac 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -18,7 +18,7 @@ Modified to work with SSL by Niels Provos <provos@citi.umich.edu> in Canada.
*/
#include "includes.h"
-RCSID("$Id: ssh.c,v 1.11 1999/09/29 21:14:16 deraadt Exp $");
+RCSID("$Id: ssh.c,v 1.12 1999/09/29 21:15:54 deraadt Exp $");
#include "xmalloc.h"
#include "ssh.h"
@@ -628,9 +628,7 @@ main(int ac, char **av)
fatal("fork failed: %.100s", strerror(errno));
if (ret != 0)
exit(0);
-#ifdef HAVE_SETSID
setsid();
-#endif /* HAVE_SETSID */
}
#ifdef WITH_ZLIB
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index c06feeaf6c6..52f8ce47f55 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -18,7 +18,7 @@ agent connections.
*/
#include "includes.h"
-RCSID("$Id: sshd.c,v 1.6 1999/09/29 21:14:16 deraadt Exp $");
+RCSID("$Id: sshd.c,v 1.7 1999/09/29 21:15:54 deraadt Exp $");
#include "xmalloc.h"
#include "rsa.h"
@@ -409,9 +409,7 @@ main(int ac, char **av)
close(fd);
}
#endif /* TIOCNOTTY */
-#ifdef HAVE_SETSID
(void)setsid();
-#endif /* HAVE_SETSID */
}
/* Reinitialize the log (because of the fork above). */