summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-10-27 01:26:50 +0000
committerdelphij <delphij@FreeBSD.org>2015-10-27 01:26:50 +0000
commit248fec0cc6c6b5ab1181c831ff3516b1a3542863 (patch)
treec6d26b114ebdd33ca05b7a092251f70c64885155 /usr.sbin
parent4dc2e0f9812ca90d69a6d1bbe61a7ed205a548d4 (diff)
downloadFreeBSD-src-248fec0cc6c6b5ab1181c831ff3516b1a3542863.zip
FreeBSD-src-248fec0cc6c6b5ab1181c831ff3516b1a3542863.tar.gz
Revert r289269 for now. After looking at share/zoneinfo/Makefile this could
potentially break non-root installs and we need a better solution, probably by doing it differently when no UI is involved.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/tzsetup/tzsetup.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 7d2a936..fc80364 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>
@@ -945,18 +944,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);
OpenPOWER on IntegriCloud