Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
Java:packages
apache-sshd
password-no-echo.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File password-no-echo.patch of Package apache-sshd
--- apache-sshd-2.12.0/sshd-cli/src/main/java/org/apache/sshd/cli/client/SshClientCliSupport.java 2024-10-17 09:52:06.441674383 +0200 +++ apache-sshd-2.12.0/sshd-cli/src/main/java/org/apache/sshd/cli/client/SshClientCliSupport.java 2024-10-17 11:13:10.836164379 +0200 @@ -19,6 +19,7 @@ package org.apache.sshd.cli.client; import java.io.BufferedReader; +import java.io.Console; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; @@ -492,6 +493,11 @@ throws Throwable { client.setFilePasswordProvider((session, file, index) -> { stdout.print("Enter password for private key file=" + file + ": "); + + Console cons = System.console(); + if (cons != null) { + return new String(cons.readPassword()); + } return stdin.readLine(); }); @@ -552,6 +558,10 @@ public String getUpdatedPassword(ClientSession clientSession, String prompt, String lang) { stdout.append(prompt).print(" "); try { + Console cons = System.console(); + if (cons != null) { + return new String(cons.readPassword()); + } return stdin.readLine(); } catch (IOException e) { stderr.append("WARNING: ").append(e.getClass().getSimpleName())
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor