Commit c2c993e4 authored by Volker Krause's avatar Volker Krause
Browse files

Remove support for procedure alarms

That is, executing a program specified in the iCal alarm. This is outright
dangerous in the context of shared calendars, as it allows externally
controlled content to run code on your local machine.

Procedure alarms are now treated just like regular alarms.

KAlarm still implements this functionality in combination with safe local
calendars, in case someone really can't live without it.
parent e2751f59
Pipeline #85945 passed with stage
in 14 minutes and 56 seconds
......@@ -1298,11 +1298,8 @@ automatically.</para></listitem>
<para>Use the <guibutton>Configure</guibutton> button to open the
<guilabel>Edit existing reminder</guilabel> dialog. Using this dialog, you can choose
how many minutes, hours or days before or after the events start or end you want to be reminded, you can set
repeating intervals for your reminders, and create special reminders that display text, send emails, play
sounds or run programs and scripts.</para>
<tip><para>If you select to run a specific program or script at the reminder time,
make sure, however, that you have sufficient rights to run that
program; if you do not, the program will not run.</para></tip>
repeating intervals for your reminders, and create special reminders that display text, send emails or play
sounds.</para>
</listitem>
</varlistentry>
......
......@@ -637,21 +637,9 @@ void AlarmDialog::eventNotification()
Alarm::List::ConstIterator ait;
for (ait = alarms.constBegin(); ait != alarms.constEnd(); ++ait) {
Alarm::Ptr alarm = *ait;
// we intentionally ignore Alarm::Procedure here, as that is insecure in the presence of shared calendars
// FIXME: Check whether this should be done for all multiple alarms
if (alarm->type() == Alarm::Procedure) {
// FIXME: Add a message box asking whether the procedure should really be executed
qCDebug(KOALARMCLIENT_LOG) << "Starting program: '" << alarm->programFile() << "'";
QString program = alarm->programFile();
// if the program name contains spaces escape it
if (program.contains(QLatin1Char(' ')) && !(program.startsWith(QLatin1Char('\"')) && program.endsWith(QLatin1Char('\"')))) {
program = QLatin1Char('\"') + program + QLatin1Char('\"');
}
// TODO move alarm->programArguments() as argument of QProcess API ?
QProcess::startDetached(program + QLatin1Char(' ') + alarm->programArguments(), QStringList());
} else if (alarm->type() == Alarm::Audio) {
if (alarm->type() == Alarm::Audio) {
beeped = true;
Phonon::MediaObject *player = Phonon::createPlayer(Phonon::NotificationCategory, QUrl::fromLocalFile(alarm->audioFile()));
player->setParent(this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment