samba.git
4 years agos3: Fix dfs-reparse testing code to use 32-bit attributes. Change variable names...
Jeremy Allison [Wed, 3 Jun 2020 20:44:55 +0000 (13:44 -0700)]
s3: Fix dfs-reparse testing code to use 32-bit attributes. Change variable names mode -> attr.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Change cli_qpathinfo1() and async version to return a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:42:58 +0000 (13:42 -0700)]
s3: libsmb: Change cli_qpathinfo1() and async version to return a 32-bit attribute.

Only used in torture.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Change cli_qpathinfo3() to return a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:36:05 +0000 (13:36 -0700)]
s3: libsmb: Change cli_qpathinfo3() to return a 32-bit attribute.

Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Change cli_qpathinfo2() and async versions to return a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:28:04 +0000 (13:28 -0700)]
s3: libsmb: Change cli_qpathinfo2() and async versions to return a 32-bit attribute.

Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Change cli_getatr() and async versions to return a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:15:17 +0000 (13:15 -0700)]
s3: libsmb: Change cli_getatr() and async versions to return a 32-bit attribute.

Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Rename uint16_t attr -> sattr (short attributes).
Jeremy Allison [Wed, 3 Jun 2020 20:09:43 +0000 (13:09 -0700)]
s3: libsmb: Rename uint16_t attr -> sattr (short attributes).

This will make it easier to add 32-bit attr value later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Change cli_getattrE() and async versions to return a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:00:56 +0000 (13:00 -0700)]
s3: libsmb: Change cli_getattrE() and async versions to return a 32-bit attribute.

Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Change cli_qfileinfo_basic() to return 32-bit attributes.
Jeremy Allison [Wed, 3 Jun 2020 19:54:10 +0000 (12:54 -0700)]
s3: libsmb: Change cli_qfileinfo_basic() to return 32-bit attributes.

Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Change cli_smb2_qpathinfo2() to return a 32 bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 19:17:30 +0000 (12:17 -0700)]
s3: libsmb: Change cli_smb2_qpathinfo2() to return a 32 bit attribute.

Fix all callers. All libsmb SMB2 calls now return 32 bit attributes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Fix cli_smb2_getatr() to return a 32 bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 19:13:33 +0000 (12:13 -0700)]
s3: libsmb: Fix cli_smb2_getatr() to return a 32 bit attribute.

Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Change cli_smb2_getattrE() to return 32 bit attributes.
Jeremy Allison [Wed, 3 Jun 2020 19:07:05 +0000 (12:07 -0700)]
s3: libsmb: Change cli_smb2_getattrE() to return 32 bit attributes.

Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Change cli_smb2_qfileinfo_basic() and all users to return a uint32_t...
Jeremy Allison [Wed, 3 Jun 2020 18:57:39 +0000 (11:57 -0700)]
s3: libsmb: Change cli_smb2_qfileinfo_basic() and all users to return a uint32_t attribute.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbclient: Rename mode parameter to attr.
Jeremy Allison [Wed, 3 Jun 2020 20:32:55 +0000 (13:32 -0700)]
s3: smbclient: Rename mode parameter to attr.

This is a DOS attribute, not a UNIX mode.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: clifile.c: Rename all uint16_t *attr parameters to uint16_t *pattr.
Jeremy Allison [Wed, 3 Jun 2020 19:03:38 +0000 (12:03 -0700)]
s3: libsmb: clifile.c: Rename all uint16_t *attr parameters to uint16_t *pattr.

Will make it easier to move to 32 bit attributes later.

No logic changes, just a rename.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: clirap. Rename all mode/ *mode parameters to attr and pattr.
Jeremy Allison [Wed, 3 Jun 2020 18:01:36 +0000 (11:01 -0700)]
s3: libsmb: clirap. Rename all mode/ *mode parameters to attr and pattr.

They are attributes, not unix modes.

