Skip to content

Commit

Permalink
Merge pull request #9 from eatkins/security-level
Browse files Browse the repository at this point in the history
Use correct security level in jni implementation
  • Loading branch information
eed3si9n authored Jun 20, 2020
2 parents 6635140 + df8cff4 commit 9a4194b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
GetLastError()); \
} while (0);

#define LOGON_DACL 2 // must match the value in Win32SecurityLevel.java

static int createSecurityWithDacl(PSECURITY_ATTRIBUTES pSA, DWORD accessMask,
BOOL logon);

Expand All @@ -49,7 +51,7 @@ Java_org_scalasbt_ipcsocket_JNIWin32NamedPipeLibraryProvider_CreateNamedPipeNati
sizeof(SECURITY_ATTRIBUTES))
: NULL;
int err = security ? createSecurityWithDacl(pSA, lpSecurityAttributes,
security == 1)
security == LOGON_DACL)
: 0;
if (!err || !security) {
LPCWSTR name = (LPCWSTR)(*env)->GetStringChars(env, lpName, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ public class Win32SecurityLevel {
*/
public static int NO_SECURITY = 0;
public static int OWNER_DACL = 1;
// LOGON_DACL must match the value in JNIWin32NamedPipeLibraryProvider.c
public static int LOGON_DACL = 2;
}
Binary file modified src/main/resources/win32/x86_64/sbtipcsocket.dll
Binary file not shown.

0 comments on commit 9a4194b

Please sign in to comment.