Date: Tue, 27 Oct 2015 01:28:11 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290033 - stable/10/usr.sbin/tzsetup Message-ID: <201510270128.t9R1SB4v093172@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Tue Oct 27 01:28:11 2015 New Revision: 290033 URL: https://svnweb.freebsd.org/changeset/base/290033 Log: Revert the merge of r289269 for now as it may break non-root installs. Modified: stable/10/usr.sbin/tzsetup/tzsetup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/10/usr.sbin/tzsetup/tzsetup.c Tue Oct 27 01:28:07 2015 (r290032) +++ stable/10/usr.sbin/tzsetup/tzsetup.c Tue Oct 27 01:28:11 2015 (r290033) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510270128.t9R1SB4v093172>