Once they have the right name, we can start moving all uses to uint32_t.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: cli_smb2_qfileinfo_basic()/cli_smb2_qpathinfo2(). Rename a parameter...
Jeremy Allison [Wed, 3 Jun 2020 17:52:49 +0000 (10:52 -0700)]
s3: libsmb: cli_smb2_qfileinfo_basic()/cli_smb2_qpathinfo2(). Rename a parameter from mode -> pattr.

Also rename attr pointers to pattr.

They are pointers to attributes.

Only parameter name changes, no logic changes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Change size of finfo->attr to uint32_t.
Jeremy Allison [Wed, 3 Jun 2020 17:48:10 +0000 (10:48 -0700)]
s3: libsmb: Change size of finfo->attr to uint32_t.

That's what modern servers return.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: SMBC_chmod_ctx(), rename mode -> attr when setting attributes.
Jeremy Allison [Thu, 4 Jun 2020 04:15:43 +0000 (21:15 -0700)]
s3: libsmb: SMBC_chmod_ctx(), rename mode -> attr when setting attributes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Internally rename to use the name attr instead of mode for attributes.
Jeremy Allison [Wed, 3 Jun 2020 20:07:41 +0000 (13:07 -0700)]
s3: libsmb: Internally rename to use the name attr instead of mode for attributes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: Internally rename to use the name attr instead of mode for attributes.
Jeremy Allison [Wed, 3 Jun 2020 19:46:26 +0000 (12:46 -0700)]
s3: libsmb: Internally rename to use the name attr instead of mode for attributes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: libsmb: In struct file_info rename mode -> attr.
Jeremy Allison [Wed, 3 Jun 2020 17:41:27 +0000 (10:41 -0700)]
s3: libsmb: In struct file_info rename mode -> attr.

Cleanup.  It's never been a UNIX mode, always a DOS attribute field.
Make that explicit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agoexamples: clifuse: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes...
Jeremy Allison [Wed, 3 Jun 2020 17:29:24 +0000 (10:29 -0700)]
examples: clifuse: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.

Cast to a uint16_t for now after pulling the information
as finfo->mode is currently only 16 bits.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agoUpdate SECURITY.md to point to security releases
Andrew Bartlett [Tue, 2 Jun 2020 21:46:30 +0000 (21:46 +0000)]
Update SECURITY.md to point to security releases

Signed-off-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jun  3 15:55:10 UTC 2020 on sn-devel-184

4 years agos3: VFS: default. Ensure read_dfs_pathat() returns stat info.
Jeremy Allison [Sat, 30 May 2020 00:56:58 +0000 (17:56 -0700)]
s3: VFS: default. Ensure read_dfs_pathat() returns stat info.

Remove the knownfail.d/msdfs-attr file.

Everything now passes.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Jun  3 06:19:21 UTC 2020 on sn-devel-184

4 years agos3: VFS: shadow_copy2. Ensure read_dfs_pathat() returns stat info.
Jeremy Allison [Sat, 30 May 2020 00:52:51 +0000 (17:52 -0700)]
s3: VFS: shadow_copy2. Ensure read_dfs_pathat() returns stat info.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: gluster. Ensure read_dfs_pathat() returns stat info.
Jeremy Allison [Sat, 30 May 2020 00:49:17 +0000 (17:49 -0700)]
s3: VFS: gluster. Ensure read_dfs_pathat() returns stat info.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: ceph. Ensure read_dfs_pathat() returns stat info.
Jeremy Allison [Sat, 30 May 2020 00:35:06 +0000 (17:35 -0700)]
s3: VFS: ceph. Ensure read_dfs_pathat() returns stat info.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: catia. Ensure read_dfs_pathat() returns stat info.
Jeremy Allison [Fri, 29 May 2020 23:38:53 +0000 (16:38 -0700)]
s3: VFS: catia. Ensure read_dfs_pathat() returns stat info.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: cap. Ensure read_dfs_pathat() returns stat info.
Jeremy Allison [Fri, 29 May 2020 23:36:55 +0000 (16:36 -0700)]
s3: VFS: cap. Ensure read_dfs_pathat() returns stat info.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: Change the function signature for SMB_VFS_READ_DFS_PATHAT() to take a non...
Jeremy Allison [Fri, 29 May 2020 23:32:12 +0000 (16:32 -0700)]
s3: VFS: Change the function signature for SMB_VFS_READ_DFS_PATHAT() to take a non-const smb_filename.

Otherwise there's no good way to return proper stat(2) information
for a DFS link without making assumptions it's a symlink store.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: torture: Add test for getting attibutes on an MSDFS link.
Jeremy Allison [Mon, 1 Jun 2020 20:45:28 +0000 (13:45 -0700)]
s3: torture: Add test for getting attibutes on an MSDFS link.

Mark as knownfail for now.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: torture: Add a MSDFS-ATTRIBUTE test.
Jeremy Allison [Mon, 1 Jun 2020 19:08:17 +0000 (12:08 -0700)]
s3: torture: Add a MSDFS-ATTRIBUTE test.

Framework to drive comes next.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: libsmb: Info level SMB_FIND_EA_SIZE encodes attibutes as a uint16, not a uint8.
Jeremy Allison [Mon, 1 Jun 2020 18:33:13 +0000 (11:33 -0700)]
s3: libsmb: Info level SMB_FIND_EA_SIZE encodes attibutes as a uint16, not a uint8.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: libsmb: Info level SMB_FIND_INFO_STANDARD encodes attibutes as a uint16, not...
Jeremy Allison [Mon, 1 Jun 2020 19:01:13 +0000 (12:01 -0700)]
s3: libsmb: Info level SMB_FIND_INFO_STANDARD encodes attibutes as a uint16, not a uint8.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: libsmb: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint3...
Jeremy Allison [Mon, 1 Jun 2020 18:36:03 +0000 (11:36 -0700)]
s3: libsmb: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.

Cast to a uint16_t for now after pulling the information
as finfo->mode is currently only 16 bits.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: libsmb: Info level SMB2_FIND_ID_BOTH_DIRECTORY_INFO encodes attibutes as a uint32...
Jeremy Allison [Mon, 1 Jun 2020 20:55:10 +0000 (13:55 -0700)]
s3: libsmb: Info level SMB2_FIND_ID_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.

Fix the SMB2 parsing code.

Cast to a uint16_t for now after pulling the information
as finfo->mode is currently only 16 bits.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3/rpc_server: remove unnecessary srv_fss_agent.h header
David Disseldorp [Thu, 28 May 2020 16:40:26 +0000 (18:40 +0200)]
s3/rpc_server: remove unnecessary srv_fss_agent.h header

The srv_fssa_start() / _cleanup() functions are called via the
DCESRV_INTERFACE_FILESERVERVSSAGENT_INIT / SHUTDOWN_SERVER hooks,
so needn't be public.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jun  3 03:57:12 UTC 2020 on sn-devel-184

4 years agosmbd: simplify uid_entry_in_group()
Ralph Boehme [Tue, 21 Jan 2020 11:05:59 +0000 (12:05 +0100)]
smbd: simplify uid_entry_in_group()

conn->session_info is always valid since
1fa05e5c76e718142326915f8671299217a093df and preceeding commits.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat May 30 02:40:22 UTC 2020 on sn-devel-184

4 years agolibcli: simplify an if condition
Ralph Boehme [Tue, 21 Jan 2020 10:56:18 +0000 (11:56 +0100)]
libcli: simplify an if condition

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:auth: fill in info3 domain name in passwd_to_SamInfo3()
Ralph Boehme [Fri, 13 Dec 2019 11:14:04 +0000 (12:14 +0100)]
s3:auth: fill in info3 domain name in passwd_to_SamInfo3()

This is needed for make_session_info_from_username() to fill in the domain
name. The callchain goes like this:

make_session_info_from_username()
-> make_server_info_pw()
-> passwd_to_SamInfo3()

Other callers of passwd_to_SamInfo3() are also affected. A subsequent change
will let set_conn_force_user_group() user the domainname from the session_info
returned from make_session_info_from_username() to create substitution
context. Without this fix domain name would be NULL.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: RIP conn->origpath
Ralph Boehme [Tue, 7 Apr 2020 07:56:51 +0000 (09:56 +0200)]
smbd: RIP conn->origpath

conn->origpath is always a duplicate of conn->connectpath.

The only function that sets conn->connectpath is set_conn_connectpath() and
everywhere it's called, there's a subsequent talloc_strdup() into
conn->origpath.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: avoid become_user_without_service() in close_directory()
Ralph Boehme [Tue, 7 Apr 2020 07:55:35 +0000 (09:55 +0200)]
smbd: avoid become_user_without_service() in close_directory()

Here we called become_user_without_service() just in order to be able to fetch
the nt_token and unix_token subsequently via get_current_[nt|u]tok(conn). The
same can be achieved by fetching the session_info with
smbXsrv_session_info_lookup().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: avoid become_user_without_service() in close_remove_share_mode()
Ralph Boehme [Tue, 7 Apr 2020 07:54:24 +0000 (09:54 +0200)]
smbd: avoid become_user_without_service() in close_remove_share_mode()

Here we called become_user_without_service() just in order to be able to fetch
the nt_token and unix_token subsequently via
get_current_[nt|u]tok(conn). The same can be achieved by fetching the
session_info with smbXsrv_session_info_lookup().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: don't free smb_fname_parent in unix_mode()
Ralph Boehme [Fri, 29 May 2020 09:44:28 +0000 (11:44 +0200)]
smbd: don't free smb_fname_parent in unix_mode()

The TALLOC_FREEs should have been removed as part of
45a560bce3ef06c211e60e3932521303cc396896. Sorry!

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May 29 20:02:55 UTC 2020 on sn-devel-184

4 years agosmbd: remove dead code
Ralph Boehme [Fri, 29 May 2020 09:27:35 +0000 (11:27 +0200)]
smbd: remove dead code

LINKS_READ_ONLY is not defined anywhere since ages.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoAdd net-ads-join dnshostname=fqdn option
Isaac Boukris [Wed, 27 May 2020 13:54:12 +0000 (15:54 +0200)]
Add net-ads-join dnshostname=fqdn option

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14396

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri May 29 13:33:28 UTC 2020 on sn-devel-184

4 years agoAdd msDS-AdditionalDnsHostName entries to the keytab
Isaac Boukris [Wed, 27 May 2020 13:36:28 +0000 (15:36 +0200)]
Add msDS-AdditionalDnsHostName entries to the keytab

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14396

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoAdd a test for msDS-AdditionalDnsHostName entries in keytab
Isaac Boukris [Wed, 27 May 2020 15:55:12 +0000 (17:55 +0200)]
Add a test for msDS-AdditionalDnsHostName entries in keytab

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14396

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoRefactor ads_keytab_add_entry() to make it iterable
Isaac Boukris [Wed, 27 May 2020 11:25:17 +0000 (13:25 +0200)]
Refactor ads_keytab_add_entry() to make it iterable

so we can more easily add msDS-AdditionalDnsHostName entries.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14396

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoFix accidental overwrite of dnsHostName by the last netbios alias
Isaac Boukris [Wed, 27 May 2020 13:52:46 +0000 (15:52 +0200)]
Fix accidental overwrite of dnsHostName by the last netbios alias

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14396

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoAdd a test to check dNSHostName with netbios aliases
Isaac Boukris [Wed, 27 May 2020 14:50:45 +0000 (16:50 +0200)]
Add a test to check dNSHostName with netbios aliases

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14396

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agosmbd: Protect smbd_smb2_getinfo_send() against invalid quota files
Volker Lendecke [Fri, 22 May 2020 12:41:27 +0000 (14:41 +0200)]
smbd: Protect smbd_smb2_getinfo_send() against invalid quota files

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14367

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri May 29 09:55:10 UTC 2020 on sn-devel-184

