Commit Graph

3107 Commits (e3c4e755a7e13d4223f8de98a68c8b4af031c013)
 

Author SHA1 Message Date
Alexander Golubev e3c4e755a7
tdeioslave/sftp: make source c++11-compatible
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 0e615e5c90)
12 months ago
Alexander Golubev e41e8b9e6a
tdeioslave/sftp: get rid of goto in openConnection()
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 3a4538b4c3)
12 months ago
Alexander Golubev e55cf59eba
tdeioslave/sftp: use unsigned to store auth method flags/bitsets
The libssh defines those flags as unsigned. Technically ssh_auth_list()
still returns int, but its guranteed to be bitset of those flags.

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 5b9585e429)
12 months ago
Alexander Golubev 11c1ec5047
tdeioslave/sftp: better erros for unsupported auth methods
Also:
- do not translate auth methods names as the names appear in config
  files verbatim
- libssh actually doesn't supports hostbased auth, so exclude it from
  bitset of supported

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 1597d5f384)
12 months ago
Alexander Golubev c1a256a31f
tdeioslave/sftp: better cancelation handling in case of several publickeys
Consider publickey auth canceled only if user canceled it for each of
the prompted keys.

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 4b4b72db8f)
12 months ago
Alexander Golubev ef56a87ffe
tdeioslave/sftp: save/restore seqNr for multi-factor auth
In case the server is set up for multi-factor authentication we could
be have to query several things from the user like password, a key
passphrase, their mother's maiden name etc. It doesn't make a big
difference during an initial connection, but it butchers the
reconnection process: it can retrieve the answer of the user to the
first question (e.g. their password), but it fails to retrieve the
second one (e.g. the key passphrase). So the user would be forced to
reenter the answer for the second question upon each reconnection.

The reason for this is the passwdserver's desig (see DESIGN [1]):
Each query for AuthInfo with the openPassDlg() has an secNr number
associated with it. If it's smaller than the one of the one stored for
the privious request, than the one from the cache will be returned
automagically, if it's bigger the dialog will be prompted to the user.
Each call to openPassDlg() advances s_seqNr to the last value reported
by the passwdserver. So the first call will return the cached value and
subsequent calls will actually display the dialog to the user (assuming
authentication with the cached data failed).

But in case of multi-factor auth we have to query user for several
independent values. And we want to try to retrieve each one of those
from the cache. So we have to get a bit hacky and manually manipulate
the SlaveBase::s_seqNr value.

[1]: https://mirror.git.trinitydesktop.org/gitea/TDE/tdelibs/src/branch/master/tdeio/kpasswdserver/DESIGN

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 95b18e6338)
12 months ago
Alexander Golubev fae96a29fb
tdeioslave/sftp: imbue error messages with errors from libssh
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 4d88b3eddd)
12 months ago
Alexander Golubev a9d6ae553a
tdeioslave/sftp: cache passwords in case they were passed to setHost()
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit ee73349644)
12 months ago
Alexander Golubev 7ae4741709
tdeioslave/sftp: prevent infinite looping in kb-interactive auth
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit f8f0b8815c)
12 months ago
Alexander Golubev 16ad368674
tdeioslave/sftp: purge password in the destructor
This could be useful in case the destructor will be called before
openConnection()

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 21ce69f338)
12 months ago
Alexander Golubev dbd135cce4
tdeioslave/sftp: enable changing user during kb-interactive auth
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 009382772d)
12 months ago
Alexander Golubev 15815002b2
tdeioslave/sftp: pass correct username to openPassDlg()
We should always pass to the openPassDlg() exactly the same username
otherwise it may result in incorrect caching of passwords especially in
case if the username is changed by the user.

Also don't allow username change in case it was passed to setHost()
(i.e. it was specified in the URL like e.g. sftp://username@host/).
In such a case after changing it'd be impossible to properly cache it.

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 581d266ae6)
12 months ago
Alexander Golubev c5ae0c2aa7
tdeioslave/sftp: even bigger authentication overhaul
- Move authentication methods into separate functions so it would be
  easier to correctly handle error after those and select which should
  be called in which order.
- A lot of minor improvements along the way

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 2756ae762f)
12 months ago
Alexander Golubev dbde9a19a0
tdeioslave/sftp: use realmValue to distinguish different prompts
This will help kpasswdserver not to confuse different user's answers to
different questions.

Also avoid passing/returning TDE::AuthInfo for kb-interactive auth as it
isn't really necessary when we don't manually caching passwords anymore.

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit d316ff14bd)
12 months ago
Alexander Golubev c950ace00f
tdeioslave/sftp: avoid explicit password caching
All password caching we need actually already autmagically
done by openPassDlg().

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit a19610bb73)
12 months ago
Alexander Golubev c01b334583
tdeioslave/sftp: use a scope guards to close connection
There were a couple of missing closeConnection() calls after connection
errors. The probably haven't caused any major bugs, but use scope guards
to be on the safe side.

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 9c0a0ce976)
12 months ago
Alexander Golubev e389595606
tdeioslave/sftp: split off connection init to a dedicated function
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 75349be43e)
12 months ago
Alexander Golubev 9a9f857054
tdeioslave/sftp: use free to destroy mCallbacks
As it allocated via malloc() rather than new.

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 688544193f)
12 months ago
Alexander Golubev 39ee836ae4
tdeioslave/sftp: overhaul publickey auth
Several enhancements to public key authentication and some other stuff:
- Fix passphrase entry for encrypted keys (was either hanging up or
  segfaulting)
