Skip to content

Commit 75ef214

Browse files
committed
Re-added storing credential during WebDAV AppleScript mount to prevent asking for credentials
Probably less robust after 59a1240, initially added in caa520f
1 parent 1656cb5 commit 75ef214

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/org/cryptomator/frontend/webdav/mount/MacAppleScriptMounter.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ protected String getContextPath() {
8383

8484
@Override
8585
protected Mount mount(WebDavServerHandle serverHandle, WebDavServletController servlet, URI uri) throws MountFailedException {
86+
try {
87+
// store credentials:
88+
ProcessBuilder storeCredentials = new ProcessBuilder("security", "add-internet-password", //
89+
"-a", "anonymous", //
90+
"-s", "localhost", //
91+
"-P", String.valueOf(uri.getPort()), //
92+
"-r", "http", //
93+
"-D", "Cryptomator WebDAV Access", //
94+
"-T", "/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthSysAgent");
95+
ProcessUtil.startAndWaitFor(storeCredentials, 10, TimeUnit.SECONDS);
96+
} catch (IOException | TimeoutException e) {
97+
LOG.warn("Unable to store credentials for WebDAV access: {}", e.getMessage());
98+
}
8699
try {
87100
// mount:
88101
String mountAppleScript = String.format("mount volume \"%s\"", uri.toASCIIString());

0 commit comments

Comments
 (0)