SMB credentials check on Sonoma

I can't anymore check SMB credentials on macOS. Sonoma stops checking them after first successful validation. No matter which way to go, it could be smbutil, mount_smbfs, or even the NetFSMountURLSync function from the NetFS framework.

Below is a script that works fine on Ventura, but would fail on Sonoma. There are three smbutil calls. The first call includes the correct username and password, the second omits the password, the third goes with an incorrect password. On Ventura and earlier the second and third calls fail, but Sonoma feels okay.

The same could be seen with mount_smb.

Is it a normal behavior? Is there a way to check credentials on Sonoma?

#!/bin/bash

# SMB server or its ip address
SERVER="127.0.0.1"
RESOURCE="Test"

# username and password to authenticate on the server
USER_NAME="username"
USER_PASSWORD="password"

# path to mount server resource
MOUNT_POINT="/tmp/1"

function Raise
{
  echo "!!! ERROR: $1"
  exit 1
}

/usr/bin/smbutil view -ANf "//${USER_NAME}:${USER_PASSWORD}@${SERVER}" || Raise "Unable to browse shares with credentials"
/usr/bin/smbutil view -ANf "//${USER_NAME}:@${SERVER}" && Raise "Successfully browsed shares without password"
/usr/bin/smbutil view -ANf "//${USER_NAME}:foobar@${SERVER}" && Raise "Successfully browsed shares with incorrect password"

mkdir -p "/tmp/1"
mount_smbfs -s "//${USER_NAME}:${USER_PASSWORD}@${SERVER}/${RESOURCE}" "/tmp/1" || Raise "Unable to mount share with credentials"
diskutil unmount "/tmp/1"

mkdir -p "/tmp/1"
mount_smbfs -s "//${USER_NAME}:foobar@${SERVER}/${RESOURCE}" "/tmp/1" && Raise "Successfully mounted with incorrect password"
diskutil unmount "/tmp/1"
Answered by mtrushin in 780703022

The bug seems to be fixed. At least in 14.4 beta 3 (23E5196e).

The Apple guys said that it's a bug so I submitted it as one: FB13463381

I there any progress for the issue? I've encountered the same issue. I can't open the feed back link. Thanks.

Have not heard anything on my feedback submission either. FB13559212

I let our Apple SE know as well, who hadn't heard of this. We don't have AppleCare OS support, so I can't open a ticket there.

Accepted Answer

The bug seems to be fixed. At least in 14.4 beta 3 (23E5196e).

SMB credentials check on Sonoma
 
 
Q