controller: strip '.local' from computer name generated key comment

This commit is contained in:
Hylke Bons 2012-06-03 11:47:03 +01:00
parent 9b2089982c
commit 18fae13330

View file

@ -776,9 +776,14 @@ namespace SparkleShare {
process.StartInfo.FileName = "ssh-keygen";
process.StartInfo.CreateNoWindow = true;
string computer_name = System.Net.Dns.GetHostName ();
if (computer_name.EndsWith (".local"))
computer_name = computer_name.Replace (".local", "");
process.StartInfo.Arguments = "-t rsa " + // crypto type
"-P \"\" " + // password (none)
"-C \"" + System.Net.Dns.GetHostName () + "\" " + // key comment
"-C \"" + computer_name + "\" " + // key comment
"-f " + key_file_name; // file name
process.Start ();