File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
contrib/win32/win32compat/ssh-agent Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 29
29
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
30
*/
31
31
#include "agent.h"
32
+ #include <sddl.h>
32
33
#define BUFSIZE 5 * 1024
33
34
34
35
static HANDLE ioc_port = NULL ;
@@ -40,7 +41,8 @@ static BOOL debug_mode = FALSE;
40
41
#define AUTH_AGENT_PIPE_ID L"\\\\.\\pipe\\ssh-authagent"
41
42
42
43
static wchar_t * pipe_ids [NUM_LISTENERS ] = { KEY_AGENT_PIPE_ID , PUBKEY_AGENT_PIPE_ID , AUTH_AGENT_PIPE_ID };
43
- static enum agent_type types [NUM_LISTENERS ] = { KEY_AGENT , PUBKEY_AGENT , PUBKEY_AUTH_AGENT };
44
+ static enum agent_type pipe_types [NUM_LISTENERS ] = { KEY_AGENT , PUBKEY_AGENT , PUBKEY_AUTH_AGENT };
45
+ static wchar_t * pipe_sddls [NUM_LISTENERS ] = { L"D:P(A;; GA;;; AU)" , L"D:P(A;; GA;;; AU)" , L"D:P(A;; GA;;; AU)" };
44
46
HANDLE event_stop_agent ;
45
47
46
48
struct listener {
@@ -61,9 +63,14 @@ init_listeners() {
61
63
return GetLastError ();
62
64
}
63
65
listeners [i ].pipe_id = pipe_ids [i ];
64
- listeners [i ].type = types [i ];
66
+ listeners [i ].type = pipe_types [i ];
65
67
listeners [i ].pipe = INVALID_HANDLE_VALUE ;
66
68
listeners [i ].sa .bInheritHandle = TRUE;
69
+ if (!ConvertStringSecurityDescriptorToSecurityDescriptorW (pipe_sddls [i ], SDDL_REVISION_1 ,
70
+ & listeners [i ].sa .lpSecurityDescriptor , & listeners [i ].sa .nLength )) {
71
+ debug ("cannot convert sddl ERROR:%d" , GetLastError ());
72
+ return GetLastError ();
73
+ }
67
74
}
68
75
69
76
return 0 ;
You can’t perform that action at this time.
0 commit comments