diff options
| author | 2002-05-13 07:44:48 +0000 | |
|---|---|---|
| committer | 2002-05-13 07:44:48 +0000 | |
| commit | 36a045247fbcba16af9d1d41c0570346320ba8fe (patch) | |
| tree | fe48aab9fa8427aff151c9cbe0942ed7a0dc2744 /usr.sbin/chroot/chroot.c | |
| parent | move common distrib rules to main Makefile, (diff) | |
| download | wireguard-openbsd-36a045247fbcba16af9d1d41c0570346320ba8fe.tar.xz wireguard-openbsd-36a045247fbcba16af9d1d41c0570346320ba8fe.zip | |
o) fix order and usage of chroot&chdir;
o) move code up from chroot&chdir block (tftpd);
millert@ ok
Diffstat (limited to 'usr.sbin/chroot/chroot.c')
| -rw-r--r-- | usr.sbin/chroot/chroot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/chroot/chroot.c b/usr.sbin/chroot/chroot.c index 3c82b505411..42aa469899f 100644 --- a/usr.sbin/chroot/chroot.c +++ b/usr.sbin/chroot/chroot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chroot.c,v 1.3 2000/08/17 15:28:36 mickey Exp $ */ +/* $OpenBSD: chroot.c,v 1.4 2002/05/13 07:44:48 mpech Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -41,7 +41,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)chroot.c 5.8 (Berkeley) 6/1/90";*/ -static char rcsid[] = "$OpenBSD: chroot.c,v 1.3 2000/08/17 15:28:36 mickey Exp $"; +static char rcsid[] = "$OpenBSD: chroot.c,v 1.4 2002/05/13 07:44:48 mpech Exp $"; #endif /* not lint */ #include <stdio.h> @@ -62,7 +62,7 @@ main(argc, argv) (void)fprintf(stderr, "usage: chroot newroot [command]\n"); exit(1); } - if (chdir(argv[1]) || chroot(".")) + if (chroot(argv[1]) || chdir("/")) err(1, "%s", argv[1]); if (argv[2]) { execvp(argv[2], &argv[2]); |
