diff options
author | delphij <delphij@FreeBSD.org> | 2015-10-27 01:28:11 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-10-27 01:28:11 +0000 |
commit | da81d37a1e9c978c497e7adcbb61ad7e3255ec96 (patch) | |
tree | 24b7b35de362c2853774211222b8d885ac7ae3da | |
parent | 06466cc0fc6d68c87903b53bbdf43b338db42dfe (diff) | |
download | FreeBSD-src-da81d37a1e9c978c497e7adcbb61ad7e3255ec96.zip FreeBSD-src-da81d37a1e9c978c497e7adcbb61ad7e3255ec96.tar.gz |
Revert the merge of r289269 for now as it may break non-root installs.
-rw-r--r-- | usr.sbin/tzsetup/tzsetup.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index 5fe4f86..cea8533 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sysexits.h> #include <time.h> #include <unistd.h> @@ -936,18 +935,23 @@ main(int argc, char **argv) if (argc - optind > 1) usage(); - if (chrootenv != NULL) { - rv = chroot(chrootenv); - if (rv != 0) - err(EX_OSERR, "chroot to %s", chrootenv); + if (chrootenv == NULL) { + strcpy(path_zonetab, _PATH_ZONETAB); + strcpy(path_iso3166, _PATH_ISO3166); + strcpy(path_zoneinfo, _PATH_ZONEINFO); + strcpy(path_localtime, _PATH_LOCALTIME); + strcpy(path_db, _PATH_DB); + strcpy(path_wall_cmos_clock, _PATH_WALL_CMOS_CLOCK); + } else { + sprintf(path_zonetab, "%s/%s", chrootenv, _PATH_ZONETAB); + sprintf(path_iso3166, "%s/%s", chrootenv, _PATH_ISO3166); + sprintf(path_zoneinfo, "%s/%s", chrootenv, _PATH_ZONEINFO); + sprintf(path_localtime, "%s/%s", chrootenv, _PATH_LOCALTIME); + sprintf(path_db, "%s/%s", chrootenv, _PATH_DB); + sprintf(path_wall_cmos_clock, "%s/%s", chrootenv, + _PATH_WALL_CMOS_CLOCK); } - strcpy(path_zonetab, _PATH_ZONETAB); - strcpy(path_iso3166, _PATH_ISO3166); - strcpy(path_zoneinfo, _PATH_ZONEINFO); - strcpy(path_localtime, _PATH_LOCALTIME); - strcpy(path_db, _PATH_DB); - strcpy(path_wall_cmos_clock, _PATH_WALL_CMOS_CLOCK); /* Override the user-supplied umask. */ (void)umask(S_IWGRP | S_IWOTH); |