You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@apache.org> on 2018/03/17 22:30:00 UTC

[jira] [Commented] (SCM-763) Password masking on linux does not work

    [ https://issues.apache.org/jira/browse/SCM-763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16403773#comment-16403773 ] 

Michael Osipov commented on SCM-763:
------------------------------------

[~wbustraan], your improved version does not work:

{code:java}
public static void main(String[] args) {

	Commandline cl = new Commandline(new CmdShell());
	cl.setExecutable("svn");
	cl.createArg().setValue("--password");
	cl.createArg().setValue("mumu");
	System.out.println(cl);
	String clString = cl.toString();
	final String mask = "'******'";

	final Matcher matcher = Pattern.compile("(--password\\S*?\\s+)('[^']+?'|\"[^\"]+?\"|\\S+)")
			.matcher(clString);

	final StringBuffer replaced = new StringBuffer();
	while (matcher.find()) {
		final String argPrefix = matcher.group(1);
		matcher.appendReplacement(replaced, argPrefix + mask);
	}
	matcher.appendTail(replaced);

	System.out.println(replaced.toString());

}
{code}

{noformat}
cmd.exe /X /C "svn --password mumu"
cmd.exe /X /C "svn --password '******'
{noformat}

> Password masking on linux does not work
> ---------------------------------------
>
>                 Key: SCM-763
>                 URL: https://issues.apache.org/jira/browse/SCM-763
>             Project: Maven SCM
>          Issue Type: Bug
>          Components: maven-scm-provider-svn
>    Affects Versions: 1.9
>         Environment: Jenkins 1.502 on a SLES11
>            Reporter: Tobias Kalmes
>            Priority: Major
>
> Passwords are not masked in the log output on Linux machines. The masking works as intended on Windows machines. On linux machines tho the password is printed in clear text. This seems to be a problem due to the additional single quotes that are added around the parameters on linux machines.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)