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=49986=49988

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp

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 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=49986

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp

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 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.

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 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=49459

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 49457.
jriddell added a comment.


  - style fixes whitespace

REPOSITORY
  R299 KDESu

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D10716?vs=49456=49457

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 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=49456

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 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=49454

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 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=49442

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 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
  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 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=49440

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 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
  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 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 energy for this
  >
  > > The testcases would be simpler if it used QTESTDATA and rows for the 
su/sudo and correct/incorrect password cases
  >
  > Something else I need to learn about.
  
  
  Ok, those aren't major issues anyway.
  
  >> By adding a new constructor to SuCommand which allows to specify the full 
path to su/sudo, testing would be much easier. It might be usable outside of 
the tests as well.
  > 
  > I looked at that but I'd be scared of introducing binary incompatiblity.  
This approach covers the current needs.
  
  I don't really like that there's now a config entry only used for and during 
testing, maybe an environment variable would work?
  
  Other than that, this is still missing:
  
  - Autotests need to be conditional based on BUILD_TESTING
  
  It would be nice to have a check for python3 as well, but IMO the message on 
failure should be obvious enough.

INLINE COMMENTS

> jriddell wrote in su:28
> 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 doens't need kdesu_stub 
> to be installed.

Now it doesn't - the comment was referring to the hardcoded path to kdesu_stub, 
which is now gone.

To avoid such misleading comments in the future, you can mark a comment as done 
to prevent it from reappearing out of context.

> suprocess.cpp:122
> +KConfigGroup group(config, "super-user-command");
> +QByteArray defaultPath = QByteArray(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5) + 
> "/kdesu_stub";
> +QString kdesuStubPath = group.readEntry("kdesu_stub_path", 
> QString::fromLatin1(defaultPath));

Use QStringLiteral instead.

> suprocess.h:75
>  private:
> +friend class KdeSuTest;
>  enum SuErrors {

Still necessary?

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 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 doens't need kdesu_stub to 
be installed.

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 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 constructor to SuCommand which allows to specify the full 
path to su/sudo, testing would be much easier. It might be usable outside of 
the tests as well.
  
  I looked at that but I'd be scared of introducing binary incompatiblity.  
This approach covers the current needs.
  
  > The testcases would be simpler if it used QTESTDATA and rows for the 
su/sudo and correct/incorrect password cases
  
  Something else I need to learn about.

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 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 LAST UPDATE
  https://phabricator.kde.org/D10716?vs=49175=49244

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 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 `QStandardPaths::setTestModeEnabled(true);`.
  
  Some more general comments:
  
  - Autotests need to be conditional based on BUILD_TESTING
  - Is it necessary to write the mock su/sudo in python? That introduces a big 
and mostly unnecessary dependency on python.
  - By adding a new constructor to SuCommand which allows to specify the full 
path to su/sudo, testing would be much easier. It might be usable outside of 
the tests as well.
  - The testcases would be simpler if it used QTESTDATA and rows for the 
su/sudo and correct/incorrect password cases

INLINE COMMENTS

> kdesutest.cpp:3
> +#include 
> +#include <../src/suprocess.h>
> +#include 

Try to make `#include "suprocess.h"` work instead.

> kdesutest.cpp:13
> +#define ROOTPASSWORD "ilovekde"
> +#include "config-kdesutest.h"
> +

Should be above the defines.

> kdesutest.cpp:45
> +void sudoBadPassword() {
> +KSharedConfig::Ptr config = KSharedConfig::openConfig();
> +KConfigGroup group(config, "super-user-command");

The config modification should be split into a separate method.

> suprocess.cpp:34
>  
> +#include "../autotests/config-kdesutest.h"
> +

If autotests aren't built, this isn't available. AFAICT it's not necessary 
anyway.

> suprocess.cpp:44
>  QString superUserCommand;
> +bool testMode;
>  };

Not used anymore.

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 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=49175

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 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 SINCE LAST UPDATE
  https://phabricator.kde.org/D10716?vs=49164=49173

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 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 to the build directory is hardcoded in the executable. That 
needs to be avoided to make builds fully reproducible 
(https://reproducible-builds.org/).

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 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=49164

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 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=49163

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su.cmake
  autotests/sudo.cmake
  src/suprocess.cpp
  src/suprocess.h

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 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 won't work anywhere else and requires that the binary is installed when 
running tests.

> sudo:28
> +self.state = State.GOOD
> +call(["/usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu_stub"])
> +exit(0)

Same here.

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-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=49091

BRANCH
  arcpatch-D10716

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/config-kdesutest.h.cmake
  autotests/kdesutest.cpp
  autotests/su
  autotests/sudo
  src/suprocess.cpp
  src/suprocess.h

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 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, #frameworks


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 that is a reliable recreation of how sudo 1.89 / su 4.2 behave, is it 
not?

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-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 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-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=27859

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  .gitignore
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/kdesutest.cpp
  src/suprocess.cpp
  src/suprocess.h

To: jriddell, sitter
Cc: #frameworks, michaelh


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=27858

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  .gitignore
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/kdesutest.cpp
  src/suprocess.cpp
  src/suprocess.h

To: jriddell, sitter
Cc: #frameworks, michaelh


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('us0r', 'PATH/fakesudo').converseSU('passwd')` 
in the given scenarios (password good su, password bad su).

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-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 password
  
  https://bugs.kde.org/show_bug.cgi?id=389049

TEST PLAN
  build and run with sudo and su options, test password and no, test diff 
languages

REPOSITORY
  R299 KDESu

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D10716

AFFECTED FILES
  src/suprocess.cpp

To: jriddell, sitter
Cc: #frameworks, michaelh