1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00
Commit Graph

3395 Commits

Author SHA1 Message Date
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
f850ba5787 r23773: One pstring a day...
(This used to be commit 0c3016d32b)
2007-10-10 12:23:55 -05:00
Volker Lendecke
5daa21f558 r23768: Get rid of the three global variables for the case semantics. I think
this is really not worth globals.

Jeremy, please check for 3.0.26.
(This used to be commit 6e655500c0)
2007-10-10 12:23:55 -05:00
Volker Lendecke
c13f62a675 r23765: Another error-path restore_case_semantics().
(This used to be commit a3e5fe1693)
2007-10-10 12:23:54 -05:00
Volker Lendecke
a3f69f3710 r23764: Do restore_case_semantics in an error path. Jeremy, please check!
(This used to be commit 3b5422c9a4)
2007-10-10 12:23:54 -05:00
Volker Lendecke
ead70dc92e r23761: Rename reduce_name to check_reduced_name
The function name reduce_name is misleading, making the user believe it
changes an argument.
(This used to be commit 68234f0bc6)
2007-10-10 12:23:53 -05:00
Jeremy Allison
59590a1c4d r23752: Fix bug introduced by checkin 22920, allow large
readX. Fix from Dmitry Shatrov <dhsatrov@linux.vnet.ibm.com>.

"In send_file_readX(), if startpos > sbuf.st_size, then smb_maxcnt is set
to an invalid large value due to integer overflow.
As for me, this resulted in MS Word hanging while trying to save
a 1.5Mb document."

This isn't in shipping code.

Jeremy.
(This used to be commit af715c602a)
2007-10-10 12:23:52 -05:00
Volker Lendecke
c35d814e39 r23743: Simplify stat_cache_lookup() logic. For the history of this, see
http://article.gmane.org/gmane.network.samba.internals/32486.
(This used to be commit e5e42fe3d5)
2007-10-10 12:23:51 -05:00
Volker Lendecke
0e43c1e80d r23738: Re-add commented out code snipped that got lost by accident
(This used to be commit c38c31afb7)
2007-10-10 12:23:50 -05:00
Jeremy Allison
d3965a2689 r23736: Use local variable of smb_flag2 instead of using the macro every time.
Jeremy.
(This used to be commit 9e1663b1f1)
2007-10-10 12:23:50 -05:00
Jeremy Allison
10c83ace04 r23735: Second part of the bugfix for #4763
This should coalesce identical adjacent notify records - making the "too large"
bug very rare indeed. Please test.
Jeremy.
(This used to be commit 1aaa1f5bbe)
2007-10-10 12:23:50 -05:00
Volker Lendecke
6821e39e4b r23731: Forgot one reference to inbuf
(This used to be commit b02115f2ca)
2007-10-10 12:23:50 -05:00
Jeremy Allison
35d09869ed r23728: First part of bugfix for #4763. Limit notify responses
to client max buf size.
Jeremy.
(This used to be commit 6113f56919)
2007-10-10 12:23:49 -05:00
Volker Lendecke
8724dfe551 r23727: Explicitly pass down FLAGS2 to srvstr_get_path.
Next step is to remove the bug that in the trans2 code we use the inbuf
as the base pointer to decide whether we need ucs2 alignment where we
need to use the beginning of the params buffer

Jeremy, last one for today to reviw :-)
(This used to be commit 18078b9faa)
2007-10-10 12:23:49 -05:00
Volker Lendecke
fcda5b5896 r23726: Explicitly pass down the FLAGS2 field to srvstr_pull_buf. The next
checkin will pull this up to srvstr_get_path. At that point we can get more
independent of the inbuf, the base_ptr in pull_string will only be used
to satisfy UCS2 alignment constraints.
(This used to be commit 836782b07b)
2007-10-10 12:23:49 -05:00
Volker Lendecke
5391750ce6 r23725: Remove get_current_mid()
Jeremy, next one to review :-)
(This used to be commit a50555dda7)
2007-10-10 12:23:49 -05:00
Volker Lendecke
0bc56a2e5f r23724: Reduce access to the global inbuf a tiny bit. Add a struct smb_request
that contains some of the fields from the SMB header, removing the need
to access inbuf directly. This right now is used only in the open file
code & friends, and creating that header is only done when needed. This
needs more work, but it is a start.