4 years agotorture3: Check error code for quotactl on a non-quota file handle
Volker Lendecke [Fri, 22 May 2020 13:24:06 +0000 (15:24 +0200)]
torture3: Check error code for quotactl on a non-quota file handle

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14367

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agolibsmb: Use tevent_req_received() in cli_qfileinfo_recv()
Volker Lendecke [Wed, 27 May 2020 17:09:51 +0000 (19:09 +0200)]
libsmb: Use tevent_req_received() in cli_qfileinfo_recv()

That takes care of doing the early talloc_free(state)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 28 20:35:41 UTC 2020 on sn-devel-184

4 years agopylibsmb: Use async cli_mkdir also for smb2
Volker Lendecke [Tue, 26 May 2020 07:01:57 +0000 (09:01 +0200)]
pylibsmb: Use async cli_mkdir also for smb2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Remove sync cli_smb2_mkdir()
Volker Lendecke [Mon, 25 May 2020 16:31:10 +0000 (18:31 +0200)]
libsmb: Remove sync cli_smb2_mkdir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Use async cli_smb2_mkdir in async cli_mkdir
Volker Lendecke [Mon, 25 May 2020 16:23:31 +0000 (18:23 +0200)]
libsmb: Use async cli_smb2_mkdir in async cli_mkdir

No need to call the sync wrapper in cli_mkdir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Add async cli_smb2_mkdir_send()/recv()
Volker Lendecke [Tue, 26 May 2020 20:21:14 +0000 (22:21 +0200)]
libsmb: Add async cli_smb2_mkdir_send()/recv()

Not converting the sync version to use it, it will go away very soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agopylibsmb: Use async cli_chkpath also for smb2
Volker Lendecke [Tue, 26 May 2020 07:01:57 +0000 (09:01 +0200)]
pylibsmb: Use async cli_chkpath also for smb2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Remove sync cli_smb2_chkpath()
Volker Lendecke [Mon, 25 May 2020 16:31:10 +0000 (18:31 +0200)]
libsmb: Remove sync cli_smb2_chkpath()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Use async cli_smb2_chkpath in async cli_chkpath
Volker Lendecke [Mon, 25 May 2020 16:23:31 +0000 (18:23 +0200)]
libsmb: Use async cli_smb2_chkpath in async cli_chkpath

No need to call the sync wrapper in cli_chkpath()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Add async cli_smb2_chkpath_send/recv()
Volker Lendecke [Tue, 26 May 2020 20:21:14 +0000 (22:21 +0200)]
libsmb: Add async cli_smb2_chkpath_send/recv()

Not converting the sync version to use it, it will go away very soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agopylibsmb: Use async cli_rmdir also for smb2
Volker Lendecke [Tue, 26 May 2020 07:01:57 +0000 (09:01 +0200)]
pylibsmb: Use async cli_rmdir also for smb2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Remove sync cli_smb2_rmdir()
Volker Lendecke [Mon, 25 May 2020 16:31:10 +0000 (18:31 +0200)]
libsmb: Remove sync cli_smb2_rmdir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Use tevent_req_simple_finish_ntstatus() in cli_rmdir_done()
Volker Lendecke [Mon, 25 May 2020 16:29:26 +0000 (18:29 +0200)]
libsmb: Use tevent_req_simple_finish_ntstatus() in cli_rmdir_done()

Save a few lines of code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Use async cli_smb2_rmdir in async cli_rmdir
Volker Lendecke [Mon, 25 May 2020 16:23:31 +0000 (18:23 +0200)]
libsmb: Use async cli_smb2_rmdir in async cli_rmdir

No need to call the sync wrapper in cli_rmdir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbcacls: Fix typo "inherated"->"inherited"
Volker Lendecke [Tue, 26 May 2020 06:17:14 +0000 (08:17 +0200)]
smbcacls: Fix typo "inherated"->"inherited"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbcacls: Align integer types
Volker Lendecke [Tue, 26 May 2020 06:16:32 +0000 (08:16 +0200)]
smbcacls: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbcacls: Remove the CREATE_ACCESS_READ #define
Volker Lendecke [Tue, 26 May 2020 06:04:52 +0000 (08:04 +0200)]
smbcacls: Remove the CREATE_ACCESS_READ #define

