开发者

How to send argument securely using Process class?

I'm using System.Diagnostics.Process to execute an svn command from a windows console application. This is the configuration of the process:

svn.StartInfo.FileName = svnPath;
svn.StartInfo.Arguments = string.Format("copy {0}/trunk/ {0}/tags/{1} -r head -q --username {3} --password {4} -m \"{2}\"", basePathToRepo, tagName, message, svnUserName, svnPassword);
svn.S开发者_StackOverflow社区tartInfo.UseShellExecute = false;
svn.Start();
svn.WaitForExit();

My problem is that those arguments, which include the svn credentials, are sent (I suppose) in an unsecure way.

Is there a way to send these arguments in a secure way using the Process class?

Thanks!


This is using the standard command line mechanism, which is going to be the same as any other method. There is no "secure" way to send a command line argument to a program, as it's just a standard process.

That being said, this is going to only be accessible locally, since you're running this in the local user's account already. This is just as secure as having the user type this into a Command Prompt window...


send where? they are passed from your code to WinApi. it is in-memory operation, it is secure enough.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