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 2929 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030 */
3131#include "agent.h"
32+ #include <sddl.h>
3233#define BUFSIZE 5 * 1024
3334
3435static HANDLE ioc_port = NULL ;
@@ -40,7 +41,8 @@ static BOOL debug_mode = FALSE;
4041#define AUTH_AGENT_PIPE_ID L"\\\\.\\pipe\\ssh-authagent"
4142
4243static 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)" };
4446HANDLE event_stop_agent ;
4547
4648struct listener {
@@ -61,9 +63,14 @@ init_listeners() {
6163 return GetLastError ();
6264 }
6365 listeners [i ].pipe_id = pipe_ids [i ];
64- listeners [i ].type = types [i ];
66+ listeners [i ].type = pipe_types [i ];
6567 listeners [i ].pipe = INVALID_HANDLE_VALUE ;
6668 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+ }
6774 }
6875
6976 return 0 ;
You can’t perform that action at this time.
0 commit comments