Skip to content
This repository
Browse code

[2193-git-operations-stall-for-repositories-with-https-transport] add…

… HTTP auth support
  • Loading branch information...
commit fff8d233a25a4c0c2850e0f4b89746cffdd7f3c7 1 parent 5971a14
Max Stepanov authored April 20, 2011
3  native/sshw/resource.h
@@ -3,6 +3,7 @@
3 3
 // Used by sshw.rc
4 4
 //
5 5
 #define IDD_DIALOG                      101
  6
+#define IDD_DIALOG_ASKPASS              102
6 7
 #define IDC_PASSWORD                    1001
7 8
 #define IDC_MESSAGE                     1002
8 9
 #define IDC_REMEMBER                    1003
@@ -12,7 +13,7 @@
12 13
 #ifdef APSTUDIO_INVOKED
13 14
 #ifndef APSTUDIO_READONLY_SYMBOLS
14 15
 #define _APS_NO_MFC                     1
15  
-#define _APS_NEXT_RESOURCE_VALUE        102
  16
+#define _APS_NEXT_RESOURCE_VALUE        103
16 17
 #define _APS_NEXT_COMMAND_VALUE         40001
17 18
 #define _APS_NEXT_CONTROL_VALUE         1004
18 19
 #define _APS_NEXT_SYMED_VALUE           101
23  native/sshw/sshw.cpp
@@ -228,6 +228,7 @@ int ask_password(_TCHAR* message)
228 228
 			return 0;
229 229
 		}
230 230
 	} else {
  231
+		int nDialogID = IDD_DIALOG;
231 232
 		::ZeroMemory(szKeyName, sizeof(szKeyName));
232 233
 		_TCHAR *lpszBegin = _tcschr(message, _T('\''));
233 234
 		if( lpszBegin != NULL ) {
@@ -238,18 +239,20 @@ int ask_password(_TCHAR* message)
238 239
 			}
239 240
 		}
240 241
 		::ZeroMemory(szPassword, sizeof(szPassword));
241  
-		if( _tcslen(szKeyName) != 0 ) {
242  
-			if( LoadPassword(szKeyName) ) {
243  
-				_tprintf(_T("%s"), szPassword);
244  
-				SavePassword(szKeyName);
245  
-				::SecureZeroMemory(szPassword, sizeof(szPassword));
246  
-				return 0;
247  
-			} else {
248  
-				ClearPassword(szKeyName);
249  
-			}
  242
+		if( _tcslen(szKeyName) == 0 ) {
  243
+			_tcscpy_s(szKeyName, sizeof(szKeyName)/sizeof(szKeyName[0]), _T("default"));
  244
+			nDialogID = IDD_DIALOG_ASKPASS;
  245
+		}
  246
+		if( LoadPassword(szKeyName) ) {
  247
+			_tprintf(_T("%s"), szPassword);
  248
+			SavePassword(szKeyName);
  249
+			::SecureZeroMemory(szPassword, sizeof(szPassword));
  250
+			return 0;
  251
+		} else {
  252
+			ClearPassword(szKeyName);
250 253
 		}
251 254
 		if( ::DialogBoxParam(GetModuleHandle(NULL),
252  
-			MAKEINTRESOURCE(IDD_DIALOG),
  255
+			MAKEINTRESOURCE(nDialogID),
253 256
 			NULL,
254 257
 			DialogProc,
255 258
 			(LPARAM)message) ) {
43  native/sshw/sshw.rc
@@ -126,6 +126,23 @@ END
126 126
 
127 127
 /////////////////////////////////////////////////////////////////////////////
128 128
 //
  129
+// Dialog
  130
+//
  131
+
  132
+IDD_DIALOG_ASKPASS DIALOGEX 0, 0, 274, 86
  133
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
  134
+CAPTION "HTTP"
  135
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
  136
+BEGIN
  137
+    EDITTEXT        IDC_PASSWORD,49,27,218,14,ES_PASSWORD | ES_AUTOHSCROLL
  138
+    DEFPUSHBUTTON   "OK",IDOK,78,65,50,14
  139
+    PUSHBUTTON      "Cancel",IDCANCEL,145,65,50,14
  140
+    LTEXT           "Please provide HTTP authentication password",IDC_STATIC,7,7,260,20
  141
+    CONTROL         "Password:",IDC_MESSAGE,"Static",SS_SIMPLE | WS_GROUP,7,30,42,11
  142
+END
  143
+
  144
+/////////////////////////////////////////////////////////////////////////////
  145
+//
129 146
 // DESIGNINFO
130 147
 //
131 148
 
@@ -148,6 +165,32 @@ BEGIN
148 165
 END
149 166
 #endif    // APSTUDIO_INVOKED
150 167
 
  168
+
  169
+/////////////////////////////////////////////////////////////////////////////
  170
+//
  171
+// DESIGNINFO
  172
+//
  173
+
  174
+#ifdef APSTUDIO_INVOKED
  175
+GUIDELINES DESIGNINFO 
  176
+BEGIN
  177
+    IDD_DIALOG_ASKPASS, DIALOG
  178
+    BEGIN
  179
+        LEFTMARGIN, 7
  180
+        RIGHTMARGIN, 267
  181
+        VERTGUIDE, 49
  182
+        VERTGUIDE, 128
  183
+        VERTGUIDE, 145
  184
+        TOPMARGIN, 7
  185
+        BOTTOMMARGIN, 79
  186
+        HORZGUIDE, 27
  187
+        HORZGUIDE, 41
  188
+        HORZGUIDE, 56
  189
+    END
  190
+END
  191
+#endif    // APSTUDIO_INVOKED
  192
+
  193
+
151 194
 #endif    // English (U.S.) resources
152 195
 /////////////////////////////////////////////////////////////////////////////
153 196
 
BIN  plugins/com.aptana.git.core/os/win32/sshw.exe
Binary file not shown
1  plugins/com.aptana.git.core/src/com/aptana/git/core/model/GitExecutable.java
@@ -303,6 +303,7 @@ Process run(IPath directory, String... arguments) throws IOException, CoreExcept
303 303
 		if (git_ssh != null)
304 304
 		{
305 305
 			env.put("GIT_SSH", git_ssh.toOSString()); //$NON-NLS-1$
  306
+			env.put("GIT_ASKPASS", git_ssh.toOSString()); //$NON-NLS-1$
306 307
 		}
307 308
 		if (!env.isEmpty())
308 309
 		{

0 notes on commit fff8d23

Please sign in to comment.
Something went wrong with that request. Please try again.