svn commit: r367126 - head/usr.bin/calendar

Stefan Eßer se at FreeBSD.org
Thu Oct 29 08:26:39 UTC 2020


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 at 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);
 			}


More information about the svn-src-all mailing list