Parent Directory
|
Revision Log
| Links to HEAD: | (view) (download) (annotate) |
| Sticky Revision: |
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
Add extremely useful calendar(1) application to FreeBSD It does extremely useful things like execute sendmail and spew dubiously accurate factoids. From the feedback, it seems like it is an essential utility in a modern unix and not at all a useless bikeshed. How do those Linux people live without it? Reverts r358561.
Fix 'calendar -a' in several ways. 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: use iconv to respect the output encoding 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
General further adoption of SPDX licensing ID tags. 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 copyright clause 4 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
calendar(1): don't segfault in invalid input 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)
Revert revision 251648. style(9) requires an empty line here. Reported by: mdf@
style(9) MFC after: 2 weeks
More -Wmissing-variable-declarations fixes. 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'.
Tidy up command line processing: - 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
On request of joel@: - 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.
Long awaited update to the calendar system: - 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
- Remove times.h from C programs that does not manipulate with time at all. - Remove pathnames.h from all but io.c since it's the only module that used these definations.
Revert most part of 200420 as requested, as more review and polish is needed.
Remove unneeded header includes from usr.bin/ except contributed code. Tested with: make universe
Move functions which are only locally used into their C files and make them static. usage() in calendar.c event_*() in io.c PR: bin/118644 Approved by: bde@ (mentor)
style(9)ify usr.bin/calendar PR: bin/118644 Approved by: bde@ (mentor) MFC after: 1 week
ANSIfy function definitions. Move some extern declarations to a header file. Remove an unneeded extern declaration for optarg.
Fix the usage() to match style(9).
Add two new options: -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.
Style improvements recommended by Bruce as a follow up to some 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.
WARNS=2 fixup (mostly. Some are Hard To Fix(tm), so NO_WERROR is set) Use __FBSDID(). Sort some headers.
Remove redundant declaration of optind. It has been declared in unistd.h for ages.
List the -t option in usage(). PR: 21734 Submitted by: Giorgos Keramidas <keramida@ceid.upatras.gr>
Add missing $FreeBSD$ tags
Don't add '?' to getopt's options.
compare return value from getopt against -1 rather than EOF, per the final posix standard on the topic.
Initialize the group list when we switch uids when run as root with "calendar -a". Drop all privs when execing other programs. Obtained from: OpenBSD
Localize it Handle Orthodox Eastern -Wall cleanup
- handle events that move around from year to year, i.e.,
``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
Change error diagnostic to be less confusing: no calendar file -> no calendar file in current directory
Remove hack inserted by me long time ago (cd $HOME for user-called case), no other system do it and it can cause problem with multi-calendars for single user.
Delete bogus referneces to timezone code internal header file `tzfile.h', which is no longer bogusly installed in /usr/include.
Remove trailing whitespace.
Fix for two problems: Calendar not cd $HOME when running by user Calendar calls cpp with # lines allowed
This commit was generated by cvs2svn to compensate for changes in r1590, which included commits to RCS files with non-trunk default branches.
BSD 4.4 Lite Usr.bin Sources
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
| ViewVC Help | |
| Powered by ViewVC 1.1.27 |