1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

30542 Commits

Author SHA1 Message Date
Volker Lendecke
f0a933d140 s3: Cache brlock.tdb entries for the fast read&write strict locking code path
For a netbench run this gains around 2% user-space CPU, fetching a 100MB file
takes around 4% less.
2009-11-21 11:40:13 +01:00
Kai Blin
43ed7a413d ntlm_auth: use data_blob_talloc() to allocate session key
Thanks to Shibu Piriyath <shibunair80@ymail.com> for spotting the issue.
2009-11-21 07:29:33 +01:00
Jeremy Allison
54ba3f522b Fix logic bug where high bits tests was being
done on both Windows and POSIX mkdirs instead of
only on Windows mkdir (as intended). The variable
"file_attributes" had already had FILE_FLAG_POSIX_SEMANTICS
removed above in the function if it had already been set.
Jeremy.
2009-11-20 17:23:20 -08:00
Michael Adam
446ed18eb6 s3:fix endianness bug in dbwrap_change_int32_atomic() (bug #6901)
Michael
2009-11-21 00:49:29 +01:00
Michael Adam
4afffc96ee s3:fix endianness bug in dbwrap_change_uint32_atomic() (bug #6901)
Michael
2009-11-21 00:49:28 +01:00
Günther Deschner
eea5a166e7 s3-build: delete more object files for "make clean".
Guenther
2009-11-20 15:49:48 +01:00
Michael Adam
7153200f21 s3:idmap_ldap: trim the " chars from the location string in idmap_ldap_db_init
When idmap backend is specified as
idmap backend = ldap:"ldap://server1 ldap://server2"
then currently "ldap://server1 ldap://server2" was passed to
ldap_initialize including the quotes, leading to an ldap error.

Michael
2009-11-20 13:17:23 +01:00
Michael Adam
6a59db9a2e s3:idmap_ldap: trim the " chars from the location string in idmap_ldap_alloc_init
When idmap alloc backend is specified as
idmap alloc backend = ldap:"ldap://server1 ldap://server2"
then currently "ldap://server1 ldap://server2" was passed to
ldap_initialize including the quotes, leading to an ldap error.

Michael
2009-11-20 13:17:22 +01:00
Volker Lendecke
c4c984d97d s3: Avoid races to change the machine password in winbind
The machine password handler has code to deal with every node in the cluster
trying to change the machine password at the same time. However, it is not very
nice to the DC if everyone tries this simultaneously. This adds a random 0-255
second offset to our timed event. When this fires a bit later than strictly
calculated, someone else might have stepped in and have already changed it. The
timed event handler will handle this gracefully, it won't even try to do it
again.
2009-11-19 19:04:39 +01:00
Volker Lendecke
882350b0ab s3: Protect against flooding the DC with pwchange requests
When there is a temporary problem changing passwords we flooded the DC with
pwchange requests. This gives the DC a 60-second break to recover.
2009-11-19 19:04:39 +01:00
Volker Lendecke
4d0ebc90dc s3: Re-check the timeout in machine_password_change_handler()
Someone else might have come in between and changed the password since we
created that timed request
2009-11-19 19:04:39 +01:00
Volker Lendecke
d0ef9fbce6 s3: Add some debugs to the winbind machine pwchange machinery 2009-11-19 19:04:39 +01:00
Volker Lendecke
d3d37acb99 s3: Factor timeval_string out of current_timestring() 2009-11-19 19:04:38 +01:00
Volker Lendecke
d4312e776b s3: Do not kill the whole smb session if a machine pwchange failed 2009-11-19 19:04:38 +01:00
Michael Adam
557535302c s3:pdb_ldap: fix a comment typo
Michael
2009-11-19 17:55:47 +01:00
Michael Adam
457055871a s3: shortcut uid_to_sid when "ldapsam:trusted = yes"
The normal uid_to_sid behaviour is to call sys_getpwuid()
to get the name for the given uid and then call the
getsampwnam passdb method for the resulting name.

In the ldapsam:trusted case we can reduce the uid_to_sid
operation to one simple search for the uidNumber attribute
and only get the sambaSID attribute from the correspoinding
LDAP object. This reduces the number of ldap roundtrips
for this operation.

Michael
2009-11-19 17:55:47 +01:00
Günther Deschner
fc9f199f26 s3-build: really fix build of winbind_krb5_locator.
Guenther
2009-11-19 13:48:44 +01:00
Günther Deschner
bf45447aaa s3-build: make sure to remove libds and client object files on make clean.
Guenther
2009-11-19 13:48:33 +01:00
Volker Lendecke
d1c34d4054 s3: Replace some create_synthetic_smb_fname() calls
In very hot codepaths like the statcache copy_smb_filename and the subsequent
recursive talloc_free is noticable in the CPU load.
2009-11-18 23:16:13 +01:00
Volker Lendecke
f6650f5d19 s3: Do not talloc in readdir
This is a hot codepath (called from the stat cache)
2009-11-18 23:16:13 +01:00
Michael Adam
aea3a8f501 s3:load_interfaces(): use function gfree_interfaces() that we have.
To reduce code duplication.

Michael
2009-11-18 22:19:18 +01:00
Jeremy Allison
7407b526e3 Start removing SMB_STRUCT_STAT variables except for
the directory enumeration code (which needs it).
Jeremy.
2009-11-17 16:06:08 -08:00
Jeremy Allison
a770caed0f Remove "store create time" code, cause create time to be stored
in the "user.DOSATTRIB" EA. From the docs:
In Samba 3.5.0 and above the "user.DOSATTRIB" extended attribute has been extended to store
the create time for a file as well as the DOS attributes. This is done in a backwards compatible
way so files created by Samba 3.5.0 and above can still have the DOS attribute read from this
extended attribute by earlier versions of Samba, but they will not be able to read the create
time stored there. Storing the create time separately from the normal filesystem meta-data
allows Samba to faithfully reproduce NTFS semantics on top of a POSIX filesystem.
Passes make test but will need more testing.
Jeremy.
2009-11-17 14:55:02 -08:00
Volker Lendecke
b1ed9a8963 s3: Fix the build on Solaris 2009-11-17 15:16:28 +01:00
Jeremy Allison
a2a8dc515c Don't overwrite a dynamic pointer with the address of a stack
variable.
Jeremy.
2009-11-16 14:55:21 -08:00
Stefan Metzmacher
0762893c48 s3:libsmb: avoid passing a function call as function parameter
Using a helper variable makes it easier to "step" into the desired function
within gdb.

metze
2009-11-16 10:13:05 +01:00
Volker Lendecke
bf4e8ba048 s3: Fix a memleak in sys_popen
Found with "dfree command" set
2009-11-15 12:49:47 +01:00
Volker Lendecke
f4cf1c56a2 s3: Add min_setup, min_param and min_data to cli_trans_recv
Every caller that expects to receive something needs to check if enough was
sent. Make this check mandatory for everyone.

Yes, this makes the parameter list for cli_trans a bit silly, but that's just
the way it is: A silly protocol request :-)

While there, convert some _done functions to tevent_req_simple_finish_ntstatus.
2009-11-14 12:20:12 +01:00
Volker Lendecke
4a777ec4d7 Attempt to fix the s4 build -- we can not use map_nt_error_from_unix in lib/ 2009-11-14 11:32:38 +01:00
Volker Lendecke
f668e4104f s3: Convert cli_set_unix_extensions_capabilities_send to async 2009-11-14 11:03:28 +01:00
Volker Lendecke
6133ab6055 s3: Tiny logic simplification 2009-11-14 11:03:28 +01:00
Michael Adam
0ac3c1693c s3:fix a comment typo
Michael
2009-11-14 01:28:58 +01:00
Michael Adam
2e3d9abeaf s3:is_trusted_domain: shortcut if domain name == global_sam_name
A domain can't have a trust with itself.
This saves some roundtrips to the ldap server for ldapsam.

Michael
2009-11-14 01:28:57 +01:00
Michael Adam
144c23893e s3:is_trusted_domain: shortcut if domain name is NULL or empty
This saves some roundtrips to LDAP in an ldapsm setup.

Michael
2009-11-14 01:28:57 +01:00
Michael Adam
7e418bf736 s3:passdb: bump interface VERSION 18->19 (removed uid_to_rid)
Michael
2009-11-14 01:28:57 +01:00
Michael Adam
30ab3a762e s3:passdb: remove the uid_to_rid method - we only need uid_to_sid
Michael
2009-11-14 01:28:50 +01:00
Michael Adam
3b7448de14 s3:pdb_default_uid_to_sid: fix some debug statements.
Michael
2009-11-14 01:27:45 +01:00
Björn Jacke
ec49f28a52 s3/pam: move variable declaration into belonging ifdef section
This fixes a unused variable 'addr' warning on some platforms
2009-11-13 23:32:04 +01:00
Michael Adam
1e3c4b381a s3:smbd: also fill the memcache with sid<->id mappings in ldapsam_sid_to_id()
not only the persistent idmap cache.

Michael
2009-11-13 16:19:32 +01:00
Michael Adam
d2673253e3 s3:smbd: make idmap cache persistent for "ldapsam:trusted".
This stores the mappings found in the idmap cache (which lives
inside gencache). This cache is already read in sid_to_Xid()
and Xid_to_sid() for ldapsam:trusted, this fills the opposite
direction, massively reducing the number of ldap roundtrips
across smbd restarts.

Michael
2009-11-13 16:19:31 +01:00
Volker Lendecke
1220534716 Fix large paged search
Signed-off-by: Michael Adam <obnox@samba.org>
2009-11-13 11:36:06 +01:00
Volker Lendecke
92a16b91e8 fix bogus "out of memory" winbind msg
Signed-off-by: Michael Adam <obnox@samba.org>
2009-11-13 11:36:06 +01:00
Volker Lendecke
f9ad5cd133 s3: Convert cli_unix_extensions_version to async 2009-11-13 09:30:30 +01:00
Günther Deschner
3732798008 s3-rpcclient: use the parsed binding string flags for auth choice.
This allows rpcclient to be called like this:

rpcclient ncacn_ip_tcp:w2k8r2[sign,seal] -U administrator%secret -c "dscracknames gd"

Guenther
2009-11-13 01:13:06 +01:00
Jeremy Allison
d2a9f4a272 Remove unused variable warning.
Jeremy.
2009-11-12 14:09:25 -08:00
Jeremy Allison
0363713031 Remove erroneous 'presult = NULL' changes. Now presult only gets set
if NTSTATUS == OK.
Jeremy.
2009-11-12 13:59:25 -08:00
Jeremy Allison
496d147dc4 Revert "Ensure every return path initializes presult as NULL."
Vl is correct, this is the wrong way to fix this.

This reverts commit 83c2c177a5.
2009-11-12 13:57:13 -08:00
Jeremy Allison
5363d6e62c Ensure all callers to the rpc_client/cli_pipe functions correctly
initialize return variables.
Jeremy.
2009-11-12 13:56:33 -08:00
Jeremy Allison
6747a91ca0 Fix bug 6891 - using windows explorer to change ownership on a folder fails with Bad File Descriptor.
Jeremy.
2009-11-12 13:08:04 -08:00
Jeremy Allison
83c2c177a5 Ensure every return path initializes presult as NULL.
Ensures no crashes in calling code that forgets to
init return as null.
Jeremy.
2009-11-12 11:49:54 -08:00