--===============0692199999== Content-Type: multipart/signed; boundary="nextPart4544589.lmUAiyauio"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart4544589.lmUAiyauio Content-Type: multipart/mixed; boundary="Boundary-01=_ZuEvCpMHr8/9Xau" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_ZuEvCpMHr8/9Xau Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi,=20 Attached goes the patch that permits pass params to the program. It=20 understand certains macros (%d, %e,%D,%s ,%o) to expand. There are one security problem in the deal with the execution of programs = on=20 alarms. This problem resides on the remote calendars, that have assigned a= =20 "rm -rf /home/*" on the program. Evolution treats this asking for the user to execute the command. This has= =20 the objection that avoid the unmaintenance operation. How should we treat this ? Please, review the i18n's strings (my english is not very good), like you= =20 could noticed ;-). Regards =2D-=20 Keep away software patents from Europe. GPG Fingerprint: 7788 5526 6B2A 47BE 9618 8F48 30AB 1CF9 7799 71DC http://cernicalo.escomposlinux.org --Boundary-01=_ZuEvCpMHr8/9Xau Content-Type: text/x-diff; charset="iso-8859-15"; name="program_alarmaevent.dff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="program_alarmaevent.dff" Index: koeditorgeneral.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- koeditorgeneral.cpp (revisi=C3=B3n: 428201) +++ koeditorgeneral.cpp (copia de trabajo) @@ -53,6 +53,7 @@ #include =20 #include +#include =20 #include "koprefs.h" #include "koglobals.h" @@ -260,15 +261,27 @@ void KOEditorGeneral::pickAlarmProgram() { if (!mAlarmProgramButton->isOn()) { + mAlarmProgramLast =3D mAlarmProgram; mAlarmProgram =3D ""; QToolTip::remove(mAlarmProgramButton); QToolTip::add(mAlarmProgramButton, i18n("No program set")); } else { =2D QString fileName(KFileDialog::getOpenFileName(QString::null, QString= ::null, 0)); =2D if (!fileName.isEmpty()) { =2D mAlarmProgram =3D fileName; + KURL uri =3D KPimURLRequesterDlg::getURL( mAlarmProgramLast, i18n( + "Command to be executed on reminder. You can use this macros:\n\= n" + "\t\%c - Categories\n" + "\t\%d - Description\n" + "\t\%D - Date start\n" + "\t\%e - Date end\n" + "\t\%l - Location \n" + "\t\%o - Organizer\n" + "\t\%s - Sumary\n" + ), 0, + i18n("Set program...") ); + if (!uri.isEmpty()) { + mAlarmProgram =3D uri.pathOrURL(); + mAlarmProgramLast =3D mAlarmProgram; QToolTip::remove(mAlarmProgramButton); =2D QString dispStr =3D i18n("Running '%1'").arg(fileName); + QString dispStr =3D i18n("Running '%1'").arg( mAlarmProgram ); QToolTip::add(mAlarmProgramButton, dispStr); mAlarmSoundButton->setOn(false); } Index: koeditorgeneral.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- koeditorgeneral.h (revisi=C3=B3n: 428201) +++ koeditorgeneral.h (copia de trabajo) @@ -120,6 +120,7 @@ QString mCategories; QString mAlarmSound; QString mAlarmProgram; + QString mAlarmProgramLast; }; =20 #endif Index: korgac/alarmdialog.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- korgac/alarmdialog.cpp (revisi=C3=B3n: 428201) +++ korgac/alarmdialog.cpp (copia de trabajo) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -197,10 +198,24 @@ for ( it =3D alarms.begin(); it !=3D alarms.end(); ++it ) { Alarm *alarm =3D *it; // FIXME: Check whether this should be done for all multiple alarms =2D if (alarm->type() =3D=3D Alarm::Procedure) { =2D kdDebug(5890) << "Starting program: '" << alarm->programFile() << = "'" << endl; + if (alarm->type() =3D=3D Alarm::Procedure && !alarm->programFile().isE= mpty() ) { + QMap subst; + subst.insert( 'c', mIncidence->categoriesStr() ); + subst.insert( 'd', mIncidence->description() ); + subst.insert( 'D', mIncidence->dtStart().toString()); + subst.insert( 'e', mIncidence->dtEnd().toString() ); + subst.insert( 'l', mIncidence->location() ); + subst.insert( 'o', mIncidence->organizer().fullName() ); + subst.insert( 's', mIncidence->summary() ); + QString execLine =3D KMacroExpander::expandMacrosShellQuote( alarm->= programFile(), subst ); + if ( execLine.isEmpty() ) + execLine =3D alarm->programFile(); // fallback + + kdDebug(5890) << "Starting program: '" << execLine << "'" << endl; + KProcess proc; =2D proc << QFile::encodeName(alarm->programFile()); + proc.setUseShell( true ); + proc << QFile::encodeName(execLine); proc.start(KProcess::DontCare); } else if (alarm->type() =3D=3D Alarm::Audio) { --Boundary-01=_ZuEvCpMHr8/9Xau-- --nextPart4544589.lmUAiyauio Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBCvEuZMKsc+XeZcdwRAnTyAKCQ6q625uriUQuNzWTFniraBvLc5QCeIGfk nDCnlXQYKlg0zlNhY6GnBHg= =wLSz -----END PGP SIGNATURE----- --nextPart4544589.lmUAiyauio-- --===============0692199999== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-pim mailing list kde-pim@kde.org https://mail.kde.org/mailman/listinfo/kde-pim kde-pim home page at http://pim.kde.org/ --===============0692199999==--