Jeremy, I'm only checking this into 3_0, please review before I merge it
to _26.

Volker
(This used to be commit ca988f4e79)
2007-10-10 12:23:48 -05:00
Simo Sorce
d37c199136 r23683: Check ports are in the correct range (1-65535)
(This used to be commit 84b193a7d9)
2007-10-10 12:23:45 -05:00
Simo Sorce
b85bfd5066 r23682: Old patch I forgot in one of my 3.0.25 trees.
Make sure we honour the directive not to allow machine password changes.
(This used to be commit 436555f05c)
2007-10-10 12:23:45 -05:00
Jeremy Allison
ffe11a657f r23664: Fix incorrect index - should be j not i. How did we ever
live without valgrind :-).
Jeremy.
(This used to be commit 9b231149c7)
2007-10-10 12:23:43 -05:00
Jeremy Allison
07d2a3a893 r23663: Fix bug #4308 - Excel save operation corrupts file ACLs.
You don't want to know what I discovered about Windows
ACLs to make this work :-(. See :

http://www.codeproject.com/win32/accessctrl2.asp

Search for "Q. How does Inheritance come into this?"
for details.
Jeremy.
(This used to be commit e1d3a80d2b)
2007-10-10 12:23:43 -05:00
Jeremy Allison
a49b2ea9c8 r23640: When we support the SeSecurity privilage, this is where
we'll check it.
Jeremy.
(This used to be commit 1b73bf79f4)
2007-10-10 12:23:40 -05:00
Jeremy Allison
a0ac7a7f4c r23620: Convert set_nt_acl to return NTSTATUS. Also fix the chown
return to correctly return NT_STATUS_INVALID_OWNER if it
should be disallowed. Matches better what W2K3R3 does.

NFSv4 ACL module owners, please examine these changes.

Jeremy.
(This used to be commit fc6899a550)
2007-10-10 12:23:37 -05:00
Jeremy Allison
08a9de8927 r23589: Ensure we will always release any timeout handler
on fsp close or removal of oplock. Mulitple removals
are safe.
Jeremy.
(This used to be commit 6de0970704)
2007-10-10 12:23:33 -05:00
Volker Lendecke
8908bd64ea r23538: Fix for wild-card rename: We can't return directly on error, we need to
CloseDir.
(This used to be commit 48cdafc10a)
2007-10-10 12:23:26 -05:00
Volker Lendecke
864cad1353 r23537: Revert the inbuf/outbuf part of r23528: This caused the Solaris CC make test
to break. The Solaris CC put the static char InBuffer[TOTAL_BUFFER_SIZE] on an
odd address, the malloc'ed one is always aligned. The problem showed up in
pull_ucs2, ucs2_align uses the address of InBuffer as an indication whether to
bump up the src of the string by one. Unfortunately in the trans calls the
data portion is malloced and thus has different alignment guarantees than a
static variable. This one is bigger....

Volker
(This used to be commit 6affd7818f)
2007-10-10 12:23:26 -05:00
Volker Lendecke
5e8a4c12f9 r23528: Two changes to make the valgrind massif (heap profiler) output readable:
Remove the allocated inbuf/output. In async I/O we copy the buffers
explicitly now, so NewInBuffer is called exactly once. This does not
reduce memory footprint, but removes one of the larger chunks that
clobber the rest of the massif output

In getgroups_unix_user on Linux 2.6 we allocated 64k groups x 4 bytes
per group x 2 (once in the routine itself and once in libc) = 512k just
to throw it away directly again. This reduces it do a more typical limit
of 32 groups per user. We certainly cope with overflow fine if 32 is not
enough. Not 100% sure about this one, a DEVELOPER only thing?
(This used to be commit 009af09099)
2007-10-10 12:23:26 -05:00
Volker Lendecke
c1a2e8f6da r23523: Gaa -- had renamed "name" to "path" and apparently not compiled after
that....

Volker
(This used to be commit 1a45ea28ce)
2007-10-10 12:23:25 -05:00
Volker Lendecke
43e51b3989 r23522: Save us a kilobyte stack space in a hot code path: I can't see a reason
why check_path_syntax should not be able to run in-line. The destination
pointer either walks side by side with the source pointer or is
decremented. So as far as I can see s>=d is true throughout the whole
routine.

Jeremy, I'm checking this only into 3_0 for now. Please review and ack
or directly merge this to 3_0_26.

Thanks,

Volker
(This used to be commit 34a13c82a3)
2007-10-10 12:23:25 -05:00
Volker Lendecke
32ba5145b8 r23518: Remove the silly assumption that string_replace requires a pstring.
Jeremy, I am always very confused about the different length arguments
in convert_string and friends. Can you take a look at the change in
string_replace and verify it's ok? Thanks!

While at it, remove the pstring limit for strhasupper and strhaslower.
(This used to be commit e6e5703658)
2007-10-10 12:23:25 -05:00
Volker Lendecke
80c085d8ef r23517: After Jeremy has given is ack on irc:
Change rename_internals to open the file/directory and then call
rename_internals_fsp. Two reasons: Remove code duplication and remove a
race condition. The race condition was due to the fact that in
can_rename the share mode check closed the file and then after that did
the rename.
(This used to be commit aa16d8a649)
2007-10-10 12:23:24 -05:00
James Peach
b1ce226af8 r23510: Tidy calls to smb_panic by removing trailing newlines. Print the
failed expression in SMB_ASSERT.
(This used to be commit 171dc060e2)
2007-10-10 12:23:23 -05:00
Jeremy Allison
cc35d1300d r23508: Fix sync_file() to return NTSTATUS and return this
on failure in the write path.
Jeremy.
(This used to be commit cd3f7dbee8)
2007-10-10 12:23:23 -05:00
James Peach
4a3e4db1cd r23502: Restore exit-on-idle. Small refactoring for clarity. Exit if
we are idle and we timed out waiting for something to do.
(This used to be commit b4ab1a0cd9)
2007-10-10 12:23:22 -05:00
Volker Lendecke
59c872103d r23501: Move notify_rename before rename_internals_fsp and call it from there.
(This used to be commit 8d3828871c)
2007-10-10 12:23:22 -05:00
Volker Lendecke
9c4d185ef0 r23500: Two changes to survive the now activated test for rename_internals_fsp:
With the target being open we have to return NT_STATUS_ACCESS_DENIED and
root_fid != 0 leads to NT_STATUS_INVALID_PARAMETER
(This used to be commit b599e5b1e1)
2007-10-10 12:23:22 -05:00
Volker Lendecke
184eb775ff r23486: Ok, this time with a hopefully successful make test in the right place:
Remove two local variables
(This used to be commit 575e594e93)
2007-10-10 12:23:21 -05:00
Volker Lendecke
4944a5227c r23483: Revert 23482, I must have run 'make test' in the wrong subdir.
(This used to be commit 1ce0c582bc)
2007-10-10 12:23:20 -05:00
Volker Lendecke
c03c86232c r23482: Slightly simplify the rename code: Remove two local variables that are
not really needed.
(This used to be commit e068e38ef3)
2007-10-10 12:23:20 -05:00
Gerald Carter
4caefdf348 r23474: Here's a small patch that disables the libkrb5.so replay cache
when verifying a ticket from winbindd_pam.c.

I've found during multiple, fast, automated SSH logins (such
as from a cron script) that the replay cache in MIT's krb5
lib will occasionally fail the krb5_rd_req() as a replay attack.

