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

40515 Commits

Author SHA1 Message Date
Volker Lendecke
54a6d7b3b8 s3: oplock_timeout is a talloc child of fsp
Jeremy, I know you like it explicit, but I stumbled across this
explicit TALLOC_FREE and asked myself about a potentially wrong
talloc hierarchy.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Apr 26 23:00:03 CEST 2012 on sn-devel-104
2012-04-26 23:00:03 +02:00
Volker Lendecke
21985a7f10 s3: Remove code TALLOC_FREE already does 2012-04-26 21:26:27 +02:00
Volker Lendecke
05456aca34 s3: Remove an unused variable
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Apr 26 12:17:14 CEST 2012 on sn-devel-104
2012-04-26 12:17:13 +02:00
Andrew Bartlett
d913a94eeb selftest: push --target selection into plansmbtorturetestsuite 2012-04-26 02:28:26 +02:00
Michael Adam
c333885fa1 s3:registry: replace call to reg_openkey() in reg_createkey() by accesscheck.
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
7f205bcbf2 s3:registry: remove a superfluous fill_subkey_cache() in reg_createkey()
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
4b7817aa80 s3:registry: use fill_subkey_cache to check exsistence in regkey_open_onelevel().
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
be2cb08e40 s3:registry: let fill_subkey_cache return WERR_BADFILE when the subkey list could not be loaded
WERR_NO_MORE_ITEMS seems inappropriate.

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
1703e6fe09 s3:registry: convert reg_openkey() to use talloc instead of SMB_STRDUP etc
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
323ec9f9b4 s3:registry untangle an assignment from the check in regkey_open_onelevel()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
640cecab19 s3:registry: untangle assignment from check in regkey_open_onelevel()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
22451f7f45 s3:registry: fix seqnum race in regdb_fetch_keys_internal
This prevents race between fetching seqnum and key content.

Because there is currently no way to atomically fetch the
record along with the seqnum, I use a loop.
This is far from optimal and should should ideally be done
differently. But for now it fixes the race.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
7ea8bd3605 s3:registry: fix seqnum race in fetch_values_internal
This prevents race between fetching seqnum and key content.

Because there is currently no way to atomically fetch the
record along with the seqnum, I use a loop.
This is far from optimal and should should ideally be done
differently. But for now it fixes the race.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
ab83005b30 s3:registry: update the seqnum in the subkey cache at the end of regval_store_keys
The purpose is to prevent next reads from going to disk.

Note that this will currently only be effective with local tdbs, not
with ctdb: For tdb, store and delete bump the seqnum while transaction
commit does not. For ctdb, transaction commit bumps the seqnum, while
store and delete don't... This needs fixing (in ctdb).

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
4367071f62 s3:registry:db: update the value container seqnum after storing/deleting to prevent next read from going to disk if possible
Note that this will currently only be effective in the local TDB implementation.
For CTDB, this wont work since seqnum currently works differently there (needs
fixing): For tdb, store and delete operations bump the db seqnum, while
transaction commits don't. For ctdb, the seqnum is bumped by the transaction
commit but not by store and delete operations.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
8c7047b0e7 s3:registry: wrap reg_deletekey() into a transaction
This is wrong layering but fixes a race condition.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
32ac4f4b34 s3:registry: wrap reg_createkey() in a transaction
This is wrong layering (calling into regdb_transaction* in the reg_api code)
but fixes a potential race. It makes the multi-step create procedure atomic.

This should completely be done in the backend.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
1af68be008 s3:registry: untangle assignments from checks in reg_createkey()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
8d19ac7474 s3:registry: wrap reg_deletevalue() in a transaction
This is at the wrong layer, but if fixes a race potentially causing
data corruption by concurrent access.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
97bf05871a s3:registry: untangle assignment from check in reg_deletevalue()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
8ddc2aa0e1 s3:registry: fix race in reg_setvalue that could lead to data corruption
(there was no lock around fetching the values and storing them)

The layering is wrong in that it uses regdb transactions in reg_api

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
705ea5b8c2 s3:registry: untangle assignment from check and add a debugmessage in reg_setvalue()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
04aa303fb1 s3:registry: don't leak the old contents when updating the value cache
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:09 +02:00
Michael Adam
f4747250ea s3:registry: fix debug message in regdb_store_values_internal()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:09 +02:00
Michael Adam
44159330db s3:registry: improve log message in regdb_unpack_values()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:09 +02:00
Michael Adam
6f67f5d5b7 s3:registry: fix a debug message typo
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:09 +02:00
Michael Adam
64a9ab4f82 s3:registry: add a new function regval_ctr_value_byname()
This is like regval_ctr_key_exists() but does not return bool,
but the regval_blob instead, if found, and NULL if not found.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:01 +02:00
Michael Adam
2fc610caf5 s3:registry: rename regval_ctr_key_exists() to regval_ctr_value_exists()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:05 +02:00
Michael Adam
6c016734aa s3:registry:reg_api: fix reg_queryvalue to not fail when values are modified while it runs
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:05 +02:00
Michael Adam
877af95ed7 s3:registry: make regdb_values_need_update() static
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:05 +02:00
Michael Adam
bc48100530 s3:registry: make regdb_subkeys_need_update() static
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:05 +02:00
Michael Adam
a3b1c13cd4 s3:registry: make regdb_store_values() static
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:04 +02:00
Michael Adam
6ab2eb8295 s3:registry: make regdb_fetch_values() static
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:04 +02:00
Michael Adam
5fdd602605 s3:registry: make regdb_fetch_keys() static
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:04 +02:00
Michael Adam
4cf44177ac s3:registry: make regdb_store_keys() static
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:04 +02:00
Michael Adam
37715930c2 s3:registry: printing backend: use regdb options via ops struct, not directly
just like the other backends.

