[Remind-Fans] use of INCLUDECMD in web calendar blocked by automatic RUN OFF

Ian! D. Allen idallen at idallen.ca
Tue Oct 5 04:20:23 EDT 2021


Hello Dianne -

Feature Request!

I happily replaced with INCLUDECMD my frequent cron scripts that
updated my remind-format list of birthdays from my birthday list file.
Now, remind can run the update script directly and include the output.
It works great when I run remind from the command line or in a nightly
personal cron.  Thank you for this!

But it doesn't work with my web calendar, because my Apache server runs
all PHP code as "www-data" and remind turns RUN OFF when the owner of
the .reminder file (me) doesn't match the user running remind (www-data).

I looked into making Apache run my PHP web pages using the owner of
the file containing the PHP code (me), but all that looked very messy
and inefficient.  I will do that only if I have to.  (If you have an
easy way to do this, let me know.)  I think a simpler solution would be
to enhance remind.

It Would Be Nice If remind had a "trust" option to say "if the owner of
the remind file matches XXX, trust it and don't disable RUN or shell()"
so that my little PHP calendar web page could run my INCLUDECMD without
getting upset, e.g. "-Tdallen" could mean "trust owner idallen":

<?php system("HOME=/home/idallen remind -Tidallen -q -b2 -p".$months." /home/idallen/.reminders | [...]

If you wanted to be fancy, you could have a syntax that could require both
an owner and a group to match, e.g. "-Tidallen:idallen" or allowed just
a matching group to be trusted, e.g. "-T:idallen", or, heaven forbid,
allowed any owner or group, e.g. "-T:".  But that's not necessary if I
can just get an owner match.

It Would Also Be Helpful if the "trust" option allowed -u to work to set
the right environment variables without implying -r, so that I wouldn't
need to hard-code HOME myself when I call remind, e.g. I could simplify
to using this in my web calendar:

<?php system("remind -Tidallen -uidallen -q -b2 -p".$months." /home/idallen/.reminders | [...]

(Heuristic: Observant students will note that me hard coding
HOME=/home/idallen in my calendar web page only works if that is my
actual HOME directory.  If I change my HOME directory in the passwd
file, the calendar script breaks.  Having remind do a proper getpwnam()
using -u fixes this and I wouldn't have to learn how to make PHP do the
getpwnam() and parse the output to get the actual HOME.)

(Odd fact: Even though remind claims that "For any given Remind run,
a given INCLUDECMD command is only executed once and the  results are
cached.", remind is giving me 31 "RUN disabled" errors for a one-month
October calendar, and correspondingly more for multi-month calendars.
I expected only one error message.)

I love remind.  Thank you Dianne!

-- 
| Ian! D. Allen, BA, MMath  -  idallen at idallen.ca  - Ottawa, Ontario, Canada
| Home: www.idallen.com  Contact Improvisation Dance: www.contactimprov.ca
| Former college professor (Free/Libre GNU+Linux) at:  teaching.idallen.com
| Improve democracy: www.fairvote.ca and Defend digital freedom: www.eff.org


More information about the Remind-fans mailing list