Skip to content

Commit 7c5f2a7

Browse files
mhduiydeepin-bot[bot]
authored andcommitted
fix: remove DSG_APP_ID from notification action
When starting a child process, do not inherit the DSG_APP-ID environment variable to prevent direct modification of dde shell configuration by the child process pms: BUG-315007
1 parent c8de151 commit 7c5f2a7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

panels/notification/server/notificationmanager.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,14 @@ void NotificationManager::doActionInvoked(const NotifyEntity &entity, const QStr
509509
QStringList args = i.value().toString().split(",");
510510
if (!args.isEmpty()) {
511511
QString cmd = args.takeFirst(); // 命令
512-
QProcess::startDetached(cmd, args); //执行相关命令
512+
513+
QProcess pro;
514+
pro.setProgram(cmd);
515+
pro.setArguments(args);
516+
QProcessEnvironment proEnv = QProcessEnvironment::systemEnvironment();
517+
proEnv.remove("DSG_APP_ID");
518+
pro.setProcessEnvironment(proEnv);
519+
pro.startDetached();
513520
}
514521
} else if (i.key() == "deepin-dde-shell-action-" + actionId) {
515522
const QString data(i.value().toString());

0 commit comments

Comments
 (0)