This is in preparation of making the backend functions private

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:04 +02:00
Gregor Beck
36cb40ef2b s3:registry: remove usage of reg_objects from net_rpc_printer.c
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:04 +02:00
Gregor Beck
d14ca5d07a s3:registry: remove usage of reg_objects from cmd_spoolss.c
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:03 +02:00
Gregor Beck
4eb4f75371 s3:eventlogadm make a transaction for addsource
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:03 +02:00
Gregor Beck
c6224e46aa s3:eventlogadm reimplement addsource using reg_api
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:22:17 +02:00
Andreas Schneider
5b636e5249 s3-waf: Cleanup smbregistry. 2012-04-25 14:16:48 +02:00
Gregor Beck
cd2616cc16 s3:registry: remove usage of reg_objects from srv_spoolss_nt.c
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:11:06 +02:00
Gregor Beck
7ba1b13e99 s3:registry: remove usage of reg_objects from libads/ldap_printer.c
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:11:06 +02:00
Alexander Bokovoy
594e316181 lib/replace: split out GSSAPI from lib/replace/system/kerberos.h into lib/replace/system/gssapi.h
With waf build include directories are defined by dependencies specified to subsystems.
Without proper dependency <gssapi/gssapi.h> cannot be found for embedded Heimdal builds
when there are no system-wide gssapi/gssapi.h available.

Split out GSSAPI header includes in a separate replacement header and use that explicitly
where needed.

Autobuild-User: Alexander Bokovoy <ab@samba.org>
Autobuild-Date: Wed Apr 25 00:18:33 CEST 2012 on sn-devel-104
2012-04-25 00:18:32 +02:00
Volker Lendecke
2d01099acc s3: Simplify check_reduced_name a bit
It's pointless to do a talloc_asprintf with a SMB_STRDUP on the
result. Use asprintf directly.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Apr 24 18:18:05 CEST 2012 on sn-devel-104
2012-04-24 18:18:05 +02:00
Volker Lendecke
d1d0f1d11d s3: Fix a typo 2012-04-24 16:44:26 +02:00
Volker Lendecke
1267ced693 s3: Introduce variable "indyniov" for easier reading 2012-04-24 16:44:26 +02:00
Volker Lendecke
d38a171a43 s3: Attempt to fix the build without kerberos
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Apr 24 15:04:14 CEST 2012 on sn-devel-104
2012-04-24 15:04:13 +02:00
Volker Lendecke
374ca0bd26 s3: Fix Coverity ID 2751: REVERSE_INULL 2012-04-24 13:28:50 +02:00
Simo Sorce
d43c2c0945 krb5_samba: Add support for krb5_princ_size when using Heimdal 2012-04-23 19:20:38 -04:00
Simo Sorce
08c733d75f Make krb5 wrapper library common so they can be used all over 2012-04-23 19:20:38 -04:00
Alexander Bokovoy
4291fdcf39 waf: move krb5 checks to a separate waf file
With PROCESS_SEPARATE_RULE in wafsamba it is now possible to simplify
configuration and checks for MIT/Heimdal Kerberos implementations.

1. Move MIT krb5 checks from source3/wscript to wscript_configure_krb5
2. Make sure they are called same way (--with-mit-krb5-checks)
3. If no configure checks identified MIT krb5 in system (or were disabled),
   make sure Heimdal build is selected, embedded (default) or system-provided.

This makes logic of configuration unchanged for Heimdal builds but adds
less hacky way to use MIT krb5 builds. The latter does not work yet as we
need to untangle more subsystems from HDB/Heimdal-specific details but
lays out a foundation for that.