That only confuses things

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbcacls: Reformat a call to cli_ntcreate()
Volker Lendecke [Tue, 26 May 2020 06:07:41 +0000 (08:07 +0200)]
smbcacls: Reformat a call to cli_ntcreate()

The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Remove the CREATE_ACCESS_READ #define
Volker Lendecke [Tue, 26 May 2020 06:04:52 +0000 (08:04 +0200)]
libsmb: Remove the CREATE_ACCESS_READ #define

That only confuses things

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Reformat calls to cli_ntcreate()
Volker Lendecke [Tue, 26 May 2020 06:07:41 +0000 (08:07 +0200)]
libsmb: Reformat calls to cli_ntcreate()

The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbclient: Remove the CREATE_ACCESS_READ #define
Volker Lendecke [Tue, 26 May 2020 06:04:52 +0000 (08:04 +0200)]
smbclient: Remove the CREATE_ACCESS_READ #define

That only confuses things

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbclient: Reformat a call to cli_ntcreate()
Volker Lendecke [Tue, 26 May 2020 06:01:33 +0000 (08:01 +0200)]
smbclient: Reformat a call to cli_ntcreate()

The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agopylibsmb: Use async cli_unlink also for smb2
Volker Lendecke [Tue, 26 May 2020 07:01:57 +0000 (09:01 +0200)]
pylibsmb: Use async cli_unlink also for smb2

Async cli_smb2_unlink was just added

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Remove sync cli_smb2_unlink()
Volker Lendecke [Mon, 25 May 2020 16:31:10 +0000 (18:31 +0200)]
libsmb: Remove sync cli_smb2_unlink()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Use tevent_req_simple_finish_ntstatus() in cli_unlink_done()
Volker Lendecke [Mon, 25 May 2020 16:29:26 +0000 (18:29 +0200)]
libsmb: Use tevent_req_simple_finish_ntstatus() in cli_unlink_done()

Save a few lines of code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Use async cli_smb2_unlink in async cli_unlink
Volker Lendecke [Mon, 25 May 2020 16:23:31 +0000 (18:23 +0200)]
libsmb: Use async cli_smb2_unlink in async cli_unlink

No need to call the sync wrapper in cli_unlink()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Remove clistr_pull_talloc()
Volker Lendecke [Sun, 17 May 2020 10:57:32 +0000 (12:57 +0200)]
libsmb: Remove clistr_pull_talloc()

This was just a 1:1 wrapper around pull_string_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Trim #includes
Volker Lendecke [Sun, 17 May 2020 10:06:23 +0000 (12:06 +0200)]
libsmb: Trim #includes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Remove an outdated comment
Volker Lendecke [Mon, 25 May 2020 16:21:40 +0000 (18:21 +0200)]
libsmb: Remove an outdated comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:libsmb: remove finally unused credential flags
Stefan Metzmacher [Mon, 11 Nov 2019 16:52:13 +0000 (17:52 +0100)]
s3:libsmb: remove finally unused credential flags

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu May 28 08:04:12 UTC 2020 on sn-devel-184

4 years agoexamples/fuse/smb2mount: avoid using CLI_FULL_CONNECTION_{USE,FALLBACK_AFTER}_KERBERO...
Stefan Metzmacher [Mon, 11 Nov 2019 16:47:42 +0000 (17:47 +0100)]
examples/fuse/smb2mount: avoid using CLI_FULL_CONNECTION_{USE,FALLBACK_AFTER}_KERBEROS flags

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:rpcclient: avoid using auth related CLI_FULL_CONNECTION_* flags
Stefan Metzmacher [Mon, 11 Nov 2019 16:49:48 +0000 (17:49 +0100)]
s3:rpcclient: avoid using auth related CLI_FULL_CONNECTION_* flags

