o Do not run any iconv() processing in -a. The locale of root user is not
what is desired by most of the users who receive their calendar mail.
Just assume that users store their calendars in a format that is readable
to them. This fixes regression from r344340.
o fork() and setusercontext(LOGIN_SETALL) for every user. This makes LANG
set inside a calendar file mostly excessive, as we will pick up user's
login class LANG.
o This also executes complex function cal() that parses user owned files
with appropriate user privileges.
Previously it was run with privileges dropped only temporary for execution
of cal(), and fully dropped only before invoking sendmail (see r22473).
Reviewed by: bapt (older version of patch)
calendar(1) can have input in various encoding, specifying
LANG=<locale_name> to enable calendar(1) to determine which one to use.
The problem is the content of the calendar itself is exposed as is making it
unreadable in many cases. For example french calendar which is encoded
ISO8859-1 is rendered badly in a fr_FR.UTF-8 environment.
Using iconv allows to solve this issue.
This will also allow to keep only 1 encoding in base for those files without
breaking user existing setup
Reported by: many
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19221
Mainly focus on files that use BSD 3-Clause license.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.
Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96
When the user supplies an invalid number of days provide a useful error message
instead of segfaulting.
PR: bin/186697
Reported by: kaltheat <kaltheat@gmail.com>
Submitted by: oliver <oliver@beefrankly.org> (older version)
In addition to adding `static' where possible:
- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
- Add ? option to optstring.
- Sort options alphabetically.
- Vertical space.
Tidy up usage() function.
Bring man page in sync with source.
Ensure that debug code is only executed with the -d option.
Submitted by: Christiane Yeardley
- Remove the 3rd clause of the UC Berkeley copyrighted files.
- For the files added copyrighted by me, move the "All rights
reserved" to the next line.
- Repeating events which span multiple years (because of -A, -B or
just the three days before the end of the year).
- Support for lunar events (full moon, new moon) and solar events
(equinox and solstice, chinese new year). Because of this, the
options -U (UTC offset) and -l (longitude) are available to
compensate if reality doesn't match the calculated values.
MFC after: 1 month
-W is like -A (number of days in the future to consider, but also
specifies that we don't want special treatment at weekends.
-F changes our notion of "Friday" (the day before the weekend).
Arguably, calendar(1) is broken to have special treatment of weekends
by default, but this method maintains POLA.
of the recent WARNS commits. The idea is:
1) FreeBSD id tags should follow vendor tags.
2) Vendor tags should not be compiled (though copyrights probably should).
3) There should be no blank line between including cdefs and __FBSDIF.
``the last Monday in April'
- handle easter
new options
-f calendarfile
-A days
-B days
Calendar HOME directory ~/.calendar
don't sent mail if ~/.calendar/nomail exist