- Use scope guard idiom for cleanup calls for more reliable cleanup in
  case of errors
- Add normal prompt for public key's passphrase entry dialog
- Correctly differentiate passphrase to password when cached (yes they
  are getting cached regardless of keepPassword, at least for some
  duration of time)
- Centrilize AuthInfo initialization and some rejig of it
  kbd-interactive authentification

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit b91e220389)
12 months ago
Alexander Golubev 2d6f4a3312
tdeioslave/sftp: fix keyboard-interactive authentication
This is a partial fix to the sftp ioslave. Subsequent commits will fix
other issues.

Closes: https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/issues/443
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit a1fa8a79bb)
12 months ago
Alexander Golubev bbd9f2102e
kcontrol/smserver: rephrase fadeaway description
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit a646f58853)
12 months ago
Alexander Golubev 40879a72e3
kxkb: utilize a translations provseided by xkeyboard-config
xkeyboard-config package comes with a message catalogue of its own to
translate locale, keyboard model and xkb option names. It would be
easier and more robust to utilize it instead of redoing all
translation in-house.

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 18a8b8d435)
12 months ago
Alexander Golubev e56c1ff3b8
kxkb: add missing connect
Overvise apply button on the dialog won't be enablen when the option is
changed

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 1fea8982fd)
12 months ago
Alexander Golubev bfb0fce6a0
cmake: use pkg_get_variable() to query pkg-config variables
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 0713c2b1c8)
12 months ago
Alexander Golubev 6b4ac1995d
kcontrol/input: fix incorrect statements whatsthis + some rewording
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit bf3ffaced3)
12 months ago
TDE Gitea 56037f88f2 Merge translation files from master branch. 12 months ago
TDE Gitea 26d58ece1f Merge translation files from master branch. 12 months ago
Denis Kozadaev 8db3aae91c
kcontrol-info-memory: use 64 bits variable to store memory size
Signed-off-by: Denis Kozadaev <denis@dilos.org>
(cherry picked from commit 220dec20f9)
12 months ago
Michele Calgaro 10639b722f
Simplify code since cmake minimum version is now 3.5
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit dc9ec2711b)
1 year ago
Michele Calgaro b2fcd6f201
Replace Q_WS_* defines with TQ_WS_* equivalents
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 2d7d2122cf)
1 year ago
TDE Gitea 2878e48349 Reset submodule main/core/tdebase/admin to latest HEAD 1 year ago
Alexander Golubev cfbf60a0c7
kxkb: handle resetOld correctly in cases if all opions already set
Closes: https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/issues/391

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit d0c145d5a3)
1 year ago
Michele Calgaro 28b6fb9bca
Replace Q_SIGNALS and Q_SLOTS
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 0d9263f836)
1 year ago
Michele Calgaro 71079cacc2
Replace auto_ptr
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 4484e51ca6)
1 year ago
Michele Calgaro 1c65be77cd
Use new TQ_METHOD, TQ_SIGNAL, TQ_SLOT defines
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit a4241b7911)
1 year ago
TDE Gitea 55ba7bff2c Merge translation files from master branch. 1 year ago
TDE Gitea 75aeb0d5c5 Merge translation files from master branch. 1 year ago
TDE Gitea 01b434f77e Reset submodule main/core/tdebase/admin to latest HEAD 1 year ago
Michele Calgaro 0e5ef873f0
Replace various '#define' strings - part 6
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit c4a6487c82)
1 year ago
Mavridis Philippe dcda00127e
KXkb: add keyboard layout notification
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
(cherry picked from commit 7c724a4921)
1 year ago
Mavridis Philippe 94cec968a8
Kxkb: move LayoutUnit struct into its own file and add getLayoutName function
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
(cherry picked from commit 9647d4c7ff)
1 year ago
Alexander Golubev c55cad68e9
Make dependency upon libssh optional
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit f2dbf5b903)
1 year ago
Mavridis Philippe 6c06794072
TWin: Add DCOP method showWindowMenu(wid) for default menu position
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
(cherry picked from commit ecd60bc6a5)
1 year ago
Mavridis Philippe 8447a9a65c
TWin showWindowMenu: add support for negative coordinates
Negative coordinates change the popup menu origins:
* Negative X: origin is right edge instead of left;
* Negative Y: origin is bottom edge instead of top.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
(cherry picked from commit 6b30fb0791)
1 year ago
Mavridis Philippe e67f30eb1f
twin: fix showWindowMenuAt(...) DCOP call
Before it only called slotWindowOperations(), which showed the operations menu of the current window at a preset position, ignoring all arguments passed to showWindowMenuAt.

This commit implpements the correct behaviour of the function which takes all arguments into account.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
(cherry picked from commit 6c0d9ec42e)
1 year ago
TDE Gitea fa7aa947c8 Merge translation files from master branch. 1 year ago
Michele Calgaro 9c73915ca7
twin: use separate bit to inhibit configure request messages. This resolves issue #434.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit f5bdd235fc)
1 year ago
TDE Gitea 8085991939 Merge translation files from master branch. 1 year ago
TDE Gitea f91c73bf1d Merge translation files from master branch. 1 year ago
Michele Calgaro 3f84b83e22
Replaced various '#define' with actual strings - part 5
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 1390bece9a)
1 year ago