There seems to be a small window during which the MIT krb5
libs could reproduce identical time stamps for ctime and cusec
in the authenticator since Unix systems only give back
milli-seconds rather than the micro-seconds needed by the
authenticator.  Checked against MIT 1.5.1.  Have not
researched how Heimdal does it.

My thinking is that if someone can spoof the KDC and TDS
services we are pretty hopeless anyways.
(This used to be commit cbd33da9f7)
2007-10-10 12:23:19 -05:00
Volker Lendecke
8b2637631e r23469: Fix a comment
(This used to be commit 47cc9359aa)
2007-10-10 12:23:18 -05:00
Volker Lendecke
0e0fed6f25 r23467: Next little simplification: In rename_internals it's a bit pointless to
first ask for existence of a file when we do the open_file_ntcreate in
can_rename later on anyway. That also gets us the right error message in
case the file is not there automatically.
(This used to be commit f3d582cb90)
2007-10-10 12:23:18 -05:00
Volker Lendecke
719df44c03 r23466: Fix RAW-NOTIFY: by using delete on close the notify is triggered deep
inside close_file() already.
(This used to be commit 0b29e3ad0f)
2007-10-10 12:23:18 -05:00
Volker Lendecke
062a411c12 r23457: After Jeremy's ack:
The attached patch removes a little race condition for
people with real kernel oplock support, and reduces some
code paths. It changes reply_unlink to open_file_ntcreate,
set_delete_on_close and close_file.

