Skip to content

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

Description

@theroch

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

Using
smbclient 1.1.1
PHP 8.1
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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions