summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* s3: utils: In show_userlist() replace ↵Jeremy Allison2022-09-151-6/+4
| | | | | | | cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: torture: In run_tcon_test() replace ↵Jeremy Allison2022-09-151-9/+7
| | | | | | | | | cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share(). Also fix a comment in run_uid_regression_test(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: torture: In run_smb2_basic(), replace ↵Jeremy Allison2022-09-151-5/+3
| | | | | | | cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_check_msdfs_proxy() replace ↵Jeremy Allison2022-09-151-7/+7
| | | | | | | cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_lsa_lookup_name() replace ↵Jeremy Allison2022-09-151-6/+3
| | | | | | | cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_lsa_lookup_sid() replace ↵Jeremy Allison2022-09-151-6/+3
| | | | | | | cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: Add pair cli_state_save_tcon_share()/cli_state_restore_tcon_share().Jeremy Allison2022-09-152-0/+29
| | | | | | | | | | | Wraps cli_state_save_tcon()//cli_state_restore_tcon() but also returns cli->sharename. We are going to replace all uses of cli_state_save_tcon()/cli_state_restore_tcon() so we also save/restore the cli->share for DFS purposes. Signed-off-by: Jeremy Allison <jra@samba.org> Reviwed-by: Noel Power <npower@samba.org>
* s3: libsmb: Cleanup - remove unused fname_src parameter from ↵Jeremy Allison2022-09-154-7/+0
| | | | | | | cli_dfs_target_check(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: Add missing memory allocation fail check in cli_openx_create().Jeremy Allison2022-09-151-0/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: Add missing memory allocation fail checks in cli_ntcreate1_send().Jeremy Allison2022-09-151-0/+6
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add test_smb1_qpathinfo() DFS test to ↵Jeremy Allison2022-09-141-0/+153
| | | | | | | | | | | | run_smb1_dfs_operations(). Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Sep 14 18:37:06 UTC 2022 on sn-devel-184
* s3: smbtorture3: Add test_smb1_ctemp() DFS test to run_smb1_dfs_operations().Jeremy Allison2022-09-141-0/+158
| | | | | | | | | | | | | NB. This passes against Windows, but SMBctemp is broken on a Windows DFS share and always returns NT_STATUS_FILE_IS_A_DIRECTORY. When we fix the Samba server to correctly process DFS pathnames we'll have to change this test to understand it's running against smbd and modify the expected behavior to match a working server. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add test_smb1_chkpath() DFS test to run_smb1_dfs_operations().Jeremy Allison2022-09-141-0/+113
| | | | | | | Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off--by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add test_smb1_setatr() DFS test to run_smb1_dfs_operations().Jeremy Allison2022-09-141-0/+154
| | | | | | | Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add test_smb1_getatr() DFS test to run_smb1_dfs_operations().Jeremy Allison2022-09-141-0/+146
| | | | | | | Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add test_smb1_create() DFS test to run_smb1_dfs_operations().Jeremy Allison2022-09-141-0/+167
| | | | | | | | | Tests SMBcreate and SMBmknew. Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add test_smb1_open() DFS test to run_smb1_dfs_operations().Jeremy Allison2022-09-141-0/+167
| | | | | | | Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add test_smb1_openx() DFS test to run_smb1_dfs_operations().Jeremy Allison2022-09-141-0/+208
| | | | | | | Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add test_smb1_nttrans_create() DFS test to ↵Jeremy Allison2022-09-141-0/+128
| | | | | | | | | run_smb1_dfs_operations(). Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add test_smb1_ntcreatex() DFS test to ↵Jeremy Allison2022-09-141-0/+94
| | | | | | | | run_smb1_dfs_operations(). Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: smbtorture3: Add test_smb1_rmdir() DFS test to run_smb1_dfs_operations().Jeremy Allison2022-09-141-0/+95
| | | | | | | Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add test_smb1_mkdir() DFS test to run_smb1_dfs_operations().Jeremy Allison2022-09-141-0/+87
| | | | | | | Passes against Windows. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add an SMB1 operations torture tester.Jeremy Allison2022-09-145-0/+221
| | | | | | | | | | | | Only tests SMB1unlink for now, but I will add other operations later. smbtorture3 test is: SMB1-DFS-OPERATIONS. Passes fully against Windows. Adds knownfail for smbd. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: smbtorture3: Add a new test SMB2-NON-DFS-SHARE.Jeremy Allison2022-09-146-0/+193
| | | | | | | | | | | | | | | | | This one is tricky. It sends SMB2 DFS pathnames to a non-DFS share, and sets the SMB2 flag FLAGS2_DFS_PATHNAMES in the SMB2 packet. Windows will have non of it and (correctly) treats the pathnames as local paths (they're going to a non-DFS share). Samba fails. This proves the server looks as the share DFS capability to override the flag in the SMB2 packet. Passes against Windows. Added knownfail for Samba. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* CVE-2021-20251 s3: Ensure bad password count atomic updates for SAMR AES ↵Joseph Sutton2022-09-131-0/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | password change The bad password count is supposed to limit the number of failed login attempt a user can make before being temporarily locked out, but race conditions between processes have allowed determined attackers to make many more than the specified number of attempts. This is especially bad on constrained or overcommitted hardware. To fix this, once a bad password is detected, we reload the sam account information under a user-specific mutex, ensuring we have an up to date bad password count. We also update the bad password count if the password is wrong, which we did not previously do. Derived from a similar patch to source3/auth/check_samsec.c by Jeremy Allison <jra@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Sep 13 00:08:07 UTC 2022 on sn-devel-184
* CVE-2021-20251 s3:rpc_server: Split change_oem_password() call out of ↵Joseph Sutton2022-09-123-32/+36
| | | | | | | | | | | | | | | samr_set_password_aes() Now samr_set_password_aes() just returns the new password in a similar manner to check_oem_password(). This simplifies the logic for the following change to recheck whether the account is locked out, and to update the bad password count. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 dsdb/common: Remove transaction logic from samdb_set_password()Joseph Sutton2022-09-121-1/+4
| | | | | | | | | | | | All of its callers, where necessary, take out a transaction covering the entire password set or change operation, so a transaction is no longer needed here. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4-rpc_server: Extend scope of transaction for ↵Joseph Sutton2022-09-121-9/+33
| | | | | | | | | | | | | | | | ChangePasswordUser3 Now the initial account search is performed under the transaction, ensuring the overall password change is atomic. We set DSDB_SESSION_INFO to drop our privileges to those of the user before we perform the actual password change, and restore them afterwards if we need to update the bad password count. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4-rpc_server: Use user privileges for SAMR password changeJoseph Sutton2022-09-122-6/+31
| | | | | | | | | | | | | | | We don't (and shouldn't) need system prvileges to perform the password change, so drop to the privileges of the user by setting DSDB_SESSION_INFO. We need to reuse the same sam_ctx: creating a new one with only user privileges would not work, because any database modifications would be blocked by the transaction taken out on the original context. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4-rpc_server: Use authsam_search_account() to find the userJoseph Sutton2022-09-121-32/+15
| | | | | | | | | | | | | | | | This helps the bad password and audit log handling code as it allows assumptions to be made about the attributes found in the variable "msg", such as that DSDB_SEARCH_SHOW_EXTENDED_DN was used. This ensures we can re-search on the DN via the embedded GUID, which in in turn rename-proof. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpc_server: Use BURN_STR() to zero passwordJoseph Sutton2022-09-122-5/+3
| | | | | | | | This ensures these calls are not optimised away. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli:auth: Keep passwords from convert_string_talloc() secretJoseph Sutton2022-09-121-0/+2
| | | | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib:util: Check memset_s() error code in talloc_keep_secret_destructor()Joseph Sutton2022-09-121-1/+14
| | | | | | | | Panic if memset_s() fails. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s3: Ensure bad password count atomic updates for SAMR ↵Joseph Sutton2022-09-121-6/+75
| | | | | | | | | | | | | | | | | | | | | | | password change The bad password count is supposed to limit the number of failed login attempt a user can make before being temporarily locked out, but race conditions between processes have allowed determined attackers to make many more than the specified number of attempts. This is especially bad on constrained or overcommitted hardware. To fix this, once a bad password is detected, we reload the sam account information under a user-specific mutex, ensuring we have an up to date bad password count. Derived from a similar patch to source3/auth/check_samsec.c by Jeremy Allison <jra@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s3: ensure bad password count atomic updatesJeremy Allison2022-09-121-0/+77
| | | | | | | | | | | | | | | | | | | | The bad password count is supposed to limit the number of failed login attempt a user can make before being temporarily locked out, but race conditions between processes have allowed determined attackers to make many more than the specified number of attempts. This is especially bad on constrained or overcommitted hardware. To fix this, once a bad password is detected, we reload the sam account information under a user-specific mutex, ensuring we have an up to date bad password count. Discovered by Nathaniel W. Turner. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4:auth_winbind: Check return status of ↵Joseph Sutton2022-09-121-1/+4
| | | | | | | | | | | | authsam_logon_success_accounting() This may return an error if we find the account is locked out. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4-rpc_server: Check badPwdCount update return statusJoseph Sutton2022-09-121-1/+5
| | | | | | | | | | | | If the account has been locked out in the meantime (indicated by NT_STATUS_ACCOUNT_LOCKED_OUT), we should return the appropriate error code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4:kdc: Check badPwdCount update return statusJoseph Sutton2022-09-122-6/+7
| | | | | | | | | | | | If the account has been locked out in the meantime (indicated by NT_STATUS_ACCOUNT_LOCKED_OUT), we should return the appropriate error code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4:kdc: Check return status of authsam_logon_success_accounting()Joseph Sutton2022-09-121-4/+11
| | | | | | | | | | | | | | | | If we find that the user has been locked out sometime during the request (due to a race), we will now return an error code. Note that we cannot avoid the MIT KDC aspect of the issue by checking the return status of mit_samba_zero_bad_password_count(), because kdb_vftabl::audit_as_req() returning void means we cannot pass on the result. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4:kdc: Move logon success accounting code into existing branchJoseph Sutton2022-09-121-20/+13
| | | | | | | | | | This simplifies the code for the following commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4:dsdb: Make badPwdCount update atomicJoseph Sutton2022-09-122-8/+24
| | | | | | | | | | | | We reread the account details inside the transaction in case the account has been locked out in the meantime. If it has, we return the appropriate error code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4:dsdb: Update bad password count inside transactionJoseph Sutton2022-09-121-18/+19
| | | | | | | | | | | | | | Previously, there was a gap between calling dsdb_update_bad_pwd_count() and dsdb_module_modify() where no transaction was in effect. Another process could slip in and modify badPwdCount, only for our update to immediately overwrite it. Doing the update inside the transaction will help for the following commit when we make it atomic. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 s4-auth: Pass through error code from badPwdCount updateJoseph Sutton2022-09-123-3/+5
| | | | | | | | | | | The error code may be NT_STATUS_ACCOUNT_LOCKED_OUT, which we use in preference to NT_STATUS_WRONG_PASSWORD. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2021-20251 auth4: Avoid reading the database twice by precaculating some ↵Andrew Bartlett2022-09-122-31/+36
| | | | | | | | | | | | | | variables These variables are not important to protect against a race with and a double-read can easily be avoided by moving them up the file a little. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* CVE-2021-20251 auth4: Inline samdb_result_effective_badPwdCount() in ↵Andrew Bartlett2022-09-121-5/+8
| | | | | | | | | | | | | | | authsam_logon_success_accounting() By bringing this function inline it can then be split out in a subsequent commit. Based on work by Gary Lockyer <gary@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* CVE-2021-20251 auth4: Split authsam_calculate_lastlogon_sync_interval() outAndrew Bartlett2022-09-121-42/+73
| | | | | | | | | | | | authsam_calculate_lastlogon_sync_interval() is split out of authsam_update_lastlogon_timestamp() Based on work by Gary Lockyer <gary@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* CVE-2021-20251 auth4: Return only the result message and free the ↵Gary Lockyer2022-09-122-2/+2
| | | | | | | | | | surrounding result BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* CVE-2021-20251 auth4: Add missing newline to debug message on PSO read failureAndrew Bartlett2022-09-121-1/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* CVE-2021-20251 s4 auth: make bad password count increment atomicAndrew Bartlett2022-09-124-70/+246
| | | | | | | | | | | | | | | | | | | | | | Ensure that the bad password count is incremented atomically, and that the successful logon accounting data is updated atomically. Use bad password indicator (in a distinct TDB) to determine if to open a transaction We open a transaction when we have seen the hint that this user has recorded a bad password. This allows us to avoid always needing one, while not missing a possible lockout. We also go back and get a transation if we did not take out one out but we chose to do a write (eg for lastLogonTimestamp) Based on patches by Gary Lockyer <gary@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* CVE-2021-20251 auth4: Detect ACCOUNT_LOCKED_OUT error for password changeJoseph Sutton2022-09-121-1/+6
| | | | | | | | | | | | This is more specific than NT_STATUS_UNSUCCESSFUL, and for the SAMR password change, matches the result the call to samdb_result_passwords() would give. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>