D10716: handle wrong password when using sudo which asks for another password

2019-01-21 Thread Jonathan Riddell
This revision was automatically updated to reflect the committed changes. Closed by commit R299:2e8ce30c9498: handle wrong password when using sudo which asks for another password (authored by jriddell). REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49

D10716: handle wrong password when using sudo which asks for another password

2019-01-21 Thread Fabian Vogt
fvogt accepted this revision. This revision is now accepted and ready to land. REPOSITORY R299 KDESu BRANCH arcpatch-D10716 REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter, fvogt Cc: starbuck, fvogt, kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2019-01-21 Thread Jonathan Riddell
jriddell updated this revision to Diff 49986. jriddell added a comment. Don't use friend class REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49459&id=49986 BRANCH arcpatch-D10716 REVISION DETAIL https://phabricator.kde.org/D10716 AFFECTED FIL

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Fabian Vogt
fvogt added inline comments. INLINE COMMENTS > fvogt wrote in suprocess.h:75 > Just use 0 instead - the enum isn't meant for that apparently. This is still there, so not done yet. The enum SuErrors is (apparently) not meant to be used by callers of exec as they have different accessibility. RE

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Jonathan Riddell
jriddell marked an inline comment as done. REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter, fvogt Cc: starbuck, fvogt, kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Jonathan Riddell
jriddell marked 3 inline comments as done. REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter, fvogt Cc: starbuck, fvogt, kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Fabian Vogt
fvogt requested changes to this revision. This revision now requires changes to proceed. REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter, fvogt Cc: starbuck, fvogt, kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Jonathan Riddell
jriddell updated this revision to Diff 49459. jriddell added a comment. - make test lgpl, link configcore instead of service REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49457&id=49459 BRANCH arcpatch-D10716 REVISION DETAIL https://phabricato

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Jonathan Riddell
jriddell updated this revision to Diff 49457. jriddell added a comment. - style fixes whitespace REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49456&id=49457 BRANCH arcpatch-D10716 REVISION DETAIL https://phabricator.kde.org/D10716 AFFECTED F

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Jonathan Riddell
jriddell updated this revision to Diff 49456. jriddell added a comment. - make string const, follow normal code style of pointer * being with variable name not the type REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49454&id=49456 BRANCH arcpatch

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Harald Sitter
sitter accepted this revision. sitter added a comment. lgtm REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter, fvogt Cc: starbuck, fvogt, kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Jonathan Riddell
jriddell updated this revision to Diff 49454. jriddell added a comment. - revert enum, make strings const, add licence header REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49442&id=49454 BRANCH arcpatch-D10716 REVISION DETAIL https://phabricat

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Nathaniel Graham
ngraham added a subscriber: starbuck. REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter, fvogt Cc: starbuck, fvogt, kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Jonathan Riddell
jriddell updated this revision to Diff 49442. jriddell marked 2 inline comments as done. jriddell added a comment. - Just use 0 instead - the enum isnt meant for that apparently. REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49440&id=49442 BRANCH

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Jonathan Riddell
jriddell marked an inline comment as done. REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter, fvogt Cc: fvogt, kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Fabian Vogt
fvogt added inline comments. INLINE COMMENTS > jriddell wrote in suprocess.h:75 > yes > autotests/kdesutest.cpp:40:45: error: ‘KDESu::SuProcess::SuErrors ok’ is > private within this context Just use 0 instead - the enum isn't meant for that apparently. REPOSITORY R299 KDESu REVISION DETAIL

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Jonathan Riddell
jriddell updated this revision to Diff 49440. jriddell added a comment. - only build tests if BUILD_TESTING is set - use QStringLiteral REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49244&id=49440 BRANCH arcpatch-D10716 REVISION DETAIL https

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Jonathan Riddell
jriddell marked an inline comment as done. jriddell added inline comments. INLINE COMMENTS > fvogt wrote in suprocess.h:75 > Still necessary? yes autotests/kdesutest.cpp:40:45: error: ‘KDESu::SuProcess::SuErrors ok’ is private within this context REPOSITORY R299 KDESu REVISION DETAIL http

D10716: handle wrong password when using sudo which asks for another password

2019-01-14 Thread Harald Sitter
sitter added a comment. BUILD_TESTING easy fix: https://phabricator.kde.org/source/knotifyconfig/browse/master/CMakeLists.txt$60 REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter, fvogt Cc: fvogt, kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2019-01-11 Thread Fabian Vogt
fvogt added a comment. In D10716#391331 , @jriddell wrote: > > Is it necessary to write the mock su/sudo in python? That introduces a big and mostly unnecessary dependency on python. > > Nope but that's what was easiest for me and I'm out of

D10716: handle wrong password when using sudo which asks for another password

2019-01-11 Thread Jonathan Riddell
jriddell added inline comments. INLINE COMMENTS > fvogt wrote in su:28 > That won't work anywhere else and requires that the binary is installed when > running tests. Not sure what you mean by won't work anywhere else, it'll work using the kdesu_stub which is built by the local compile. It do

D10716: handle wrong password when using sudo which asks for another password

2019-01-11 Thread Jonathan Riddell
jriddell marked 3 inline comments as done. REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter, fvogt Cc: fvogt, kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2019-01-11 Thread Jonathan Riddell
jriddell marked an inline comment as done. jriddell added a comment. > Is it necessary to write the mock su/sudo in python? That introduces a big and mostly unnecessary dependency on python. Nope but that's what was easiest for me and I'm out of energy for this > By adding a new cons

D10716: handle wrong password when using sudo which asks for another password

2019-01-11 Thread Jonathan Riddell
jriddell updated this revision to Diff 49244. jriddell added a comment. - remove unused variable - remove unused include - use QStandardPaths::setTestModeEnabled - tidy up includes and defines - refactor out config setting to remove duplication REPOSITORY R299 KDESu CHANGES SINCE LA

D10716: handle wrong password when using sudo which asks for another password

2019-01-10 Thread Shubham
shubham edited the summary of this revision. REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter, fvogt Cc: fvogt, kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2019-01-10 Thread Fabian Vogt
fvogt requested changes to this revision. fvogt added a comment. This revision now requires changes to proceed. In D10716#390699 , @jriddell wrote: > - set XDG_CONFIG_HOME to put kdesutestrc not in running users config dir What you want is

D10716: handle wrong password when using sudo which asks for another password

2019-01-10 Thread Jonathan Riddell
jriddell updated this revision to Diff 49175. jriddell added a comment. - set XDG_CONFIG_HOME to put kdesutestrc not in running users config dir REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49173&id=49175 BRANCH arcpatch-D10716 REVISION DETAIL

D10716: handle wrong password when using sudo which asks for another password

2019-01-10 Thread Jonathan Riddell
jriddell updated this revision to Diff 49173. jriddell added a comment. - write out path to kdesu_stub and su command from the tests to a config rather than setting it within the suprocess class, allows for other testing possibilities and binary relateability REPOSITORY R299 KDESu CHANGES

D10716: handle wrong password when using sudo which asks for another password

2019-01-10 Thread Fabian Vogt
fvogt requested changes to this revision. fvogt added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > suprocess.cpp:124 > +if (d->testMode) { > +args += QByteArray(CMAKE_RUNTIME_OUTPUT_DIRECTORY) + "/kdesu_stub"; > +} else { This means the path t

D10716: handle wrong password when using sudo which asks for another password

2019-01-10 Thread Jonathan Riddell
jriddell updated this revision to Diff 49164. jriddell added a comment. - in stub su and sudo use passed argument to find kdesu_stub and in suprocess pass local kdesu_stub for test mode REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49163&id=49164

D10716: handle wrong password when using sudo which asks for another password

2019-01-10 Thread Jonathan Riddell
jriddell updated this revision to Diff 49163. jriddell added a comment. - use locally built kdesu_stub REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=49091&id=49163 BRANCH arcpatch-D10716 REVISION DETAIL https://phabricator.kde.org/D10716 AFFE

D10716: handle wrong password when using sudo which asks for another password

2019-01-10 Thread Fabian Vogt
fvogt requested changes to this revision. fvogt added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > su:28 > +self.state = State.GOOD > +call(["/usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu_stub"]) > +exit(0) That w

D10716: handle wrong password when using sudo which asks for another password

2019-01-09 Thread Jonathan Riddell
jriddell updated this revision to Diff 49091. jriddell added a comment. - add a stub sudo for testing REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=27859&id=49091 BRANCH arcpatch-D10716 REVISION DETAIL https://phabricator.kde.org/D10716 AFFEC

D10716: handle wrong password when using sudo which asks for another password

2018-06-19 Thread Harald Sitter
sitter requested changes to this revision. This revision now requires changes to proceed. REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter Cc: kde-frameworks-devel, michaelh, ngraham, bruns

D10716: handle wrong password when using sudo which asks for another password

2018-06-19 Thread Harald Sitter
sitter added a comment. Restricted Application edited subscribers, added: kde-frameworks-devel; removed: Frameworks. ping ping ping REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter Cc: kde-frameworks-devel, michaelh, ngraham, bruns, #framewor

D10716: handle wrong password when using sudo which asks for another password

2018-03-05 Thread Harald Sitter
sitter added a comment. Ping REPOSITORY R299 KDESu REVISION DETAIL https://phabricator.kde.org/D10716 To: jriddell, sitter Cc: #frameworks, michaelh

D10716: handle wrong password when using sudo which asks for another password

2018-02-26 Thread Harald Sitter
sitter added a comment. In D10716#212174 , @jriddell wrote: > I fear that creating a stub replacement wouldn't be necessarily a reliable recreation. I am not sure what you mean. If you create a stub from what you observe right now then t

D10716: handle wrong password when using sudo which asks for another password

2018-02-23 Thread Jonathan Riddell
jriddell added a comment. Add test. This uses the real sudo and su on your system, I fear that creating a stub replacement wouldn't be necessarily a reliable recreation. It does mean adding your own password.h with #defines for your user and root password REPOSITORY R299 KDESu REVISION

D10716: handle wrong password when using sudo which asks for another password

2018-02-23 Thread Jonathan Riddell
jriddell updated this revision to Diff 27859. jriddell added a comment. - remove debugging REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=27858&id=27859 BRANCH master REVISION DETAIL https://phabricator.kde.org/D10716 AFFECTED FILES .gitigno

D10716: handle wrong password when using sudo which asks for another password

2018-02-23 Thread Jonathan Riddell
jriddell updated this revision to Diff 27858. jriddell added a comment. - add test - allow passwords to be separate - remove debugging REPOSITORY R299 KDESu CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10716?vs=27691&id=27858 BRANCH master REVISION DETAIL https://phabr

D10716: handle wrong password when using sudo which asks for another password

2018-02-21 Thread Harald Sitter
sitter added a comment. As mentioned on IRC I think this would benefit greatly from some unit testing as that line check is dangerously close to requiring mental gymnastics to read. AT a glance, all that's needed is writing stub sudo/su helpers and a test asserting outcome of `SuProcess('us0

D10716: handle wrong password when using sudo which asks for another password

2018-02-21 Thread Jonathan Riddell
jriddell created this revision. jriddell added a reviewer: sitter. Restricted Application added a project: Frameworks. Restricted Application added a subscriber: Frameworks. jriddell requested review of this revision. REVISION SUMMARY handle wrong password when using sudo which asks for another