008d3e66 | 10-Nov-2019 |
Aaron LI <aly@aaronly.me> |
calendar(1): Reset locale after parsing each calendar file
This avoids that one calendar file that changed the locale by defining the "LANG") does not interfere the following calendar files without
calendar(1): Reset locale after parsing each calendar file
This avoids that one calendar file that changed the locale by defining the "LANG") does not interfere the following calendar files without the "LANG" definition.
show more ...
|
effe59f3 | 10-Nov-2019 |
Aaron LI <aly@aaronly.me> |
calendar(1): Refactor mail header composition and sending
* Use 'struct iovec header[]' to hold all mail headers, and then use writev(2) to write them into the pipe.
* Explicitly set 'LC_TIME=C'
calendar(1): Refactor mail header composition and sending
* Use 'struct iovec header[]' to hold all mail headers, and then use writev(2) to write them into the pipe.
* Explicitly set 'LC_TIME=C' when formating the date string for the mail header.
Obtained-from: OpenBSD
show more ...
|
144b9c45 | 09-Nov-2019 |
Aaron LI <aly@aaronly.me> |
calendar(1): Merge 'pathnames.h' into 'io.c'
The '_PATH_INCLUDE' is no longer an appropriate name for the system calendars at '/usr/share/calendar', because we no longer use 'cpp' to parse the user'
calendar(1): Merge 'pathnames.h' into 'io.c'
The '_PATH_INCLUDE' is no longer an appropriate name for the system calendars at '/usr/share/calendar', because we no longer use 'cpp' to parse the user's calendar file.
show more ...
|
f8b849d1 | 09-Nov-2019 |
Aaron LI <aly@aaronly.me> |
calendar(1): Use login caps for 'calendar -a'
* Use 'fork()' and 'setusercontext(LOGIN_SETALL)' for every user. With this change, the complex function 'cal()' that parses user-owned calendars i
calendar(1): Use login caps for 'calendar -a'
* Use 'fork()' and 'setusercontext(LOGIN_SETALL)' for every user. With this change, the complex function 'cal()' that parses user-owned calendars is now executed with appropriate user privileges.
Previously it was run with privileges dropped only temporary for execution of 'cal()', and fully dropped only before invoking 'sendmail'.
* In 'calendar -a' mode, the 'getenv("HOME")' in 'cal_fopen()' function always returns the root's home directory instead of the current user's home (after fork() and setusercontext()), which makes 'chdir(home)' fail.
Fix this issue by moving the 'chdir(home)' to the 'main()' function in 'calendar.c'. In the meantime, back to home directory in 'cal_fopen()' function after opening the calendar file.
Partially based on FreeBSD's commit: https://github.com/freebsd/freebsd/commit/7ff75f4a5a3d9ada5bd68384fdded357fa4c1105
show more ...
|
64f6dfcf | 06-Nov-2019 |
Aaron LI <aly@aaronly.me> |
calendar(1): Merge two fixes to calendars from FreeBSD
* Change the date of 'Canberra Day' https://github.com/freebsd/freebsd/commit/8b17fbc25c73dce357de0a309ade8bfa4b7674b0
* Correct spelling fo
calendar(1): Merge two fixes to calendars from FreeBSD
* Change the date of 'Canberra Day' https://github.com/freebsd/freebsd/commit/8b17fbc25c73dce357de0a309ade8bfa4b7674b0
* Correct spelling for 'King Chulalongkorn Day in Thailand' https://github.com/freebsd/freebsd/commit/6bc988a89b2d13e66a4b80e0f8503ea9175c72b0
show more ...
|
3a34e56d | 03-Nov-2019 |
Aaron LI <aly@aaronly.me> |
calendar(1): Do not ignore errors of setuid/setgid in '-a' mode
Also clear the supplementary groups list up front when becoming another user, to avoid leaking any extra group privileges that we migh
calendar(1): Do not ignore errors of setuid/setgid in '-a' mode
Also clear the supplementary groups list up front when becoming another user, to avoid leaking any extra group privileges that we might have.
In addition, introduce the 'changeuser()' function to make the 'closecal()' function a bit cleaner.
Obtained-from: NetBSD (https://github.com/NetBSD/src/commit/d23503416735cd0ca069bbd4e59c9c5b93278d8b)
show more ...
|
04c78042 | 05-Nov-2019 |
Aaron LI <aly@aaronly.me> |
calendar(1): Improve UTC offset and longitude handling
Refactor the code that deals with the UTC offset into a separate function 'get_utcoffset()'.
Meanwhile, allow the '-l' option to accept a floa
calendar(1): Improve UTC offset and longitude handling
Refactor the code that deals with the UTC offset into a separate function 'get_utcoffset()'.
Meanwhile, allow the '-l' option to accept a float number instead of an integer only. This makes more sense.
show more ...
|