]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC: Fix calendar -a processing of files included in the user's home directory
authorStefan Eßer <se@FreeBSD.org>
Thu, 29 Oct 2020 08:26:38 +0000 (08:26 +0000)
committerStefan Eßer <se@FreeBSD.org>
Thu, 31 Dec 2020 17:04:47 +0000 (18:04 +0100)
commitde924aa90ca0d5bd7bbb31125864f0ffca021495
tree57cf01b31b64a43fd9793e2d1e4120a08007bfe5
parent320f0e909d003e23d7712a0c1e83a04f33dde2e0
MFC: 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

(cherry picked from commit 3fa2a149d68d22fa32ba7b6c09773388ac490fd1)

The code in -CURRENT is quite different (forks sub-processes tp
process the files for each user) but this change should provide the
same functionality as the referenced commit to -CURRENT.
usr.bin/calendar/calendar.c