summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/adminauthorization_x11.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use pkexec to start the headless process used for privileged operationsArttu Tarkiainen2021-04-091-219/+15
| | | | | | Task-number: QTIFW-1794 Change-Id: I3225da785d52f0631b84341a4fe3d3db0fc0a171 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Doc: Remove internal classes and structs from generated documentationArttu Tarkiainen2020-09-211-0/+6
| | | | | | | | | | After migration to using 5.12.7 based qdoc, the generated documentation contains also empty declarations for members of undocumented internal classes. Mark them internal as needed. Task-number: QTIFW-1483 Change-Id: Iad40e4efdd098f09a825ce1c8d0aafcc76bd83bf Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Use of QLoggingCategoryKatja Marttila2020-02-131-1/+3
| | | | | | | | The change enables easier filtering of log messages Change-Id: I769f7c163e20f34c37fa0fe2b0729867ffca5bcb Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Merge remote-tracking branch 'origin/2.0' into 3.0Katja Marttila2017-03-301-0/+1
|\ | | | | | | | | | | | | Conflicts: src/libs/installer/downloadfiletask.cpp Change-Id: Ie4b07c402a63c7a12ecf24e52e197507bbb2c5df
| * QRegExp include cleanupSamuel Gaist2017-03-131-0/+1
| | | | | | | | | | | | | | This patch adds the missing include statements for QRegExp. Change-Id: I05fed3e83514af895b95a3df746b0ae1e6b31828 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/2.0'Katja Marttila2017-01-301-17/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Changelog dist/config/config.xml dist/packages/org.qtproject.ifw.binaries/meta/package.xml dist/packages/org.qtproject.ifw/meta/package.xml installerfw.pri src/libs/installer/lib7z_create.h src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h src/libs/kdtools/localpackagehub.cpp src/libs/kdtools/localpackagehub.h src/libs/kdtools/updatefinder.cpp src/libs/kdtools/updatefinder.h tools/binarycreator/resources/mkdmg.sh Change-Id: Iab2513f549832d2e750e77131c673457ab265af4
| * License header update to GPL-EXCEPTKatja Marttila2017-01-261-17/+12
| | | | | | | | | | Change-Id: I6426c4e8f932cf26c6c638dec18d0c12e22972d1 Reviewed-by: Janne Anttila <janne.anttila@theqtcompany.com>
* | Merge remote-tracking branch 'origin/2.0'Katja Marttila2016-06-211-1/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Changelog dist/config/config.xml dist/packages/org.qtproject.ifw.binaries/meta/package.xml dist/packages/org.qtproject.ifw/meta/package.xml installerfw.pri src/libs/7zip/7zip.pro src/libs/7zip/win/CPP/7zip/UI/Common/Update.cpp src/libs/installer/component.cpp src/libs/installer/lib7z_facade.cpp src/libs/installer/packagemanagercore.cpp src/libs/installer/proxycredentialsdialog.h src/sdk/translations/ja.ts tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp tests/auto/installer/scriptengine/tst_scriptengine.cpp tests/auto/installer/settings/tst_settings.cpp Change-Id: I3bb98b8490b3c3eb7f664c1abb7417155b5430b2
| * Make IFW compile with FreeBSDKatja Marttila2016-04-261-1/+5
| | | | | | | | | | | | | | Change-Id: Ibebc25b738c843c0eb4291faa2bba7ac9836b008 Task-number: QTIFW-841 Reviewed-by: Ralf Nolden <nolden@kde.org> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Fixed detecting problems while launching sudoFrerich Raabe2016-05-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The installer would always consider the exit status of the sudo process, but if executing sudo itself fails (e.g. because the file does not exist, or because of insufficient permissions), a success exit status (zero) was returned. Fix this by rather returning the (negative) errno value in case anything goes wrong with execve. Change-Id: Iac5051e998982c6a31fa49cb6f4290cf66050c44 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Fixed file handle leak when sudo'ingFrerich Raabe2016-03-041-1/+1
| | | | | | | | | | | | | | | | The write handle of the stderr pipe was closed in the parent process further up already. What's left to close is the read handle. Change-Id: I988c5334edb2df002cb29b1f2d47fb34eb284185 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Fixed reading stderr output of sudoFrerich Raabe2016-02-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the sudo process finished, we need to make sure to read any buffered bytes from the stderr pipe. Without this, the stderr data which was shown in the message box often ended up being incomplete. For instance, three failures to enter the correct root password would show a message box saying Sorry, try again. Sorry, try again. Instead of Sorry, try again. Sorry, try again. Sorry, try again. sudo: 3 incorrect password attempts Change-Id: Ib1e7aa40d95f9bf140ba1978fdb9be92cad926b6 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Don't print error messages in case correct sudo password is enteredFrerich Raabe2016-02-191-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Any stderr data printed by 'sudo' was always printed as part of an error message box, even if sudo succeeded. This issue is triggered very easily by entering a wrong root password first, and then the correct password on the second try. Let's just print stderr data in case we have some *and* in case 'sudo' returns a non-zero return code. Change-Id: Icbb2d31cdf5c4d5d20ed4200553e9bf7e2b5bedd Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Fixed checking exit status when calling 'sudo'Frerich Raabe2016-02-191-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a few closely related issues in how the code tried to decide whether running 'sudo' succeeded: The first issue I noticed was that in some cases, the wait() call would fail with ECHILD. What happened was that the waitpid() call noticed that the sudo process terminated and reaped the zombie. Then, the loop was left and wait() was called on the PID again -- at this point, there was no child with that PID anymore though. The user-visible consequence of this was that the authentication was incorrectly considered to have failed, and a "Cannot get authorization" dialog was shown even though the correct root password was entered. No matter whether wait() failed or not, the code would try to use the WIFEXITED() and WEXITSTATUS() macros to interpret the last status. This caused some reading of uninitialized memory (as Valgrind pointed out), since WIFEXITED() may only be called in case wait() succeeded. Furthermore, as wait(2) explains: WEXITSTATUS(status) returns the exit status of the child. [..] This macro should be employed only if WIFEXITED returned true. This patch fixes all these problems by a) not calling wait() again but rather using the status which was fetched by waitpid() and b) only using the W* macros if it's legal to do so (i.e. waitpid() succeeded). Change-Id: I81741898dc686bb2d2128fceb9e71535fab43417 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Fixed out of bounds access when calling su/sudoFrerich Raabe2016-02-151-1/+1
| | | | | | | | | | | | | | | | The memory block allocated for the execv() arguments was too small, causing subsequent code to invoke undefined behavior. Change-Id: Ic0b1e03ddc07e3147ef0d920f18d86276b21e222 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Merge remote-tracking branch 'origin/2.0'Iikka Eklund2016-01-201-4/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: installerfw.pri src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h sync.profile Change-Id: Ifdc8b065f89b7e241bd3788ed79768e21888161f
| * Update license headersIikka Eklund2015-12-291-4/+3
| | | | | | | | | | | | | | | | | | Update existing license headers. LGPL -> LGPLv21. Update copyright year as well. Change-Id: Ie1d71f8c68186b8f625f409ddf94691f178093c9 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* | Fixed reading error output from sudo'ed processFrerich Raabe2015-12-091-1/+1
| | | | | | | | | | | | | | The 'errBuf' buffer was never actually used for anything. Change-Id: Ia28b3ee3308ecff451afb518e0da8cf7125362d4 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Fixed bug in making stderr pipe read-handle non-blockingFrerich Raabe2015-12-091-1/+1
| | | | | | | | | | | | | | Use F_GETFL to set the flags, and S_SETFL to set them. Change-Id: Ia32d020f320e819db5f0976972e38981d22eaa26 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | When running sudo'ed process, make reading from child non-blockingFrerich Raabe2015-12-091-1/+11
| | | | | | | | | | | | | | | | | | | | | | For some reason, using a blocking read would sometimes(!) not cause the sudo process to finish. In fact, it didn't even seem to start running, even though it showed up in the process list. Maybe a deadlock? Using non-blocking reads fixes this. Change-Id: Ic8a94b38e4be426abcc08bbd0dd887a3cffda5d5 Task-number: QTIFW-771 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Removed unused variableFrerich Raabe2015-12-081-1/+0
|/ | | | | | | I see no need to do anything with the file descriptor flags in here. Change-Id: Ib4d8dfd3d18ed90028138b0def7c5da15f434fd7 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Update CopyrightKai Koehne2015-02-181-7/+7
| | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Add LGPLv3 as new licenseKai Koehne2014-10-161-14/+7
| | | | | | | Change-Id: I61158f956894e209dccf83744b4753774676099d Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* Fix AdminAuthorization implementation.kh12014-06-191-24/+10
| | | | | | | | | - execute() does the magic of getting privileges and starting the process - hasAdminRights() simply returns if we started privileged.. Change-Id: I0940a02556fe240af0ee7dfb068f7f8009eb683e Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Remove trailing whitespaceKai Koehne2014-06-191-3/+3
| | | | | | Change-Id: I161e1b5908339a3553c2568afebd27a719ca4cce Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
* Merge remote-tracking branch 'origin/1.5'Oswald Buddenhagen2014-03-271-3/+5
|\ | | | | | | | | | | | | Conflicts: installerfw.pri Change-Id: I8bd85997fef0fcfa21a4dd28a6362748a54a4a3b
| * Fix hang when entering wrong sudo pwNiels Weber2014-03-271-3/+5
| | | | | | | | | | | | | | Task-number: QTIFW-451 Task-number: QTIFW-409 Change-Id: I83ebd338b5f52f2a0b3b1fabcce8fb98afce5e19 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* | Remove some trailing whitespace.Niels Weber2014-03-271-5/+5
|/ | | | | Change-Id: Ia417652a44c99008143f3dc7c94c0853b129fea9 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Fix various minor issues reported by krazy.Niels Weber2013-03-111-1/+1
| | | | | Change-Id: Icf975d0cc546ddc69e35b42a0d4d546e05bfe795 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Add 2013 to the copyright.Niels Weber2013-02-051-1/+1
| | | | | Change-Id: If64730ba7203d1a910a426c0d9c9a738ecfeff4b Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Change copyright headers from Nokia to DigiaSergio Ahumada2012-12-211-18/+27
| | | | | Change-Id: Id55a71a6ee24b234739b6066e11e9c1f2e389f73 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Qt5 compile fix on Unix.kh12012-12-111-6/+17
| | | | | Change-Id: Ib860b9531dd74cf7022b6df77cb35aa8c3f1f0f2 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Linux: compile fixAleksey Sidorov2012-11-191-0/+1
| | | | | Change-Id: I2ea5fb5ed874f2db80c7efc56ba6b753db27e25f Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* After failing admin authorization, allow retrying by handNiels Weber2012-05-241-2/+6
| | | | | | Change-Id: If05f1c6359c2667e0094721540415b5293856370 Reviewed-by: Alexander Lenhardt <alexander.lenhardt@nokia.com> Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
* line length fixingNiels Weber2012-05-211-2/+5
| | | | | Change-Id: I4e625eac370bfa195fdc4e79e4edf9c4caa54792 Reviewed-by: Alexander Lenhardt <alexander.lenhardt@nokia.com>
* Reorganize the tree, have better ifw.pri. Shadow build support.kh12012-03-191-0/+252
Change-Id: I01fb12537f863ed0744979973c7e4153889cc5cb Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>