xcreds icon indicating copy to clipboard operation
xcreds copied to clipboard

[Bug] Share locations with spaces in them do not mount

Open bamtan opened this issue 1 year ago • 1 comments

Using build 6375, local AD.

I've got some Shared locations with spaces in them that do not mount. E.g.

smb://contoso.com/UserFolders/<<shortname>>/My Documents

I think it tries to mount My which doesn't exist and fails.

Shares without spaces mount (and works with <<shortname>> variable substitutions from NoMAD-Shares - awesome :) ).

bamtan avatar Feb 27 '24 02:02 bamtan

Could this function sanitize the spaces into %20? I don't have a developer account to test.

https://github.com/twocanoes/xcreds/blob/f1a2e7217811677734ad94c9cf692fb10a262fe2/Extensions.swift#L41-L44 https://github.com/twocanoes/xcreds/blob/develop/ShareMounterMenu.swift

bamtan avatar Apr 17 '24 07:04 bamtan

I could not replicate. I created a shared called "My Shared Folder" and put it as share to be mounted. log at ~/Library/Logs/xxcreds.log showed:

2024-06-12T21:00:11-07:00 XCreds(716): ShareMounter.swift:278 mountShares() Evaluating mount: server22 files 2024-06-12T21:00:11-07:00 XCreds(716): ShareMounter.swift:343 mountShares() Attempting to mount: smb://server22.twocanoes.com/My%20Shared%20Folder 2024-06-12T21:00:12-07:00 XCreds(716): ShareMounter.swift:372 mountShares() Request ID: 0x0000600003be92f0 2024-06-12T21:00:12-07:00 XCreds(716): ShareMounter.swift:376 mountShares() Mounted share: server22 files

Plist looked like this:

		<key>Shares</key>
		<array>
			<dict>
				<key>Groups</key>
				<array>
				</array>
				<key>ConnectedOnly</key>
				<true/>
				<key>Options</key>
				<array/>
				<key>LocalMount</key>
				<string></string>
				<key>AutoMount</key>
				<true/>
				<key>Name</key>
				<string>server22 files</string>
				<key>URL</key>
				<string>smb://server22.twocanoes.com/My Shared Folder</string>
			</dict>
            <dict>

twocanoes avatar Jun 13 '24 04:06 twocanoes

hey @twocanoes, what build number was this tested against? i'll try and get logs

bamtan avatar Jun 13 '24 04:06 bamtan

From my ~/Library/Logs/xcreds.log 2024-06-13T13:42:14+08:00 XCreds(43053): ShareMounterMenu.swift:127 openShareFromMenu(_:) Mounting share: smb://contoso.local/Folders$/john.doe/My%20Documents

Screenshot 2024-06-13 at 1 43 18 pm
<key>Shares</key>
			<array>
				<dict>
					<key>AutoMount</key>
					<false/>
					<key>ConnectedOnly</key>
					<false/>
					<key>Groups</key>
					<array>
						<string>AllStaff</string>
					</array>
					<key>Name</key>
					<string>My Documents (Staff)</string>
					<key>URL</key>
					<string>smb://contoso.local/Folders$/&lt;&lt;shortname&gt;&gt;/My Documents</string>
				</dict>
			</array>
		</dict>
	</array>

bamtan avatar Jun 13 '24 05:06 bamtan