The race condition happens if we break the oplock in
can_delete via open_file_ntcreate, we close the file,
someone else gets a batch oplock and we try to unlink.

It reduces code paths by calling SMB_VFS_UNLINK in 2 fewer
places.
(This used to be commit 0342ce7057)
2007-10-10 12:23:17 -05:00
Jeremy Allison
28bc066aa8 r23450: max_params_return is complete fiction when getting a changenotify
request. Ignore it. Should fix bug #4689 but more tests and
valgrinding will follow.
Jeremy.
(This used to be commit c23e08cc09)
2007-10-10 12:23:17 -05:00
Jeremy Allison
cacbe41945 r23445: Fix suggested by Volker. Don't call rename_open_files
if the name wasn't changed.
Jeremy.
(This used to be commit 7a9629365e)
2007-10-10 12:23:16 -05:00
Volker Lendecke
de565785f5 r23410: Merge the core of the cluster code.
I'm 100% certain I've forgotten to merge something, but the main code
should be in. It's mainly in dbwrap_ctdb.c, ctdbd_conn.c and
messages_ctdbd.c.

There should be no changes to the non-cluster case, it does survive make
test on my laptop.

It survives some very basic tests with ctdbd enables, I did not do the
full test suite for clusters yet.

Phew...

Volker
(This used to be commit 15553d6327)
2007-10-10 12:23:14 -05:00
James Peach
bde0642ab4 r23398: Support membership of >16 groups on Darwin by making sure we opt in to the
dynamic group resolution mechanism when switching UNIX credentials.
(This used to be commit b5cb21e951)
2007-10-10 12:23:13 -05:00
James Peach
74c74f8dcc r23393: Support BSD group semantics by making sure that the effective GID is always
passed as the first GID when calling setgroups(2).
(This used to be commit 6ebaf856c1)
2007-10-10 12:23:12 -05:00
Jeremy Allison
0a1f5d71e4 r23391: Second part of the patch for Apple.
Change the sequence :

gain_root();
sys_setgroups(ngroups, groups);
become_id(uid, gid);

to a function call :

set_unix_security_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups)

James - should be safe for you to create a Darwin-specific
version of this function now.

Jeremy.
(This used to be commit 8ee982b367)
2007-10-10 12:23:12 -05:00