Signed-off-by: Simo Sorce <idra@samba.org>
2012-04-23 16:38:43 -04:00
Jeremy Allison
5b5b696c1e Fix bug #8882 - Broken processing of %U with vfs_full_audit when force user is set.
When doing a "force user" we need to remember what the "sanitized_username"
was from the original connect.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Apr 23 19:52:19 CEST 2012 on sn-devel-104
2012-04-23 19:52:19 +02:00
Jeremy Allison
fbaaf4b21f Add complete test program for Linux kernel aio inside configure.in (I discovered yesterday there are systems with only half the glibc changes needed to implement userspace kaio. 2012-04-23 09:19:16 -07:00
Andrew Bartlett
d910d848e3 build: Remove support for a system libsmbclient
With the new --private-libraries option, there is no longer the need
to have this support, which was aimed at avoiding the duplication
between two different libsmbclient binaries in a packaged
distribution.  By using --private-libraries instead, we do not
introduce a dependency between Samba 4.0 packages and whatever other
packages are on the system.

This effectivly reverts part of
e3ffb31554 while kpeeing the improved
SAMBA_LIBRARY declaration.

Andrew Bartlett
2012-04-23 20:48:02 +10:00
Andrew Bartlett
3969cc28e8 s3-dbwrap: A void function can not return a value
Only non-gcc compilers seem to notice this as an error.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Apr 23 05:58:52 CEST 2012 on sn-devel-104
2012-04-23 05:58:52 +02:00
Volker Lendecke
13d667bbff s3: Implement db_id for dbwrap_cache
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Apr 21 13:46:00 CEST 2012 on sn-devel-104
2012-04-21 13:46:00 +02:00
Volker Lendecke
d26028316d s3: Initialize "stored_callback" in dbwrap_cache
This should fix one of the recent flaky tests
2012-04-21 12:10:49 +02:00
Volker Lendecke
13774a5f9f s3: Remove two unused variables 2012-04-21 12:10:37 +02:00
Michael Adam
c0ba8295f2 s3:smbcontrol: remove an unused variable
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Sat Apr 21 00:55:13 CEST 2012 on sn-devel-104
2012-04-21 00:55:09 +02:00
Michael Adam
8e690ed3cf s3:memcache: remove the idmap-part from memcache
This was useful before the idmap cache was moved to gencache.
Nowadays it is available to smbd through gencache, so we
can remove the extra caching layer.
2012-04-20 23:17:36 +02:00
Michael Adam
499e7372be s3:id_cache: do not use the in-memory idmap cache (it is going to be removed)
This also removes the ID_CACHE_FLUSH message.
2012-04-20 23:17:36 +02:00
Michael Adam
c89affbd8d s3:passdb: do not use the in-memory idmap cache (it will be removed) 2012-04-20 23:17:36 +02:00
Stefan Metzmacher
3f00295f5e s3-dbwrap: dbwrap_watch_record_stored => NT_STATUS_NOT_FOUND is ok...
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Apr 20 17:05:52 CEST 2012 on sn-devel-104
2012-04-20 17:05:52 +02:00
Volker Lendecke
1be6d849ab s3-g_lock: Use dbwrap_record_watch_send/recv
This simplifies the g_lock implementation. The new implementation tries to
acquire a lock. If that fails due to a lock conflict, wait for the g_lock
record to change. Upon change, just try again. The old logic had to cope with
pending records and an ugly hack into ctdb itself. As a bonus, we now get a
really clean async g_lock_lock_send/recv that can asynchronously wait for a
global lock. This would have been almost impossible to do without the
dbwrap_record_watch infrastructure.
2012-04-19 22:24:19 +02:00
Volker Lendecke
1b5b38a615 s3-dbwrap: Add "listwatchers" to dbwrap_tool 2012-04-19 22:24:19 +02:00
Volker Lendecke
99fa29ae09 s3-dbwrap: Add dbwrap_record_watch_send/recv
With this API you can asynchronously wait for a record to be modified
2012-04-19 22:24:18 +02:00
Volker Lendecke
61c97506e8 s3-dbwrap: Add dbwrap_set_stored_callback
This is a per-db function that is called whenever some record is modified
2012-04-20 13:42:40 +02:00
Volker Lendecke
8e5b11bc14 s3-dbwrap: Add "db_context" to "db_record" 2012-04-20 13:42:40 +02:00
Volker Lendecke
0f20ffbcbd s3-dbwrap: Add dbwrap_db_id
This returns a blob uniquely identifying the database
2012-04-20 13:42:40 +02:00
Volker Lendecke
e3de5e4fb6 s3: Fix msg_channel in the cluster case 2012-04-20 13:42:40 +02:00
Volker Lendecke
5ca8422d02 s3: Remove an unused variable
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Apr 20 12:44:20 CEST 2012 on sn-devel-104
2012-04-20 12:44:20 +02:00
Volker Lendecke
393936aee6 s3: Fix Coverity ID 2682 -- NULL_RETURNS
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Apr 19 22:28:34 CEST 2012 on sn-devel-104
2012-04-19 22:28:34 +02:00
Volker Lendecke
3f18316358 s3: Fix Coverity ID 2727 to 2740 -- UNINIT 2012-04-19 20:52:27 +02:00
Volker Lendecke
e573f11468 s3: Fix Coverity ID 2686 -- RESOURCE_LEAK 2012-04-19 20:52:27 +02:00
Volker Lendecke
e58f03c91a s3: Fix the build on FreeBSD
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Apr 19 19:13:45 CEST 2012 on sn-devel-104
2012-04-19 19:13:45 +02:00
Volker Lendecke
0b1f3aea27 s3: Fix Coverity ID 2682: NULL_RETURNS 2012-04-19 17:37:39 +02:00
Volker Lendecke
7011d7ef18 s3: Fix Coverity ID 2743: CHECKED_RETURN 2012-04-19 17:37:38 +02:00
Volker Lendecke
f1c90e12f5 s3: Fix Coverity ID 2744: CHECKED_RETURN 2012-04-19 17:37:38 +02:00
Volker Lendecke
85c1e895a5 s3: Fix Coverity ID 2745 and 2746: FORWARD_NULL
We can assume that the rbt dbs are around
2012-04-19 17:37:37 +02:00
Volker Lendecke
8173331150 s3: Fix Coverity ID 2747: FORWARD_NULL
For the notify cleanup process we have a notify context without a
messaging entry. We will never call notify_add/remove for this, but
the code should protect against this.
2012-04-19 17:37:37 +02:00
Volker Lendecke
dc3b796260 s3: Attempt to fix Coverity ID 2748: INTEGER_OVERFLOW
Not sure this will actually please Coverity, but it fixes a severe bug
2012-04-19 17:37:37 +02:00
Volker Lendecke
ee8d55622f s3: Fix Coverity ID 2749: REVERSE_INULL 2012-04-19 17:37:37 +02:00
Andrew Bartlett
84ad848c86 s3-xattr_tdb: Remove dead code: talloc_stackframe() cannot fail
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr 19 14:15:42 CEST 2012 on sn-devel-104
2012-04-19 14:15:41 +02:00
Andrew Bartlett
00d493b00c s3-dbwrap: Remove dead code: talloc_stackframe() cannot fail 2012-04-19 12:34:33 +02:00
Andrew Bartlett
4471778d78 s3-passdb: Remove unused sampass->pass_must_change_time
There is no need to call pdb_set_pass_must_change_time() because
nothing ever consults that value.  It is always calculated from the
domain policy.

Also, this means we no longer store the value in LDAP.  The value
would only ever be set when migrating from tdbsam or smbpasswd, not on
password changes, so would become incorrect over time.

Andrew Bartlett
2012-04-19 12:34:33 +02:00
Volker Lendecke
9ce9389b29 s3: Fix a "ISO C90 forbids mixed declarations and code"
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Apr 19 10:32:27 CEST 2012 on sn-devel-104
2012-04-19 10:32:27 +02:00
Jeremy Allison
124be4cf88 Ensure we have 12 bytes of data for a SMB_SET_CIFS_UNIX_INFO call. Add debug. 2012-04-18 12:38:52 -07:00
Volker Lendecke
0021fc17e4 s3-dbwrap: Fix an unused var warning 2012-04-18 18:16:27 +02:00
Volker Lendecke
536c4a41a1 libsmb: Actually use an introduced variable
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Wed Apr 18 13:39:53 CEST 2012 on sn-devel-104
2012-04-18 13:39:53 +02:00
Andrew Bartlett
44b6bf9130 s3-xattr_tdb: Use talloc_stackframe() more to allow calling from common code 2012-04-18 12:05:00 +10:00
Andrew Bartlett
492942a66a s3-xattr_tdb: Be nice to xattr_tdb_getxattr callers, return the full blob
In this case, the blob is already in memory, so it is easier to return the full
blob to the caller, and let the caller decide if some interface restriction
stops the full blob from being passed all the way up the stack.

This allows us to quickly write a python wrapper for this xattr storage
mechanism.

Andrew Bartlett
2012-04-18 12:05:00 +10:00
Andrew Bartlett
351c78fc67 s3-xattr_tdb: make xattr_tdb a private library, for use outside vfs_xattr_tdb 2012-04-18 12:05:00 +10:00
Andrew Bartlett
ce9676839b s3-lib: Add file_id_string() 2012-04-18 12:05:00 +10:00
Andrew Bartlett
ea5a9b21fb s3-build: move file_id.c into samba3-util and create a private header 2012-04-18 12:05:00 +10:00
Andrew Bartlett
19fb796960 dbwrap: Add dbwrap_tdb to private dbwrap library
Andrew Bartlett
2012-04-18 12:05:00 +10:00
Andrew Bartlett
ee695de1b4 s3-build: Add missing samba3-util dep to tdb-wrap3 2012-04-18 12:05:00 +10:00
Andrew Bartlett
cc86f8e985 lib/util: Move map_nt_error_from_tdb to the top level
This will help with making dbwrap available as a top level library.

Andrew Bartlett
2012-04-18 12:04:59 +10:00
Andrew Bartlett
338e5a1d35 s3-dbwrap: push lp_ctx up another layer in the stack
This will allow db_open_tdb() to be called from common code, which may
already have a loadparm context loaded.

It also slowly moves the lp_ctx up the stack, as required to remove
the library loop between smbconf and the registry.

Andrew Bartlett
2012-04-18 12:04:59 +10:00
Andrew Bartlett
235016bcf9 s3-dbwrap: Add talloc_stackframe() calls
This is in preperation for calling dbwrap from common code, where we may not
have a stackframe set up.

Andrew Bartlett
2012-04-18 12:04:59 +10:00
Andrew Bartlett
99caee5eef build: Remove more of the s3 special cases in waf: only pidfile.c needs -DCONFIGFILE 2012-04-18 12:04:59 +10:00
Andreas Schneider
e3ffb31554 s3-waf: Add possibility to build with system libsmbclient. 2012-04-17 16:17:35 +02:00
Andreas Schneider
c09c288f7c s3-waf: Fix client/smbclient dependencies. 2012-04-17 16:17:35 +02:00
Stefan Metzmacher
1334ed723e s3:libsmb/cliconnect: make use of ntlmssp_is_anonymous()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Apr 17 16:16:51 CEST 2012 on sn-devel-104
2012-04-17 16:16:51 +02:00
Stefan Metzmacher
3207c7f965 s3:libsmb/ntlmssp: improve anonymous logins
smbtorture3 (and maybe others) use fstrings for 'user' and 'password',
so we need to check for empty strings.

metze
2012-04-17 14:42:32 +02:00
Stefan Metzmacher
941a6a7851 s3:libsmb/ntlmssp: add ntlmssp_is_anonymous()
metze
2012-04-17 14:42:31 +02:00
Stefan Metzmacher
cb3cde9518 s3:libsmb/ntlmssp: remove some indentation in ntlmssp_set_password()
metze
2012-04-17 14:42:31 +02:00
Stefan Metzmacher
5f0f5b3615 Revert "s3:libsmb/ntlmssp: an empty string should mean no password"
This reverts commit 92483eee25.
2012-04-17 14:42:31 +02:00
Volker Lendecke
8ed7ff483c s3: Add smbstatus -N to output the notify db
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Apr 17 11:54:35 CEST 2012 on sn-devel-104
2012-04-17 11:54:35 +02:00
Volker Lendecke
ee4f2abbda s3: Add "notify-cleanup" to smbcontrol
This triggers a notify cleanup run which would normally only run periodically
2012-04-17 10:21:03 +02:00
Volker Lendecke
843432d56f s3: New notify implementation
From notify_internal.c:

        /*
         * The notify database is split up into two databases: One
         * relatively static index db and the real notify db with the
         * volatile entries.
         */

This change is necessary to make notify scale better in a cluster
2012-04-17 10:21:02 +02:00
Volker Lendecke
ae691cd9cc s3: Add two notify benchmark tests 2012-04-17 10:21:02 +02:00
Volker Lendecke
842b86c45f s3: Make torture_nprocs globally available 2012-04-17 10:21:02 +02:00
Volker Lendecke
0b501e823f s3: Make ctdbd_messaging_send_blob available in non-clustered mode
This will avoid the need for some #ifdefs
2012-04-17 10:21:02 +02:00
Volker Lendecke
a03a74c353 s3: Make messaging_ctdbd_connection available in non-clustered mode
This might make some #ifdef CLUSTER_SUPPORT unnecessary in the future
2012-04-17 10:21:02 +02:00
Volker Lendecke
b23b357557 s3: Implement tevent_barrier
This will help notify torture tests: A tevent barrier can be waited on with
tevent_barrier_wait_send/recv. The barrier is initialized with a number of
requests that it will accept waiting. When that number is reached, all those
requests will be released and their callback will be called. The barrier will
be free for re-use again.
2012-04-17 10:21:02 +02:00
Volker Lendecke
d705bae65b s3: Start a list of ctdb srvid assigments 2012-04-17 10:21:01 +02:00
Volker Lendecke
05ff425c17 s3: Introduce ctdb_messaging_send_blob
Send a raw blob without the messaging.idl wrap
2012-04-17 10:21:01 +02:00
Volker Lendecke
74baae782f s3: Add msg_channel
This is a tevent_based variant of messaging_register
2012-04-17 10:21:01 +02:00
Volker Lendecke
41712599e0 s3: Add messaging_tdb_event()
This is a void* that represents a signal handler attached to some
custom tevent_context. This is necessary to make the tdb based
messaging infrastructure trigger its business when we are sitting in
tevent_loop_once for an event context that is not the main one in the
messaging context.
2012-04-17 10:21:01 +02:00
Volker Lendecke
48a485b639 s3: Add a second ctdb connect library
The existing one is not async at all.
2012-04-17 10:21:01 +02:00
Volker Lendecke
94cf5cc284 s3: Add dbwrap_try_fetch_locked
This is designed to spread the load on individual ctdb records to allow upper
layers to do backoff mechanisms. In the ctdb case, do not get the record if a
local lock is already taken. If we are not dmaster, do at most one migrate
attempt.

For the tdb case, this is a nonblocking fetch_locked. If someone else has the
lock, give up.
2012-04-17 10:21:00 +02:00
Volker Lendecke
bd9178506e s3: Add dbwrap_cache
This is a caching layer for the notify database and potentially for the brlock
database. It caches the parse_record operation as long as the underlying seqnum
does not change.
2012-04-17 10:21:00 +02:00
Volker Lendecke
ba8f19c556 s3: Open up 3 levels of dbwrap_lock_order 2012-04-17 10:21:00 +02:00
Volker Lendecke
d2fe0bf776 s3: Increase debuglevel for unknown child msgs
Now that we have forked background jobs, this spams log.smbd
2012-04-17 10:21:00 +02:00
Volker Lendecke
1e1b6f79b3 s3: Add infrastructure for background jobs 2012-04-17 10:21:00 +02:00
Volker Lendecke
a49ac23a10 s3: Return CTDB_PATH from lp_ctdbd_socket()
All callers had that fallback
2012-04-17 10:21:00 +02:00
Christian Ambach
d642afa7f1 s3: switch off kernel oplocks by default
as discussed on samba-technical, turn kernel oplocks off by default
to not leave users without the benefits of Level II oplocks
2012-04-16 21:28:36 +02:00
Volker Lendecke
a8e9242a10 s3: Fix smbclient notify against Windows
We need READ_DATA

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Mon Apr 16 21:27:54 CEST 2012 on sn-devel-104
2012-04-16 21:27:54 +02:00
Jelmer Vernooij
dd0b8792a0 s3/selftest: Fix reference to knownfail file. 2012-04-16 16:30:18 +02:00
Stefan Metzmacher
66d7553b0e s3:libsmb: fix anonymous session setups against windows servers
Windows server doesn't set the SMB2_SESSION_FLAG_IS_GUEST nor
SMB2_SESSION_FLAG_IS_NULL flag.

This fix makes sure we don't try to verify a signature on the
final session setup response.

metze
2012-04-16 12:54:54 +02:00
Stefan Metzmacher
92483eee25 s3:libsmb/ntlmssp: an empty string should mean no password
metze
2012-04-16 12:54:53 +02:00
Stefan Metzmacher
b0939c5774 libcli/smb: move smb2cli_session_setup_*() prototypes to the code.
metze
2012-04-16 12:54:53 +02:00
Stefan Metzmacher
1e7f8d5ad0 s3:smbd/sesssetup: use a helper variable 'action' to mark guest access
metze
2012-04-16 10:39:50 +02:00
Andrew Bartlett
4d872ff77f param: leave realm as a normal string, handle upper/lower case in handle_realm
This matches the behaviour of lib/param.

Andrew Bartlett
2012-04-16 14:35:34 +10:00
Andrew Bartlett
db44f35fc3 param: harmonise wins parameters 2012-04-16 14:35:34 +10:00
Andrew Bartlett
2b348123a7 s3-param: make FN_GLOBAL macros consistent, add lp_ using the macro
This will make it easier to share the parameter tables between this
and lib/param.

Andrew Bartlett
2012-04-16 14:32:38 +10:00
Andrew Bartlett
0eacc47622 param: Change from _lp to lp__ as the prefix for internal parameter wrappers
This will make a merge with the lib/param param code easier, as we can then paste lp_ to the front of
all parameters unconditionally.

Andrew Bartlett
2012-04-16 14:32:38 +10:00
Andrew Bartlett
cf28df1d90 make _lp_readraw() and _lp_writeraw() static 2012-04-16 14:32:38 +10:00
Andrew Bartlett
acb64471b3 param: harmonsise logfile parameter 2012-04-16 14:32:37 +10:00
Adrian Bunk
55cbf7ba34 rely on sys/inotify.h for inotify
sys/inotify.h was added to glibc 2.4 in 2006.

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Apr 13 21:15:00 CEST 2012 on sn-devel-104
2012-04-13 21:15:00 +02:00
Olaf Flebbe
b8dea7e82d Wrong assertion/comparison: Compare value not pointer
Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Apr 13 02:23:36 CEST 2012 on sn-devel-104
2012-04-13 02:23:35 +02:00
Jeremy Allison
da786cddd6 We never cancel SMB1 aio, only SMB2 aio - and in this case we always return a value.
So pass_cancel is no longer needed.
2012-04-12 15:11:22 -07:00
Jeremy Allison
d399af30c1 Remove cancel_aio_by_fsp(). It can never work and could lead to memory corruption
as outstanding IO's complete. Also we never have any aio's on a call to close_normal_file()
with close_type ERROR_CLOSE.
2012-04-12 15:06:59 -07:00
Jeremy Allison
fd38486364 Fix return_fn when aio was cancelled. We need to return -1, errno = ECANCELED. 2012-04-12 15:06:59 -07:00
Jeremy Allison
95839102ad Move the counting of outstanding_aio_calls into the lifecycle of the aio_extra struct.
This way we can't end up with a mismatch between outstanding events and the counter.

We may still have problems with canceling and not correctly freeing the aio
struct, but at least the counter won't get out of sync anymore.
2012-04-12 15:06:58 -07:00
Jeremy Allison
80a4e38d64 Fix the same bug reported by Kirill Malkin <kirill.malkin@starboardstorage.com> and
fixed by Volker for vfs_aio_fork as ref 0aacdbfada.

From that change:

    aio_suspend does not signal the main process with a signal, it just waits. The
    aio_fork module does not use the signal at all, it directly calls back into the
    main smbd by calling smbd_aio_complete_aio_ex. This is an abstraction
    violation, but the alternative would have been to use signals where they are
    not needed. However, in wait_for_aio_completion this bites us: With aio_fork we
    call handle_aio_completed twice on the same aio_ex struct: Once from the call
    to handle_aio_completion within the aio_fork module and once from the code in
    wait_for_aio_completion.

Fix this differently here by not calling directly back into smbd,
but using a new function aio_linux_setup_returns() to setup the
return values that wait_for_aio_completion() in the main smbd
will pick up by calling handle_aio_completd().
2012-04-12 15:06:58 -07:00
Volker Lendecke
f6328b14c8 s3: Fix a typo
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Apr 12 23:38:24 CEST 2012 on sn-devel-104
2012-04-12 23:38:23 +02:00
Volker Lendecke
6742aa1fb6 s3: Fix a segfault with debug level 3 on Solaris
printf can not deal with NULL strings
2012-04-12 21:49:32 +02:00
Simo Sorce
1f1e4275b5 clikrb5: Move pure krb wrapper functions from libads to clikrb5.
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-12 12:06:43 +02:00
Simo Sorce
46ab219005 gse: Remove unnecessary header.
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-12 12:06:43 +02:00
Simo Sorce
c13c065a9b krb5_wrap: krb5_string_to_key / krb5_encrypt_block are deprecated.
Remove checks and replace with krb5_c_string_to_key().

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-12 12:06:43 +02:00
Simo Sorce
70c303a7f3 auth-krb: Move pac related util functions in a single place.
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-12 12:06:43 +02:00
Simo Sorce
3fd6deda7d auth-krb: Make functions static.
The remaining gssapi_parse functions were used exclusively in
gensec_krb5.  Move them there and make them static.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-12 12:06:43 +02:00
Simo Sorce
88d5d5c4b4 auth-krb: Nove oid packet check to gensec_util.
This is clearly a utiliy function generic to gensec.  Also the 3 callers
had identical implementations. Provide a generic implementation for all
of them and avoid duplicating the code everywhere.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-12 12:06:42 +02:00
Günther Deschner
60f192ae10 s3-waf: remove requirement of having --enable-developer for running system krb5 checks.
When you know about "with_mit_krb5_checks" you are most likely a developer
already.

Guenther

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-12 12:06:41 +02:00
Jeremy Allison
81d17493d6 Remove overly complex attemt to define blkcnt_t and blksize_t. AC_CHECK_TYPE should just do it.
Still trying to fix the buildfarm.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Apr 12 04:28:29 CEST 2012 on sn-devel-104
2012-04-12 04:28:29 +02:00
Jeremy Allison
2216d3f08a Try and fix autoconf on the build farm. Always include sys/types.h when working out sizeof(blkcnt_t). 2012-04-11 17:11:28 -07:00
Christian Ambach
2927ca3670 s3:smbd only care about missing level2 support if kernel oplocks are enabled
if kernel oplocks are not enabled for that share, we can grant level2 oplocks

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Apr 11 22:45:21 CEST 2012 on sn-devel-104
2012-04-11 22:45:21 +02:00
Christian Ambach
fbfbc6a252 s3:smbd only initialize kernel oplocks if they are enabled for a share
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-04-11 11:11:40 -07:00
Christian Ambach
1d9a3d488d s3:smbd add seperate function to initialize kernel oplocks
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-04-11 11:11:39 -07:00
Christian Ambach
2a36408d40 s3:param convert kernel oplocks to share parameter
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-04-11 11:11:39 -07:00
Jeremy Allison
e02a788f60 Simplify the logic around doing an immediate event reschedule.
We don't need to do a talloc here, we already have a long-lived
pointer we can pass in as the private data.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Apr 11 08:05:47 CEST 2012 on sn-devel-104
2012-04-11 08:05:47 +02:00
Andrew Bartlett
f446506608 remove --enable-developer from recursive waf build in autoconf build
wanting to run make test does not make you a developer in need of ABI checking.

Andrew Bartlett
2012-04-11 02:30:39 +02:00
Andrew Bartlett
f7d60899d6 build: Add tevent deps for users of tevent calls
This isn't strictly required - this isn't a build break at the moment,
but is a good practice to directly depend on the major libraries we
use, and helps us to have more fine-grained rather than global
dependencies.

Andrew Bartlett
2012-04-11 02:30:39 +02:00
Jeremy Allison
fe707f6549 Add a new module, aio_linux which implements Linux kernel aio support. Docs to follow.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Apr 11 02:29:04 CEST 2012 on sn-devel-104
2012-04-11 02:29:04 +02:00
Volker Lendecke
3cca094514 s3: Use talloc_get_size instead of strlen
We've just talloc_asprintf'ed the fullpath, so talloc_get_size knows the
strlen.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Apr 10 13:20:22 CEST 2012 on sn-devel-104
2012-04-10 13:20:22 +02:00
Jeremy Allison
d425a4cd3d On advice from Jelmer and Andrew, move the blksize_t and blkcnt_t tests into libreplace to make it standalone.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Apr 10 04:07:11 CEST 2012 on sn-devel-104
2012-04-10 04:07:11 +02:00
Jeremy Allison
5701a4d861 Move blksize_t and blkcnt_t to replace.h from includes.h. Should help with platforms that don't have these.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Apr  9 21:40:42 CEST 2012 on sn-devel-104
2012-04-09 21:40:40 +02:00
Volker Lendecke
8a907c9c65 s3: Fix the pthreadpool build on OS/X
OS/X does not have clock_gettime, and without replace.h we do not
get the replacement macro
2012-04-09 18:05:02 +02:00
Volker Lendecke
5856ab89fa s3: Initialize aio_pending_size from aio_pthread 2012-04-09 18:05:01 +02:00
Volker Lendecke
5f3ac4d6c4 s3: Initialize aio_pending_size from aio_pthread 2012-04-09 18:05:01 +02:00
Volker Lendecke
eff36099c1 s3: Move the aio signal init to the vfs module
On platforms that don't have an RT signal space, signal initialization
fails. aio_fork and aio_pthread don't need the signal, so this would
block them from running as well.
2012-04-09 18:04:55 +02:00
Volker Lendecke
5138b1f7fb s3: Compile fix for dbwrap_file.c
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Apr  7 14:10:35 CEST 2012 on sn-devel-104
2012-04-07 14:10:35 +02:00
Jeremy Allison
989fc20fc3 Found whilst back-porting the fix for bug 8837 - smbd crashes when deleting directory and veto files are enabled.
The delete tokens are unique to each name hash representing a pathname,
if we don't correctly return here we'll add duplicate tokens for a
given pasname hash.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Apr  7 02:13:58 CEST 2012 on sn-devel-104
2012-04-07 02:13:58 +02:00
Jeremy Allison
a92c532573 Bug found by Herb. blkcnt_t st_ex_blksize is defined as a signed value. When it is
on a 32-bit system and defined as a long, then inside vfswrap_get_alloc_size()
we cast to a uint64_t. This sign-extends when converting to unsigned,
so if the high bit of st_ex_blksize is set we return insane values to clients.
2012-04-06 14:20:12 -07:00
Björn Baumbach
7ff42f3746 s3-utils: add do_reload_printers command to smbcontol
Add command to force smbd to reload printers by sending MSG_PRINTER_PCAP.
2012-04-06 08:19:13 +02:00
Andrew Bartlett
6aa12fcb30 build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr  6 01:47:43 CEST 2012 on sn-devel-104
2012-04-06 01:47:43 +02:00
Andrew Bartlett
48166468fe s3-build: Remove unused configure checks for xattr functions
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr  5 07:13:29 CEST 2012 on sn-devel-104
2012-04-05 07:13:28 +02:00
Andrew Bartlett
19eee33d82 s3-vfs: Remove unused lremovexattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to removexattr.

Andrew Bartlett
2012-04-05 13:39:01 +10:00
Andrew Bartlett
4af0f5f135 s3-build: Remove unused configure checks for xattr functions 2012-04-05 13:39:00 +10:00
Andrew Bartlett
c70ac29c54 s3-vfs: Remove unused lsetxattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to listxattr.

Andrew Bartlett
2012-04-05 13:39:00 +10:00
Andrew Bartlett
c5b17c5555 s3-vfs: Remove unused llistxattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to listxattr.

Andrew Bartlett
2012-04-05 13:39:00 +10:00
Andrew Bartlett
b2f7cfa848 s3-vfs: Remove unused lgetxattr call from VFS modules, system.c and configure 2012-04-05 13:39:00 +10:00
Andrew Bartlett
22d9450100 build: Remove unused GLIBC_HACK_FCNTL64
This is not set from anywhere, and refers to Red Hat 7.0, which is
really, really old now.

Andrew Bartlett
2012-04-05 02:39:09 +02:00
Andrew Bartlett
bd534bd522 build: Fix sys_open() removal by including system/filesys.h 2012-04-05 02:39:09 +02:00
Andrew Bartlett
1ac7f071ce build: Remove SMB_F* locking defines 2012-04-05 02:39:09 +02:00
Andrew Bartlett
6098f8d80c build: Remove SMB_STRUCT_FLOCK define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
f6e0532024 build: Remove SMB_STRUCT_DIR define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
2320b2144f build: Remove SMB_STRUCT_DIRENT define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
6edd8e95f1 build: Remove sys_rewinddir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
3e8a6e5760 build: Remove sys_closedir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
ecc822faf8 build: Remove sys_telldir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
900473a45b build: Remove sys_seekdir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
afdb78075c build: Remove sys_readdir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
fe526bb32b build: Remove sys_opendir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
b74fe73a6f build: Remove sys_fopen wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
d166b79852 build: Remove sys_open wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
9cc056e567 build: Remove sys_creat wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
ced1f61ec1 build: Remove fallback call to sys_open as HAVE_CREAT is not actually checked for 2012-04-05 02:39:08 +02:00
Andrew Bartlett
7fa1b878c1 build: Remove sys_ftell wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
43e9be8894 build: Remove sys_lseek wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
5c89d12ca4 build: Remove sys_ftruncate wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
e1b7a5c750 build: combine off_t 64 bit and largefile test 2012-04-05 02:39:08 +02:00
Andrew Bartlett
96108eed10 build: #ifdef LARGE_SMB_OFF_T as off_t is now always 64 bits 2012-04-05 02:39:08 +02:00
Andrew Bartlett
214a668ff3 Remove off64_t declarations 2012-04-05 02:39:08 +02:00
Andrew Bartlett
694d81a7b5 build: Fix configure test that was declaring an off64_t 2012-04-05 02:39:08 +02:00
Andrew Bartlett
473b974a06 build: do not use HAVE_EXPLICIT_LARGEFILE_SUPPORT and *64() fucntions any more 2012-04-05 02:39:08 +02:00
Andrew Bartlett
b4e58111b9 build: Remove configure tests for *64 functions and types
We now use the standard types only.

Andrew Bartlett
2012-04-05 02:39:08 +02:00
Andrew Bartlett
d5c7de8650 build: Require 64-bit files support and do not define HAVE_EXPLICIT_LARGEFILE_SUPPORT 2012-04-05 02:39:08 +02:00
Andrew Bartlett
db1f277979 build: use only standard _FILE_OFFSET_BITS=64 macro for large files
(We also already use any other macro as set by getconf LFS_CFLAGS, and
the standard AC_SYS_LARGEFILE macro in libreplace).

This is instead of using the transitional *64 posix largefile API

Andrew Bartlett
2012-04-05 02:39:08 +02:00
Jeremy Allison
704ea4729b Third part of fix for bug #8837 - smbd crashes when deleting directory and veto files are enabled.
Use correct check to see if veto files has been enabled. Even if not
set lp_veto_files() returns a valid string address (to a '\0' character).

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Apr  5 01:36:04 CEST 2012 on sn-devel-104
2012-04-05 01:36:04 +02:00
Jeremy Allison
c10ed730d4 Second part of bugfix for bug #8837 - smbd crashes when deleting directory and veto files are enabled.
Store the 'struct security_token' as well as the 'struct security_unix_token'
inside the locking db when setting a delete on close.
2012-04-04 14:58:42 -07:00
Jeremy Allison
f042de2f34 First part of fix for bug 8837 - smbd crashes when deleting directory and veto files are enabled.
Add some const to the sec_ctx code.
2012-04-04 14:58:42 -07:00
Andrew Bartlett
fba028afbd build: Remove checks for krb5_decode_ap_req, free_AP_REQ and KRB5_TICKET_HAS_KEYINFO
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Apr  3 19:19:33 CEST 2012 on sn-devel-104
2012-04-03 19:19:33 +02:00
Andrew Bartlett
bc3e52d9d0 build: Remove unused check for HAVE_KRB5_TKT_ENC_PART2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
e5684b3c6f s3-krb5 Remove unused get_kvno_from_ap_req()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
e01dc1c7bf s3-krb5 Remove unused get_enctype_from_ap_req
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
0e2d659c94 s3-krb5: Remove unused smb_krb5_get_keyinfo_from_ap_req()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
c89f3bf564 s3-krb5: Remove unused get_key_from_keytab
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
8c40253cc1 s3-krb5: remove unused unwrap_pac()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
296f7705f6 s3-krb5: remove unused get_auth_data_from_tkt
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
fc8c533aba s3-krb5: Remove unused get_authtime_from_tkt
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
b1c4f1ddfc s3-krb5: Remove unused krb5_rd_req_return_keyblock_from_keytab
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
cf30feef16 s3-krb5: Remove unused get_principal_from_tkt
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
e715460898 s3-libads: Remove ads_verify_ticket() as it is now unused
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
410ca7311a s3-libads: Rework kerberos_return_pac() to use GENSEC for the server-side
This removes the last user of ads_verify_ticket(), and means that we
only have one code path to verify an incoming krb5 (GSSAPI) ticket.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
4e3e323080 s3-libsmb: Remove unused spnego_parse_krb5_wrap()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
c7d29e8cda build: Reduce deps of ntlm_auth
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
1c7c432874 s3-ntlm_auth: use manage_gensec_request for squid-2.5-ntlmssp
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
f3b005e759 s3-auth: Order GENSEC mechs by priority, krb5 before NTLMSSP
Otherwise, really simple clients (such as the current ntlm_auth gss-spnego client)
will not select krb5.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
893387d25f s3-ntlm_auth: add ntlm_auth_generate_session_info_pac()
Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:32 +02:00
Andrew Bartlett
4ccac90793 s3-ntlm_auth Use GENSEC for gss-spnego server
This imports the gensec handling code from the source4 ntlm_auth, which
will eventually be used for all the NTLMSSP and SPNEGO clients and servers
but which is only used for gss-spnego for now.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-04-03 17:47:31 +02:00
Volker Lendecke
22a6497526 s3: Enhance the dbwrap needed x attempts msg
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Apr  3 15:17:11 CEST 2012 on sn-devel-104
2012-04-03 15:17:11 +02:00
Andrew Bartlett
da50ff7f84 s3-vfs: initial work on posix:eadb module
This is a module that, like vfs_xattr_tdb, stores extended attributes
in a DB on disk.  This uses the format needed to support the
posix:eadb smb.conf option.

Andrew Bartlett
2012-04-03 14:35:02 +10:00
Andrew Bartlett
8ef60901ce s3-vfs: Use new smb_load_module for better diagnostics 2012-04-03 14:25:12 +10:00
Andrew Bartlett
c363815809 s3-smbd: Inline init_modules() into only caller 2012-04-03 14:25:12 +10:00
Volker Lendecke
831a97c147 s3: Notifies should never time out
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Mon Apr  2 12:31:17 CEST 2012 on sn-devel-104
2012-04-02 12:31:17 +02:00
Volker Lendecke
0aacdbfada s3-aio-fork: Fix a segfault in vfs_aio_fork
aio_suspend does not signal the main process with a signal, it just waits. The
aio_fork module does not use the signal at all, it directly calls back into the
main smbd by calling smbd_aio_complete_aio_ex. This is an abstraction
violation, but the alternative would have been to use signals where they are
not needed. However, in wait_for_aio_completion this bites us: With aio_fork we
call handle_aio_completed twice on the same aio_ex struct: Once from the call
to handle_aio_completion within the aio_fork module and once from the code in
wait_for_aio_completion.

This patch fixes it in a pretty bad way by introducing flag variables and more
state. But the mid-term plan is to replace the posix aio calls from the vfs and
do pread_send/recv and pwrite_send/recv at the vfs layer, so this will
significantly change anyway.

Thanks to Kirill Malkin <kirill.malkin@starboardstorage.com> for reporting this
crash!

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Mar 31 15:25:55 CEST 2012 on sn-devel-104
2012-03-31 15:25:54 +02:00
Volker Lendecke
7f7c2d721d s3-aio-fork: Fix aio_suspend event hierarchy
We end up here multiple times. There's no real point putting the events into
the child struct, at the end of this routine we need to free them anyway.
2012-03-31 13:51:17 +02:00
Volker Lendecke
aef86982b8 s3-aio-fork: Fix an alignment warning on OS/X 2012-03-31 13:51:17 +02:00
Richard Sharpe
7d3c26e8cf Make sure we claim that a DACL or SACL is present if the SD says so
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Sat Mar 31 09:34:36 CEST 2012 on sn-devel-104
2012-03-31 09:34:35 +02:00
Jeremy Allison
d497434434 Who would have guessed - checking returns from strlcat found a memory overwrite bug :-). 2012-03-30 21:26:07 +02:00
Jeremy Allison
959516d61b More strlcat/strlcpy truncate checks. 2012-03-30 21:26:07 +02:00
Volker Lendecke
1e24997e3e s3: Avoid a crash with debug level 10
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Mar 30 16:52:16 CEST 2012 on sn-devel-104
2012-03-30 16:52:16 +02:00
Jeremy Allison
5df1c11539 Start to add truncate checks on all uses of strlcpy(). Reading lwn
has it's uses :-).

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar 29 20:48:15 CEST 2012 on sn-devel-104
2012-03-29 20:48:15 +02:00
Jeremy Allison
762928945d Based on code from Richard Sharpe <realrichardsharpe@gmail.com>,
ensure we don't crash on a NULL DACL.
2012-03-29 08:53:43 -07:00
Volker Lendecke
ed43a5a94f s3: Fix a valgrind error
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Mar 29 15:50:13 CEST 2012 on sn-devel-104
2012-03-29 15:50:13 +02:00
Richard Sharpe
3be2af1df9 Add DEBUG statements to show when access has been denied and why.
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Wed Mar 28 07:07:26 CEST 2012 on sn-devel-104
2012-03-28 07:07:26 +02:00
Volker Lendecke
fa6f61e835 s3: Pass filters explicitly through vfs notify watch
This removes a dependency on "struct notify_entry" and makes the nature of the
API more explicit. We depend upon the VFS module to mask out elements from
e->filter and e->subdir_filter that it took over to handle.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Mon Mar 26 17:45:44 CEST 2012 on sn-devel-104
2012-03-26 17:45:43 +02:00