We use get_cmdline_auth_info_creds() and pass cli_credentials arround.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:torture: don't use CLI_FULL_CONNECTION_USE_KERBEROS in open_nbt_connection()
Stefan Metzmacher [Mon, 11 Nov 2019 16:49:05 +0000 (17:49 +0100)]
s3:torture: don't use CLI_FULL_CONNECTION_USE_KERBEROS in open_nbt_connection()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:smbspool: avoid using CLI_FULL_CONNECTION_{USE,FALLBACK_AFTER}_KERBEROS flags
Stefan Metzmacher [Mon, 11 Nov 2019 16:47:42 +0000 (17:47 +0100)]
s3:smbspool: avoid using CLI_FULL_CONNECTION_{USE,FALLBACK_AFTER}_KERBEROS flags

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:libsmb: remove unused cli_full_connection()
Stefan Metzmacher [Mon, 11 Nov 2019 16:29:57 +0000 (17:29 +0100)]
s3:libsmb: remove unused cli_full_connection()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:libsmb: remove unused cli_cm_force_encryption()
Stefan Metzmacher [Mon, 11 Nov 2019 16:28:35 +0000 (17:28 +0100)]
s3:libsmb: remove unused cli_cm_force_encryption()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:libsmb_server: fix error handling in SMBC_server_internal()
Stefan Metzmacher [Mon, 11 Nov 2019 16:26:53 +0000 (17:26 +0100)]
s3:libsmb_server: fix error handling in SMBC_server_internal()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:libsmb_server: make use of SMBC_auth_credentials() in SMBC_attr_server()
Stefan Metzmacher [Mon, 11 Nov 2019 16:25:47 +0000 (17:25 +0100)]
s3:libsmb_server: make use of SMBC_auth_credentials() in SMBC_attr_server()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:libsmb_server: split out SMBC_auth_credentials() helper
Stefan Metzmacher [Mon, 11 Nov 2019 15:40:40 +0000 (16:40 +0100)]
s3:libsmb_server: split out SMBC_auth_credentials() helper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:libsmb_server: don't use auth related flags in SMBC_server_internal()
Stefan Metzmacher [Mon, 11 Nov 2019 16:23:14 +0000 (17:23 +0100)]
s3:libsmb_server: don't use auth related flags in SMBC_server_internal()

These are ignored at the lower levels if we're passing cli_credential
structures along.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:locktest2: use cli_session_creds_init() directly
Stefan Metzmacher [Mon, 11 Nov 2019 15:14:38 +0000 (16:14 +0100)]
s3:locktest2: use cli_session_creds_init() directly

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:net: make use of net_context_creds() in net_ads_printer_publish()
Stefan Metzmacher [Mon, 11 Nov 2019 14:46:16 +0000 (15:46 +0100)]
s3:net: make use of net_context_creds() in net_ads_printer_publish()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:libnet_join: call cli_session_creds_init() directly
Stefan Metzmacher [Mon, 11 Nov 2019 14:38:24 +0000 (15:38 +0100)]
s3:libnet_join: call cli_session_creds_init() directly

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:netlookup: make use of cli_credentials_init_anon()
Stefan Metzmacher [Mon, 11 Nov 2019 14:23:45 +0000 (15:23 +0100)]
s3:netlookup: make use of cli_credentials_init_anon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:net: make use of net_context_creds() in connect_to_service()
Stefan Metzmacher [Mon, 11 Nov 2019 14:18:11 +0000 (15:18 +0100)]
s3:net: make use of net_context_creds() in connect_to_service()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:net: make use of cli_credentials_init_anon() in connect_to_ipc_anonymous()
Stefan Metzmacher [Mon, 11 Nov 2019 14:14:18 +0000 (15:14 +0100)]
s3:net: make use of cli_credentials_init_anon() in connect_to_ipc_anonymous()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:libnet_join: make use of cli_credentials_init_anon()
Stefan Metzmacher [Mon, 11 Nov 2019 14:10:10 +0000 (15:10 +0100)]
s3:libnet_join: make use of cli_credentials_init_anon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:rpc_server/spoolss: make use of cli_credentials_init_anon()
Stefan Metzmacher [Mon, 11 Nov 2019 14:02:11 +0000 (15:02 +0100)]
s3:rpc_server/spoolss: make use of cli_credentials_init_anon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>