Permalink
Browse files

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

… HTTP auth support
  • Loading branch information...
1 parent 5971a14 commit fff8d233a25a4c0c2850e0f4b89746cffdd7f3c7 @mstepanov mstepanov committed Apr 21, 2011
View
@@ -3,6 +3,7 @@
// Used by sshw.rc
//
#define IDD_DIALOG 101
+#define IDD_DIALOG_ASKPASS 102
#define IDC_PASSWORD 1001
#define IDC_MESSAGE 1002
#define IDC_REMEMBER 1003
@@ -12,7 +13,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 102
+#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_SYMED_VALUE 101
View
@@ -228,6 +228,7 @@ int ask_password(_TCHAR* message)
return 0;
}
} else {
+ int nDialogID = IDD_DIALOG;
::ZeroMemory(szKeyName, sizeof(szKeyName));
_TCHAR *lpszBegin = _tcschr(message, _T('\''));
if( lpszBegin != NULL ) {
@@ -238,18 +239,20 @@ int ask_password(_TCHAR* message)
}
}
::ZeroMemory(szPassword, sizeof(szPassword));
- if( _tcslen(szKeyName) != 0 ) {
- if( LoadPassword(szKeyName) ) {
- _tprintf(_T("%s"), szPassword);
- SavePassword(szKeyName);
- ::SecureZeroMemory(szPassword, sizeof(szPassword));
- return 0;
- } else {
- ClearPassword(szKeyName);
- }
+ if( _tcslen(szKeyName) == 0 ) {
+ _tcscpy_s(szKeyName, sizeof(szKeyName)/sizeof(szKeyName[0]), _T("default"));
+ nDialogID = IDD_DIALOG_ASKPASS;
+ }
+ if( LoadPassword(szKeyName) ) {
+ _tprintf(_T("%s"), szPassword);
+ SavePassword(szKeyName);
+ ::SecureZeroMemory(szPassword, sizeof(szPassword));
+ return 0;
+ } else {
+ ClearPassword(szKeyName);
}
if( ::DialogBoxParam(GetModuleHandle(NULL),
- MAKEINTRESOURCE(IDD_DIALOG),
+ MAKEINTRESOURCE(nDialogID),
NULL,
DialogProc,
(LPARAM)message) ) {
View
@@ -124,6 +124,23 @@ BEGIN
END
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DIALOG_ASKPASS DIALOGEX 0, 0, 274, 86
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "HTTP"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ EDITTEXT IDC_PASSWORD,49,27,218,14,ES_PASSWORD | ES_AUTOHSCROLL
+ DEFPUSHBUTTON "OK",IDOK,78,65,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,145,65,50,14
+ LTEXT "Please provide HTTP authentication password",IDC_STATIC,7,7,260,20
+ CONTROL "Password:",IDC_MESSAGE,"Static",SS_SIMPLE | WS_GROUP,7,30,42,11
+END
+
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
@@ -148,6 +165,32 @@ BEGIN
END
#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_DIALOG_ASKPASS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 267
+ VERTGUIDE, 49
+ VERTGUIDE, 128
+ VERTGUIDE, 145
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 79
+ HORZGUIDE, 27
+ HORZGUIDE, 41
+ HORZGUIDE, 56
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
Binary file not shown.
@@ -303,6 +303,7 @@ Process run(IPath directory, String... arguments) throws IOException, CoreExcept
if (git_ssh != null)
{
env.put("GIT_SSH", git_ssh.toOSString()); //$NON-NLS-1$
+ env.put("GIT_ASKPASS", git_ssh.toOSString()); //$NON-NLS-1$
}
if (!env.isEmpty())
{

0 comments on commit fff8d23

Please sign in to comment.