calendars to be other than regular files unless the -x option is in
effect.
(If not in -a mode, we're running purely as the user whose calendar it
is and if they want to DoS themselves with named pipes it's their own
lookout.)
from /etc/daily); do not exec other programs while the real uid is
still 0.
Also, clear the supplementary groups list up front and call initgroups
when becoming another user, to avoid leaking any extra group
privileges that we might have.
And finally, don't silently ignore errors changing uid and gid; those
are serious if they happen.
day-of-month on normal entries to always be treated as a wildcard.
Specifically, "if (x&(y|z))" is equivalent to "if ((x&y)||(x&z))", not
"if ((x&y)&&(x&z))", which latter is clearly what was intended.
to be wildcarded.
As a side effect, this allows '**' in the date field to match every
day of the year, which is very useful for TODO items.
It's important to note that the syntax has a lot of hardcoded (and
undocumented) ambiguity resolution stuff, and is crying out for a
simplification, and maybe some use of yacc and lex.
When this is done, a minor flag day (and probably a compatibility
flag :-( ) should be included, for current users who are making
use of some of the corner cases. I'll raise this on tech-userlevel
before going there. CVS:
----------------------------------------------------------------------
directory, use the first found of:
./calendar
./.calendar
/etc/calendar
Note that currently only the first found of these is used (so that users may
override a system calendar placed in /etc if desired). Users who want can always
use #include to continue the chain...
- use cpp -traditional, since the default has now changed. We want to allow
unmatched single quotes!
- use fparseln, instead of a fixed 2k buffer.
- make all locals static and move to the top. This is so we can eventually
make calendar understand languages other than us_en
- add braces and continue's to clarify things.
- replace gratuitous fprintf uses with warnx.
- replace vforks() with forks() since we tried to print errors with stdio.
- add more warnings so that we know how things fail.
XXX: Eventually we'll have to remove the cpp dependency, and we should:
- make it use m4 instead [bad, breaks compatibility]
or
- add a small cpp like parser for #include [bad, too much code]
__CONCAT("foo","bar");
actually works to concantate strings, it's because the preprocessor expands
it into "foo""bar" as separate strings, and then ANSI string concatenation
is performed on that. It's more straightforward to just use ANSI string
concatenation directly, and newer GCCs complain (rightly) about misuse
of token pasting.
user to:
- get entries from a file other than "calendar".
- get entries for a different date than today.
- get entries for a whole week in advance, or only one day.