Date: Thu, 29 Oct 2020 08:26:39 +0000 (UTC) From: =?UTF-8?Q?Stefan_E=c3=9fer?= <se@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367126 - head/usr.bin/calendar Message-ID: <202010290826.09T8QdYx055344@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: se Date: Thu Oct 29 08:26:38 2020 New Revision: 367126 URL: https://svnweb.freebsd.org/changeset/base/367126 Log: Fix calendar -a processing of files included in the user's home directory The existing code performed a chdir() into the home directory, but the parser fell back to using the invoking user's home directory as the base directory for the search for an include file. Since use of the -a option is limited to UID==0, the directory searched was typically ~root/.calendar, not the .calendar directory of the user whose file is being processed. PR: 205580 Reported by: greg.bal4@gmail.com (Greg Balfour) MFC after: 3 days Modified: head/usr.bin/calendar/calendar.c Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Thu Oct 29 02:02:30 2020 (r367125) +++ head/usr.bin/calendar/calendar.c Thu Oct 29 08:26:38 2020 (r367126) @@ -228,6 +228,7 @@ main(int argc, char *argv[]) if (setusercontext(lc, pw, pw->pw_uid, LOGIN_SETALL) != 0) errx(1, "setusercontext"); + setenv("HOME", pw->pw_dir, 1); cal(); exit(0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010290826.09T8QdYx055344>