Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Enable command splitter for anything not explicitly flagging kMSRunShell

This alters the MythSystem(QString, uint) constructor to automatically
parse any commands passed through it that do not explicitly set the
kMSRunShell flag.  A quick run through the code does not turn up any
instances where this is currently the case, so the code should remain
effectively unused for now.  Individual MythSystem users and the block
of myth_system() calls will need to be tested individually with this
path to debug the parser.

Ref #10860
  • Loading branch information...
commit e229f68b879d7594b4b2df03df928bc3ee21458f 1 parent c877947
@wagnerrp wagnerrp authored
Showing with 17 additions and 1 deletion.
  1. +17 −1 mythtv/libs/libmythbase/mythsystem.cpp
View
18 mythtv/libs/libmythbase/mythsystem.cpp
@@ -63,7 +63,23 @@ MythSystem::MythSystem(const QString &command, uint flags)
*/
void MythSystem::SetCommand(const QString &command, uint flags)
{
- SetCommand(command, QStringList(), flags | kMSRunShell);
+ if (flags & kMSRunShell)
+ SetCommand(command, QStringList(), flags);
+ else
+ {
+ QString abscommand;
+ QStringList args;
+ if (!d->ParseShell(command, abscommand, args))
+ {
+ LOG(VB_GENERAL, LOG_ERR,
+ QString("MythSystem(%1) command not understood")
+ .arg(command));
+ m_status = GENERIC_EXIT_INVALID_CMDLINE;
+ return;
+ }
+
+ SetCommand(abscommand, args, flags);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.