Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message with encrypted connections and using smbclient_getxattr "Encryption required and setup failed with error NT_STATUS_INVALID_PARAMETER_MIX." #101

Open
theroch opened this issue Jun 15, 2023 · 0 comments

Comments

@theroch
Copy link

theroch commented Jun 15, 2023

There is a strange behavior while using encrypted connections and getxattr.

Using
smbclient 1.1.1
PHP 7.4
Samba 4.18.2

smb.conf with:

    client max protocol = SMB3
    client min protocol = SMB3
    server max protocol = SMB3
    server min protocol = SMB3

    client smb encrypt = desired
    server smb encrypt = desired

Test code:

// Create new state:
$state = smbclient_state_new();
// Initialize the state with workgroup, username and password:
smbclient_state_init($state, 'workgroup', 'user', '*****');
//smbclient_option_set($state, SMBCLIENT_OPT_ENCRYPT_LEVEL, SMBCLIENT_ENCRYPTLEVEL_REQUIRE); // Enable encrypted connection
//smbclient_option_set($state, SMBCLIENT_OPT_ENCRYPT_LEVEL, SMBCLIENT_ENCRYPTLEVEL_REQUEST); // Request encrypted connection
$uri = 'smb://my.server.local/test';
/*
//Never throws error msg
$attr = smbclient_listxattr($state, $uri);
echo "List Attr:";
var_dump($attr);
*/
//Throws error msg if no encrypted connection is requested, but works properly
$attr = @smbclient_getxattr($state, $uri, 'system.dos_attr.*');
echo "dos_attr:";
var_dump($uri, $attr);

// Free the state:
smbclient_state_free($state);

Get xattr code is working properly but an error msg is thrown:
"Encryption required and setup failed with error NT_STATUS_INVALID_PARAMETER_MIX."

If I set encryption to required or requested no error msg is thrown.

If I use listxattr the error msg is never thrown.

Why throws getxattr this error msg?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant