1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

29559 Commits

Author SHA1 Message Date
Andrew Bartlett
256391c0fa samba-tool: Add new samba-tool gpo aclcheck and test
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-11-16 08:59:00 +11:00
Karolin Seeger
4ed7803c80 popt_common: Fix typos.
Karolin

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed by: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Nov 15 01:31:50 CET 2012 on sn-devel-104
2012-11-15 01:31:50 +01:00
Andrew Bartlett
a390a5878d scripting ntacls: Do not place a SACL in the GPO filesystem ACL
On a new GPO created on windows, the SACL is not used.

Andrew Bartlett

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Nov 14 00:34:50 CET 2012 on sn-devel-104
2012-11-14 00:34:50 +01:00
Andrew Bartlett
3e2584a86c ntvfs: Fill in sd->type based on the new ACL being added
Previously we would not change the type field, and just relied on what
was in the original ACL based on the default SD.

This is required to ensure the SEC_DESC_DACL_PROTECTED is set
which is in turn required for GPOs to be set correctly
to match what windows does.

Andrew Bartlett

Reviewed by: Jeremy Allison <jra@samba.org>
2012-11-13 22:48:19 +01:00
Andrew Bartlett
d6c7e9b1ed smbd: Remove NT4 compatability handling in posix -> NT ACL conversion
NT4 is long dead, and we should not change which ACL we return based
on what we think the client is.  The reason we should not do this, is
that if we are using vfs_acl_xattr then the hash will break if we do.
Additionally, it would require that the python VFS interface set the
global remote_arch to fake up being a modern client.

This instead seems cleaner and removes untested code (the tests are
updated to then handle the results of the modern codepath).

The supporting 'acl compatability' parameter is also removed.

Andrew Bartlett

Reviewed by: Jeremy Allison <jra@samba.org>
2012-11-13 22:48:19 +01:00
Stefan Metzmacher
11f5d54cbb s4:samba-tool/testparm: report a CommandError if loading of the config file fails
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-13 22:14:14 +11:00
Andrew Bartlett
095c7627df selftest: Add --tmpdir to 'samba-tool gpo create' test
This was the cause of the flakey test, and was only noticed when
multiple different users ran autobuild at the same time on the same
server.

We use shutil.rmtree to wipe the directory before the tests finishes
as required by the TestCaseInTempDir class.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Nov 13 10:50:56 CET 2012 on sn-devel-104
2012-11-13 10:50:56 +01:00
Andrew Bartlett
4d6d6e446c selftest: Avoid returning errors (rather than failures) in gpo test
This should help find the real cause of the flakey test, if it ever returns.

Andrew Bartlett

Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-11-13 00:00:25 +01:00
Andrew Bartlett
18e13224eb ntp_signd: Only allow group access to the ntp signd directory.
Existing installations running ntp as group 'ntp' will need to change
the permissions on the ntp_signd socket directory (eg
PREFIX/lib/ntp_signd or /var/lib/samba/ntp_signd)

The reason is that allowing other users on the host access to this
directory would allow them to potentially spoof time on the network,
or attack the password database with a chosen plaintext attack.

Permissions should be changed to:

ownership root:ntp (if ntp runs as gid ntp)
mode 0750 (this is what it will be created as)

If the permissions are not changed, Samba will refuse to start the
ntp_signd server, and NTP operations will not be signed.  As the error
is declared fatal, in the future, Samba may totally refused to start.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Nov 12 12:36:30 CET 2012 on sn-devel-104
2012-11-12 12:36:27 +01:00
Stefan Metzmacher
e0ab14f52a s4:dsdb/acl_read: make sure confidential attributes require CONTROL_ACCESS (bug #8620)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov 12 01:25:21 CET 2012 on sn-devel-104
2012-11-12 01:25:19 +01:00
Stefan Metzmacher
21dfaefda0 s4:dsdb/acl_read: fix whitespace formatting errors
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-12 09:42:36 +11:00
Stefan Metzmacher
f6fa7243f8 s4:dsdb/acl: only give administrators access to attributes marked as confidential (bug #8620)
The full fix will to implement and use the code of the read_acl module,
but this is better than nothing for now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-12 09:42:31 +11:00
Stefan Metzmacher
ed8b27516b s4:dsdb/acl: reorganize the logic flow in the password filtering checks
This avoids some nesting levels and does early returns.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-12 09:42:26 +11:00
Stefan Metzmacher
54ad5c70e3 s4:dsdb/acl: fix search filter cleanup for password attributes
We need to this when we're *not* system.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-12 09:42:21 +11:00
Andrew Bartlett
94649e46b4 selftest: Avoid test cross-contamination in samba.tests.posixacl
This creates a new xattr.tdb per unit test, which avoids once and for all
the issue of dev/inode reuse.

For test_setposixacl_dir_getntacl_smbd the file ownership also set specifically.

Andrew Bartlett

Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-11-12 09:39:54 +11:00
Andrew Bartlett
1d81e52bba selftest: Add tests for expected behaviour on directories as well as files
This is important because it covers the codepath which had the talloc
error fixed by commit 60cf4cb5a6
(vfs_acl_common: In add_directory_inheritable_components allocate on
psd as parent)

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Nov 11 15:48:10 CET 2012 on sn-devel-104
2012-11-11 15:48:10 +01:00
Andrew Bartlett
a6a01552ef pysmbd: Add SMB_ACL_EXECUTE to the mask set by make_simple_acl()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-12 00:05:12 +11:00
Andrew Bartlett
312f8ddae2 selftest: Make samba.tests.ntacl also use TestCaseInTempDir
This follows on from the successful conversion of samba.tests.posixacl.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-12 00:05:12 +11:00
Andrew Bartlett
b4d8629f51 samba-tool: Rework ldap attribute fetch in classicupgrade for missing attributes
Is is not required that these additional attributes be filled in, so
catch KeyError in both the nsswitch and ldap backend case.

We rework get_posix_attr_from_ldap_backend() so it raises KeyError
rather than trying to return None, and does not ignore other errors.

Andrew Bartlett

Tested-by: Chirana Gheorghita Eugeniu Theodor <office@adaptcom.ro>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-11-12 00:05:08 +11:00
Andreas Schneider
702049ef55 torture: Fix smb2.create.blob test.
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Nov  9 14:53:27 CET 2012 on sn-devel-104
2012-11-09 14:53:27 +01:00
Karolin Seeger
76fa5ee5d4 samba-tool: Fix typo in --help output.
Signed-off-by: Karolin Seeger <kseeger@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Nov  9 11:04:50 CET 2012 on sn-devel-104
2012-11-09 11:04:50 +01:00
Matthieu Patou
f8c5f98364 s4-drs: Remove unused var
Signed-off-by: Matthieu Patou <mat@matws.net>
2012-11-09 09:20:11 +01:00
Jelmer Vernooij
da284b3765 heimdal_build: Fix finding of system heimdal.
When checking for Heimdal headers, make sure HAVE_CONFIG_H is not
defined, as config.h will not be available.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Tue Nov  6 16:27:03 CET 2012 on sn-devel-104
2012-11-06 16:27:03 +01:00
Jelmer Vernooij
9cf985c53e heimdal_build: HEIMDAL_LIBRARY(): Remove unused cflags argument. 2012-11-06 14:33:51 +01:00
Jelmer Vernooij
6073d214aa ldb_secrets_tdb_sync: Add dependency on gssapi.
This is required when building with the system heimdal, as
gssapi/gssapi_spnego.h is included.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov  6 05:12:28 CET 2012 on sn-devel-104
2012-11-06 05:12:28 +01:00
Jelmer Vernooij
ed6330094b dsdb: Rename _res argument to _result.
Newer versions of heimdal include a macro that is unfortunately named
'_res'. This change prevents the clash.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-11-06 13:33:09 +11:00
Andrew Bartlett
ab30a8bf0f provision: Make dsacl2fsacl() take a security.dom_sid, not str
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov  6 00:12:43 CET 2012 on sn-devel-104
2012-11-06 00:12:43 +01:00
Andrew Bartlett
033451587d provision: Also walk directories checking ACLs
The directory walk was missed due to a cut-and-paste error.

Andrew Bartlett

Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-11-06 08:27:44 +11:00
Andrew Bartlett
0b7bb774ce selftest: check that samba-tool gpo works for basic operations
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-11-06 08:27:44 +11:00
Volker Lendecke
26faa8fe3a dsdb: Simplify DsCrackNameOneFilter a bit
For me "else" branches clutter my flow reading code. If we do a hard
return at the end of an "if" branch, "else" is not required.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-06 08:27:44 +11:00
Amitay Isaacs
1f55865f28 s4-dns: Fix format string vulnerability in an error message (bug #9354)
Also, fixes few comments.

Thanks to Bruno Rohée <bruno@rohee.org> for reporting and patch fix.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-By: Kai Blin <kai@samba.org>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Sun Nov  4 16:58:13 CET 2012 on sn-devel-104
2012-11-04 16:58:13 +01:00
Andrew Tridgell
0e6c5c036f s4-ldapclient: cope with logon failure retry in LDAP
similar to what was done for rpc and cifs, we now retry once on logon
failure for ldap, allowing for a new ticket to be fetched when a
server password changes while we have a valid ticket for the old
password

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:41 +11:00
Andrew Tridgell
b0cc0d5698 s4-librpc: set error code to LOGON_FAILURE on RPC fault with access denied
this allows the client code to trigger a retry with a new password
callback for NTLM connections

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:41 +11:00
Andrew Tridgell
538dd046f1 samba-tool: "drs options" does not need a samdb connection
this gives us a handy pure RPC client test for use in blackbox testing

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:41 +11:00
Andrew Tridgell
5d6ae3498a s4-librpc: try a 2nd logon for more error cases
not all servers give LOGON_FAILURE on authentication failures, so we
need to do the retry with a new ticket on a wider range of error types

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:41 +11:00
Andrew Tridgell
ed2e69fe91 s4-librpc: use cli_credentials_failed_kerberos_login to cope with stale tickets
This allows our RPC client code to cope with a kerberos server
changing password while we have a valid service ticket

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:40 +11:00
Andrew Tridgell
d4ea637eb8 libcli: use cli_credentials_failed_kerberos_login() to cope with server changes
if a server changes while we have a valid ticket we want to retry
after removing the ccache entry.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:40 +11:00
Andrew Bartlett
42c379f0df samba-tool: Add samba-tool processes subcommand
This will allow administrators to inspect the process list in a
similar way to what running on a platform with setproctitle might
permit.

--pid= returns the registered server names for a PID (eg kdc, cldap_server)
--name= returns the pids registered with a particular name.

Andrew Bartlett
2012-10-31 08:13:56 +11:00
Andrew Bartlett
a732f2a621 pymessaging: Add irpc_servers_byname() and irpc_all_servers()
This will allow python scripts to inspect the process list.

Andrew Bartlett
2012-10-31 08:13:56 +11:00
Andrew Bartlett
76b7348299 pymessaging: Use the server_id IDL structure rather than a tuple
This will make it easier to pass this structure in and out.  The tuple is still
accepted as input.

Andrew Bartlett
2012-10-31 08:13:56 +11:00
Andrew Bartlett
3b4ef03097 imessaging: Add irpc_all_servers() to list all available servers
This is implemented with a tdb_traverse_read(), and will allow a tool
to disover the name and server_id of all Samba processes, as each
process registers itself to recieve messages.

Andrew Bartlett
2012-10-31 08:13:56 +11:00
Jelmer Vernooij
8d397b69bb TestCaseInTempDir: Use addCleanup rather than tearDown. 2012-10-27 05:16:19 -08:00
Jelmer Vernooij
1190f385f7 source4.selftest.tests: Add FIXME about database verification. 2012-10-27 05:16:19 -08:00
Jelmer Vernooij
ea5e2b56c1 source4.selftest.tests: Add suffix for smbclient4/nmblookup4. 2012-10-27 05:16:18 -08:00
Jelmer Vernooij
58345820c0 selftesthelpers: Add function for printing smbtorture4 version. 2012-10-27 05:16:18 -08:00
Jelmer Vernooij
8237e2727d selftest: Move determining of smbtorture4 options to selftesthelpers. 2012-10-27 05:16:18 -08:00
Jelmer Vernooij
fcb7926ce5 selftest/selftesthelpers: Share environment handling for extra smbtorture options. 2012-10-27 05:16:18 -08:00
Jelmer Vernooij
4c4d3c86f0 selftesthelpers: Share code for listing smbtorture4 tests. 2012-10-27 05:16:18 -08:00
Jelmer Vernooij
868c8c0583 source4.selftest.tests: Rename plansmbtorturesuite() to plansmbtorture4suite(). 2012-10-27 05:16:18 -08:00
Jelmer Vernooij
55507d0612 source4.selftest.tests: Consistent naming of smbtorture binary. 2012-10-27 05:16:18 -08:00