skip bogus host name validation, the most common error
is a wrong one, not an invalid one
allow full port range, people can setup ssh servers on
any ports
fixes IPv6 addresses as hostnames
BUG: 469474
Using temporaries or non-const containers directly in range-based
loops can cause containers to detach, leading to unnecessary copies.
This commit ensures all range-based loops iterate over named,
const-qualified containers to prevent detachment and improve performance.
When attempting to import SSH configurations, the code previously continued
execution even when the config file could not be opened. This could lead
to undefined behavior or crashes when trying to read from an invalid file
handle.
The fix adds an early return statement when file opening fails, ensuring
proper error handling and preventing potential issues downstream.
This shall fix a minor bug calling hosts that are defined in ~/.ssh/config by their identifier name rather than its HostName.
> Definition:
> "identifier" is called Host in .ssh/config.
Example config in ~/.ssh/config:
> Host core
>
> HostName core.company.com
>
> User sshadmin
You want Konsole to run "ssh core", since calling ssh with a
config identifier makes ssh pull all config from .ssh/config.
Currently Konsole runs "ssh core.company.com" so it takes the hostname
instead of the config identifier.
In the end it does not match any entity in ssh's config and Konsole
would need to establish a correct set of parameters in the call to the
ssh binary.
That error I think is laying in sshmanagerplugin.cpp:205-216
where we need to evolve the if statement.
There was already a merge request for this issue report:
> BUG: https://bugs.kde.org/show_bug.cgi?id=450891
> MR: https://invent.kde.org/utilities/konsole/-/merge_requests/1055
But I think that MR is a bit of a shortcoming and does not take full
advantage of having the ssh binary do its job.
Let me know in case something needs to be aligned with your requirements.
I am new to sw dev and this is my very first patch to a KDE or any cpp/Qt project.
* speeds up incremental builds as changes to a header will not always
need the full mocs_compilation.cpp for all the target's headers rebuild,
while having a moc file sourced into a source file only adds minor
extra costs, due to small own code and the used headers usually
already covered by the source file, being for the same class/struct
* seems to not slow down clean builds, due to empty mocs_compilation.cpp
resulting in those quickly processed, while the minor extra cost of the
sourced moc files does not outweigh that in summary.
Measured times actually improved by some percent points.
(ideally CMake would just skip empty mocs_compilation.cpp & its object
file one day)
* enables compiler to see all methods of a class in same compilation unit
to do some sanity checks
* potentially more inlining in general, due to more in the compilation unit
* allows to keep using more forward declarations in the header, as with the
moc code being sourced into the cpp file there definitions can be ensured
and often are already for the needs of the normal class methods
Qt Designer (accidentally) injected "." file names as fallback when
setting theme icon names, which then results in generated code like:
QIcon icon;
QString iconThemeName = QString::fromUtf8("list-add");
if (QIcon::hasThemeIcon(iconThemeName)) {
icon = QIcon::fromTheme(iconThemeName);
} else {
icon.addFile(QString::fromUtf8("."), QSize(), QIcon::Normal, QIcon::Off);
}
Such a "." file name is not documented to serve any purpose, just results
in failing icon lookup.
This allows to use ssh plugin in Windows by skipping the check
if the running process is shell or not. If the running process
is not a known shell, creating any new ssh connection will fail
without any error message. It is possible to run different shell
under cmd.exe or powershell.exe. So, it is not enough to check
only the child process of conpty's conhost.exe.