diff options
| author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2023-05-11 12:39:01 +0300 |
|---|---|---|
| committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2023-05-22 13:53:32 +0000 |
| commit | 8d72fb0c76db430488066b579fe787caf3889895 (patch) | |
| tree | d07442a6716f8001bc4bc4fbe1c44a307cebee82 /doc/scripting-api | |
| parent | 2c12d1ce130be0e86dea7576d6d7841938695e11 (diff) | |
Fix admin rights handling during installer/updater/uninstaller runs
The installer.gainAdminRights() and installer.dropAdminRights() methods
are invokable from the scripting API. During installing, updating or
uninstalling components, installer does it's own decision making to
request and drop admin rights on-demand, but this could be overridden
with the aforementioned methods.
This was not taken into account, instead it was only checked if admin
rights were gained in the context of the calling method. Fix by
checking if the admin rights were present at the start of the installer,
or if they were requested by anyone during installation.
Task-number: QTIFW-2929
Change-Id: Ie4f6fc0ac746183b00f460a2e60c57c2eae9808c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'doc/scripting-api')
| -rw-r--r-- | doc/scripting-api/packagemanagercore.qdoc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/scripting-api/packagemanagercore.qdoc b/doc/scripting-api/packagemanagercore.qdoc index c00259c25..377e54842 100644 --- a/doc/scripting-api/packagemanagercore.qdoc +++ b/doc/scripting-api/packagemanagercore.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2022 The Qt Company Ltd. +** Copyright (C) 2023 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -615,6 +615,18 @@ */ /*! + \qmlmethod bool installer::hasAdminRights() + + Returns \c true if the installer has admin rights. For example, if the installer + was started with a root account, or the internal admin rights elevation is active. + + Returns \c false otherwise. + + \sa gainAdminRights() + \sa dropAdminRights() +*/ + +/*! \qmlmethod boolean installer::isProcessRunning(string name) Returns \c true if a process with \a name is running. On Windows, the comparison |
