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

568 Commits

Author SHA1 Message Date
Volker Lendecke
d65afbe55f Remove the chain_fsp global 2008-10-13 19:32:39 +02:00
Jeremy Allison
f6c883b4b0 Simply our main loop processing. A lot :-). Correctly use events for all the previous "special" cases.
A step on the way to adding signals to the events and being able to merge the S3 event system with
the S4 one.
Jeremy.
2008-10-03 14:18:35 -07:00
Volker Lendecke
227718cd1a Fix Coverity ID 587
The following test program prints "8" on 64-bit :-)

static void print_size(const char lenbuf[4])
{
        printf("sizeof(lenbuf) = %d\n", (int)sizeof(lenbuf));
}
int main(void)
{
        const char lenbuf[4];
        print_size(lenbuf);
        return 0;
}

Jeremy, please check :-)

Volker
(This used to be commit 9daea0ccfd)
2008-09-01 13:51:11 +02:00
Volker Lendecke
1a7b6fe34d fix smb_len calculation for chained requests
I think chain_reply() is one of the most tricky parts of Samba. This recursion
needs to go away, we need to sequentially walk the chain list.
(This used to be commit af2b01d851)
2008-08-10 18:24:33 +02:00
Volker Lendecke
12b6c1f57d Fix andx offset calculation for more than 2 chained requests
Untested code is broken code.... Test follows later, it's quite an intrusive
change to libsmb/
(This used to be commit 0ff16e8573)
2008-08-10 18:24:32 +02:00
Volker Lendecke
5cd8a42720 Factor out create_outbuf, creating an outbuf just given an inbuf
(This used to be commit 50427cbf63)
2008-06-28 10:38:51 +02:00
Jeremy Allison
d36434f312 Security fix for CVE-2008-1105: Boundary failure when parsing SMB responses
can result in a buffer overrun.
Jeremy.
(This used to be commit 23b825e9d2)
2008-05-28 09:31:42 -07:00
Jeremy Allison
8ca459e067 Fix bug #5477 - recvfile code was broken.
Jeremy.
(This used to be commit 830337f054)
2008-05-20 12:09:48 -07:00
Volker Lendecke
bec1dfab27 Remove "userdom_struct user" from "struct user_struct"
(This used to be commit 420de03523)
2008-05-05 18:28:59 +02:00
Volker Lendecke
a4c0812af0 Fix some "ignoring asprintf result" warnings
(This used to be commit 155d62ddfd)
2008-04-14 13:13:46 +02:00
Jeremy Allison
8b04a33500 Ok, final move of this code :-). I think I've found the correct
place for it now where it will cause minimal disruption (only
call the extra message_dispatch just before reading the next
smb off the wire).
Jeremy.
(This used to be commit da2c19c481)
2008-03-31 17:01:27 -07:00
Jeremy Allison
6913f10134 Move the message_dispatch() call after the check for errno on
the select return. We don't want the call to message_dispatch
to mess up the errno value.
Jeremy.
(This used to be commit 26a74d01bb)
2008-03-31 16:56:21 -07:00
Jeremy Allison
e11cd466e1 Reduce the race condition in Samba4 in RAW-RENAME test. We rename a file
using trans2 setfileinfo on one connection, and then check the
file name has changed on the other. In Samba we achieve this by
sending a local message to the other process. This change causes
us to re-scan for incoming messages after we've woken up from the
select (which is cheap if there are no pending messages). This reduces
the race significantly. Volker please review.
Jeremy.
(This used to be commit a7499e994a)
2008-03-31 16:46:20 -07:00
Volker Lendecke
d634ab06b3 Convert secrets_lock_trust_account_password to talloc
This is preparing the conversion of secrets.c to ctdb
(This used to be commit 1307f0130c)
2008-03-10 21:08:45 +01:00
Jeremy Allison
47666c93a7 Fix a couple of "might be used uninitialized" warnings.
Jeremy.
(This used to be commit b3ac8073a2)
2008-02-05 13:36:17 -08:00
Volker Lendecke
e8f1edb9cd Remove smb_read_error global
YESS :-)
(This used to be commit 26771bdca0)
2008-02-02 11:03:23 +01:00
Volker Lendecke
9e5a5d49de Remove dependency on get_srv_read_error() from main loop
(This used to be commit fad8796892)
2008-02-02 11:03:23 +01:00
Volker Lendecke
eaf7621c51 Convert receive_message_or_smb to NTSTATUS
(This used to be commit 0f7d360a01)
2008-02-02 11:03:23 +01:00
Volker Lendecke
21e7344d2f Make get_srv_read_error static to process.c
(This used to be commit 9e2947039e)
2008-02-02 11:03:23 +01:00
Volker Lendecke
6ddfa6ae77 read_socket_with_timeout_ntstatus->read_socket_with_timeout
(This used to be commit 90554799af)
2008-02-02 11:03:22 +01:00
Volker Lendecke
e514cd0af5 Convert receive_smb_talloc to NTSTATUS
(This used to be commit ddbdd11a49)
2008-02-02 11:03:22 +01:00
Volker Lendecke
9fe66ddd15 Convert receive_smb_raw_talloc to NTSTATUS
(This used to be commit 187707591f)
2008-02-02 11:03:22 +01:00
Volker Lendecke
250b2b6464 Convert receive_smb_raw_talloc_partial_read to NTSTATUS
(This used to be commit 9a82350ba9)
2008-02-02 11:03:22 +01:00
Volker Lendecke
e604e137e2 Convert read_packet_remainder to return NTSTATUS
(This used to be commit 667864d442)
2008-02-02 11:03:22 +01:00
Volker Lendecke
48b1ee61db Convert read_packet_remainder to use read_socket_with_timeout_ntstatus
(This used to be commit fff31f8f35)
2008-02-02 11:03:21 +01:00
Volker Lendecke
0afbfa4284 Convert read_smb_length_return_keepalive to return NTSTATUS
(This used to be commit 73a79a957a)
2008-02-02 11:03:21 +01:00
Volker Lendecke
47e1251f72 Remove an unused external reference
(This used to be commit 147033b9df)
2008-01-27 00:35:14 +01:00
Volker Lendecke
a925a53f61 read_socket_with_timeout has timeout=0 handling
(This used to be commit 7101026061)
2008-01-23 17:09:10 +01:00
Volker Lendecke
5b35ecd930 Remove two unused variables
(This used to be commit f12ac1eced)
2008-01-23 10:33:36 +01:00
Volker Lendecke
18083f1d88 Get the inbuf on talloc_tos()
(This used to be commit 883f741576)
2008-01-12 21:09:43 +01:00
Jeremy Allison
253fbf1a6e Make use of talloc_pool in the main codepaths. Remove the sub-contexts.
Jeremy.
(This used to be commit bc932b8ad4)
2008-01-09 17:11:04 -08:00
Jeremy Allison
29562987c3 Now conn is part of smb_request, we don't need it as
an extra parameter. This cleans up quite a few places
we were passing it around without needing it.
Jeremy.
(This used to be commit 8f36def18e)
2008-01-04 15:37:24 -08:00
Jeremy Allison
9254bb4ef1 Refactor the crypto code after a very helpful conversation
with Volker. Mostly making sure we have data on the incoming
packet type, not stored in the smb header.
Jeremy.
(This used to be commit c4e5a50504)
2008-01-04 12:56:23 -08:00
Jeremy Allison
afce2b245a Add the capability to set "smb encrypt = required"
on a share (or global) and have the server reply with
ACCESS_DENIED for all non-encrypted traffic (except
that used to query encryption requirements and set
encryption state).
Jeremy.
(This used to be commit d241bfa577)
2007-12-27 23:51:03 -08:00
Jeremy Allison
afc93255d1 Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
(This used to be commit d78045601a)
2007-12-26 17:12:36 -08:00
Jeremy Allison
a34c6cd0e7 Remove last_message completely as it's no longer used.
Jeremy.
(This used to be commit c378c3edc1)
2007-12-18 18:10:09 -08:00
Jeremy Allison
d068bc64b6 Three more pstring removals.
Jeremy.
(This used to be commit c15819b757)
2007-11-11 21:46:52 -08:00
Volker Lendecke
637f9d9bf0 Fix some warnings
(This used to be commit 0a1f524e8c)
2007-11-09 15:16:26 +01:00
Jeremy Allison
36441da424 Remove the horror that was the global smb_rw_error.
Each cli struct has it's own local copy of this variable,
so use that in client code. In the smbd server, add one
static to smbd/proccess.c and use that inside smbd. Fix
a bunch of places where smb_rw_error could be set by
calling read_data() in places where we weren't reading
from the SMB client socket (ie. winbindd).
Jeremy.
(This used to be commit 255c2adf7b)
2007-11-05 11:12:56 -08:00
Jeremy Allison
58fbb512cc Forgot arg type.
Jeremy.
(This used to be commit 46f3b04dde)
2007-11-04 17:15:35 -08:00
Jeremy Allison
4721050df5 Don't believe len returned from read_smb_length_return_keepalive(),
it may be a UNIX large writeX (which wraps len in that case).
Stevef this should fix your 128k write bug.
Jeremy.
(This used to be commit de2ebffa3c)
2007-11-04 15:38:43 -08:00
Jeremy Allison
5b0b4f23ef Remove most of the remaining globals out of lib/util_sock.c.
I have a plan for dealing with the remaining..... Watch
this space.
Jeremy.
(This used to be commit 963fc76852)
2007-11-03 23:20:10 -07:00
Jeremy Allison
25074433f4 I can't get away without a 'length' arg. :-).
Jeremy.
(This used to be commit 95d01279a5)
2007-11-03 18:41:26 -07:00
Jeremy Allison
6658165d5e Stop get_peer_addr() and client_addr() from using global
statics. Part of my library cleanups.
Jeremy.
(This used to be commit e848506c85)
2007-11-03 18:15:45 -07:00
Jeremy Allison
73d4079680 Remove the smb_read_error global variable and replace
it with accessor functions. "One global or pstring a day...." :-).
Jeremy.
(This used to be commit d50d14c300)
2007-11-03 15:12:42 -07:00
Jeremy Allison
695c4a7a74 Fix vfstest link - move socket calls into smbd/process.c
not smbd/server.c
Jeremy
(This used to be commit 8fbefe18a2)
2007-10-31 14:24:52 -07:00
Jeremy Allison
c3250149e1 Add new parameter, "min receivefile size" (by default set
to zero). If non-zero, writeX calls greater than this
value will be left in the socket buffer for later handling
with recvfile (or userspace equivalent). Definition of
recvfile for your system is left as an exercise for
the reader (I'm working on getting splice working :-).
Jeremy.
(This used to be commit 11c03b75dd)
2007-10-30 16:22:24 -07:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Jeremy Allison
12f61e09d9 r25117: The mega-patch Jerry was waiting for. Remove all pstrings from
the main server code paths. We should now be able to cope with
paths up to PATH_MAX length now.
Final job will be to add the TALLOC_CTX * parameter to
unix_convert to make it explicit (for Volker).
Jeremy.
(This used to be commit 7f0db75fb0)
2007-10-10 12:30:41 -05:00
Volker Lendecke
929e1d9920 r24809: Consolidate the use of temporary talloc contexts.
This adds the two functions talloc_stackframe() and talloc_tos().

 * When a new talloc stackframe is allocated with talloc_stackframe(), then
 * the TALLOC_CTX returned with talloc_tos() is reset to that new
 * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse
 * happens: The previous talloc_tos() is restored.
 *
 * This API is designed to be robust in the sense that if someone forgets to
 * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and
 * resets the talloc_tos().

The original motivation for this patch was to get rid of the
sid_string_static & friends buffers. Explicitly passing talloc context
everywhere clutters code too much for my taste, so an implicit
talloc_tos() is introduced here. Many of these static buffers are
replaced by a single static pointer.

The intended use would thus be that low-level functions can rather
freely push stuff to talloc_tos, the upper layers clean up by freeing
the stackframe. The more of these stackframes are used and correctly
freed the more exact the memory cleanup happens.

This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and
lp_talloc_ctx (did I forget any?)

So, never do a

tmp_ctx = talloc_init("foo");

anymore, instead, use

tmp_ctx = talloc_stackframe()

:-)

Volker
(This used to be commit 6585ea2cb7)
2007-10-10 12:30:24 -05:00
Volker Lendecke
b578db69e9 r24702: Remove the old API pointers
(This used to be commit 17df313db4)
2007-10-10 12:30:14 -05:00
Jeremy Allison
a662a62e5a r24500: Add check that bcc is correct in an incoming packet.
Jeremy.
(This used to be commit 267a0ac48d)
2007-10-10 12:29:52 -05:00
Jeremy Allison
ed70bc0d8e r24468: Don't forget the +4 for length :-).
Jeremy.
(This used to be commit 4d01e0b744)
2007-10-10 12:29:50 -05:00
Jeremy Allison
a1f593cd73 r24467: Do range checking on incoming smb request.
Jeremy.
(This used to be commit dbd58dd647)
2007-10-10 12:29:50 -05:00
Volker Lendecke
716e01d97e r24457: Convert reply_tcon to the new API
Jeremy, I really apologize for doing this, but I just wanted to enjoy
converting the last SMB call :-)

I've left one little task for you there, I'm not certain that checking
the inbuf length is correct here.

Volker
(This used to be commit 1e08fddafd)
2007-10-10 12:29:49 -05:00
Volker Lendecke
24f42c5cef r24453: Remove the read and write bmpx calls
Talked to both Tridge and Jeremy about this, Tridge said that there is a
special error message persuading OS/2 to fall back to other methods.
The calls now checked in always return the error message we used to
return when "read bmpx = False" was set (the default): ERRSRV, ERRuseSTD.

If someone has a reproducable test case where this is really needed, we
can always dig it up from version control and convert it to the new API.
But that time without that silly parameter, and with a torture test case
for "make test" please :-)

Volker
(This used to be commit d941aae2df)
2007-10-10 12:29:49 -05:00
Jeremy Allison
2823bf10b5 r24445: Convert SMBwritebraw. No test suite unfortunately.... I need to write one for this.
Jeremy
(This used to be commit edc17dfcbd)
2007-10-10 12:29:48 -05:00
Volker Lendecke
527905a09a r24444: Convert reply_find[n]close to the new API
(This used to be commit 6af8595346)
2007-10-10 12:29:48 -05:00
Volker Lendecke
5edcc342c6 r24443: Convert reply_search/fclose to the new API
(This used to be commit a8a33c377e)
2007-10-10 12:29:48 -05:00
Volker Lendecke
f93b093d5f r24442: Convert reply_copy to the new API
(This used to be commit 0cb00c5475)
2007-10-10 12:29:48 -05:00
Volker Lendecke
9c2bfffece r24441: Convert reply_ioctl to the new API
(This used to be commit a5af7ebb7f)
2007-10-10 12:29:48 -05:00
Volker Lendecke
c5572072e5 r24440: Convert the reply_sendXX functions to the new API
(This used to be commit a64bc31098)
2007-10-10 12:29:48 -05:00
Volker Lendecke
90741da80b r24439: Convert reply_get/setattrE to the new API
(This used to be commit 6b0ad071d8)
2007-10-10 12:29:47 -05:00
Volker Lendecke
05fafc1df2 r24436: Convert reply_lockread/writeunlock to the new API
(This used to be commit 1b6add251c)
2007-10-10 12:29:47 -05:00
Volker Lendecke
2ea14d4e98 r24433: Convert reply_ntrename to the new API
(This used to be commit 42b07a52b9)
2007-10-10 12:29:46 -05:00
Volker Lendecke
591669ba06 r24431: Convert the reply_printXX calls to the new API
(This used to be commit e528479f56)
2007-10-10 12:29:46 -05:00
Volker Lendecke
4a989dac81 r24430: Convert reply_writeclose to the new API
(This used to be commit 6def2ee03b)
2007-10-10 12:29:46 -05:00
Volker Lendecke
0f73d64f7d r24428: Convert reply_unlock to the new API
(This used to be commit 01c7426fc0)
2007-10-10 12:29:45 -05:00
Volker Lendecke
ca70ea9310 r24427: Convert reply_lock to the new API
(This used to be commit 212f43ddea)
2007-10-10 12:29:45 -05:00
Volker Lendecke
4c7212b4e4 r24426: Convert reply_read to the new API
(This used to be commit 30aada0ef8)
2007-10-10 12:29:45 -05:00
Volker Lendecke
7c25bf4511 r24425: Convert reply_write to the new API
(This used to be commit 244965f7b6)
2007-10-10 12:29:45 -05:00
Volker Lendecke
fe502551c3 r24423: Convert reply_lseek to the new API
(This used to be commit bd22885386)
2007-10-10 12:29:44 -05:00
Volker Lendecke
dee4ab1533 r24422: Convert reply_ctemp to the new API
(This used to be commit 3cc22fd74f)
2007-10-10 12:29:44 -05:00
Volker Lendecke
06ed827edf r24417: Convert reply_setatr to the new API
(This used to be commit 56bab5ea4c)
2007-10-10 12:29:43 -05:00
Volker Lendecke
73b3ae9c55 r24415: Convert reply_getatr to the new API
(This used to be commit 1a08b97a93)
2007-10-10 12:29:43 -05:00
Volker Lendecke
5fe4384cd9 r24414: Convert reply_mv to the new API
(This used to be commit fa341e4840)
2007-10-10 12:29:42 -05:00
Volker Lendecke
2da44a2dee r24412: Convert reply_open to the new API
(This used to be commit 394987f522)
2007-10-10 12:29:42 -05:00
Volker Lendecke
29df25351d r24406: Push reply_prep_legacy into reply_lockingX
(This used to be commit bce87ebdc0)
2007-10-10 12:29:41 -05:00
Volker Lendecke
ae89ba48ec r24404: Remove get_OutBuffer usage from blocking.c
(This used to be commit cb8fab5663)
2007-10-10 12:29:41 -05:00
Jeremy Allison
d701a47c73 r24387: Convert readbraw to the new api. Volker, keep checking in
your patches please :-). I'll work on SMBreadBmpx tomorrow.
Jeremy.
(This used to be commit 27e183afa8)
2007-10-10 12:29:38 -05:00
Jeremy Allison
5cc0a6b43c r24386: Piss off Volker (not deliberately) by checking in a reply_mknew -> conversion.
Sorry vl, remove one of your 15 patches :-).
Jeremy.
(This used to be commit a7648ed9d4)
2007-10-10 12:29:38 -05:00
Volker Lendecke
6bee410431 r24358: Push reply_prep_legacy into reply_nttrans[s]
(This used to be commit 197c231079)
2007-10-10 12:29:36 -05:00
Volker Lendecke
2fb27fcb69 r24349: For large read&x we need more than 64k of outbuf.
(This used to be commit f7e2eec35f)
2007-10-10 12:29:32 -05:00
Volker Lendecke
d90f6fa1bd r24328: Restore chain_reply error handling
Get the whole smb header from the second chained function, in particular
the error fields
(This used to be commit 0eb831ca0e)
2007-10-10 12:29:30 -05:00
Volker Lendecke
26f6826dfc r24327: First round of fixes to chain_reply
The argument to smb_setlen does not contain the nbt header of 4 bytes

The chained function might allocate outbuf itself (as now happens with
reply_read_and_X). This would erroneously overwrite the caller's outbuf.
Give it an outbuf pointer of it's own
(This used to be commit f923bba908)
2007-10-10 12:29:29 -05:00
Volker Lendecke
61ee2d3720 r24322: Wrap reply_read_and_X in reply_prep_legacy
(This used to be commit 7926b5dfb8)
2007-10-10 12:29:28 -05:00
Volker Lendecke
c898c51984 r24318: Print a prominent warning when reply_prep_legacy is called
This is a temporary function anyway
(This used to be commit 9269e3d588)
2007-10-10 12:29:27 -05:00
Volker Lendecke
b0dc209c19 r24271: Push reply_prep_legacy into reply_write_and_X
(This used to be commit 607e7d2447)
2007-10-10 12:29:24 -05:00
Volker Lendecke
1d3c1de502 r24231: Push allocating InBuffer/OutBuffer into reply_transs
(This used to be commit 74ae19cca6)
2007-10-10 12:29:18 -05:00
Volker Lendecke
133ef281c0 r24229: Push allocating InBuffer/OutBuffer into reply_transs
(This used to be commit 39a7809aa4)
2007-10-10 12:29:18 -05:00
Volker Lendecke
5d2031915e r24225: Convert reply_flush to the new API
(This used to be commit f843c02f07)
2007-10-10 12:29:18 -05:00
Volker Lendecke
c847b2afe7 r24223: Convert reply_echo to the new API
(This used to be commit 4863ff2899)
2007-10-10 12:29:17 -05:00
Volker Lendecke
1d8851f4c7 r24159: Convert reply_transs2 to the new API
(This used to be commit a55a4d71ff)
2007-10-10 12:29:15 -05:00
Volker Lendecke
e2f0b5dd2a r24156: Convert reply_trans2 to the new API
(This used to be commit a9c2d75b42)
2007-10-10 12:29:15 -05:00
Volker Lendecke
b91704d47b r24135: Convert call_trans2open to the new API
This itself won't help much, because send_trans2_replies_new still allocates
the big buffers, but stay tuned :-)

Also add/update my copyright on stuff I recently touched.

Volker
(This used to be commit 248f15ff14)
2007-10-10 12:29:10 -05:00
Volker Lendecke
a0a9a301d2 r24119: Convert reply_exit to the new API
(This used to be commit d4d550aa2b)
2007-10-10 12:29:08 -05:00
Volker Lendecke
4473a5ec54 r24100: Convert reply_ntcancel to the new API
(This used to be commit 6e5f39379f)
2007-10-10 12:29:06 -05:00
Volker Lendecke
d95725370f r24091: Convert reply_ntcreate_and_X to the new API
The routines called will follow
(This used to be commit 28025fc17e)
2007-10-10 12:29:05 -05:00
Volker Lendecke
15dc8917db r24089: Add reply_prep/post_legacy
Routines to ease the transition to the new API
(This used to be commit 1bb2b341e2)
2007-10-10 12:29:04 -05:00
Volker Lendecke
4254af7180 r24088: Convert reply_unlink to the new API
(This used to be commit fb0a1b7bd0)
2007-10-10 12:29:04 -05:00
Volker Lendecke
8084a39ce0 r24086: Convert reply_ulogoffX to the new API
(This used to be commit bbc99e1c3b)
2007-10-10 12:29:04 -05:00
Volker Lendecke
4694e757ba r24085: Convert reply_rmdir to the new API
(This used to be commit 7689048d71)
2007-10-10 12:29:03 -05:00
Volker Lendecke
68513d521d r24084: Convert reply_mkdir to the new API
(This used to be commit e93f3996fc)
2007-10-10 12:29:03 -05:00
Volker Lendecke
ef97e2dece r24079: Convert reply_dskattr to the new API
(This used to be commit c8e0aa5752)
2007-10-10 12:29:03 -05:00
Volker Lendecke
09b3d25252 r24077: Convert reply_tdis to the new API
(This used to be commit bd0cb48dde)
2007-10-10 12:29:02 -05:00
Volker Lendecke
7d2d4ddfa2 r24056: Another big one: This converts reply_sesssetup_and_X to the new API. As usual,
its history can be found on http://samba.org/~vlendec/sesssetup/. This very
obviously needs close review.

Volker
(This used to be commit 35675a6a33)
2007-10-10 12:29:00 -05:00
Volker Lendecke
e5cdc454aa r24046: Fix a 64-bit warning
(This used to be commit a2ecc34aa4)
2007-10-10 12:28:59 -05:00
Volker Lendecke
01d5091c26 r24004: Convert reply_checkpath to the new API
(This used to be commit e5c7c6406a)
2007-10-10 12:28:55 -05:00
Volker Lendecke
db9f25c1c5 r24003: Convert reply_tcon_and_X to the new API
(This used to be commit 9422385d9c)
2007-10-10 12:28:55 -05:00
Volker Lendecke
3d12c53eb3 r24002: Convert reply_negprot to the new API
(This used to be commit bd981f5328)
2007-10-10 12:28:54 -05:00
Volker Lendecke
9e40557047 r23999: Convert reply_open_and_X
This is an example of chained code that is executed in make test
(This used to be commit e3a10e9ffb)
2007-10-10 12:28:54 -05:00
Volker Lendecke
47cdfc0413 r23998: Convert reply_close to the new API
(This used to be commit dbf74cb747)
2007-10-10 12:28:54 -05:00
Volker Lendecke
cc6a41017c r23997: Check in the infrastructure for getting rid of the global InBuffer/OutBuffer
The complete history of this patch can be found under
http://www.samba.org/~vlendec/inbuf-checkin/.

Jeremy, Jerry: If possible I would like to see this in 3.2.0. I'm only
checking into 3_2 at the moment, as it currently will slow down operations for
all non-converted (i.e. all at this moment) operations, as it will copy the
talloc'ed inbuf over the global InBuffer. It will need quite a bit of effort
to convert everything necessary for the normal operations an XP box does.

I have patches for negprot, session setup, tcon_and_X, open_and_X, close. More
to come, but I would appreciate some help here.

Volker
(This used to be commit 5594af2b20)
2007-10-10 12:28:53 -05:00
Volker Lendecke
8579dd4ded r23990: Reformatting for 80 cols and trailing whitespace
(This used to be commit 0484de27d9)
2007-10-10 12:28:53 -05:00
Volker Lendecke
941db29ab4 r23988: Looks a lot more scary than it is: This just unwraps the else-branch of
if (smb_messages[type].fn == NULL) { into the function top-level. Makes
this function a bit easier to understand IMO.

Volker
(This used to be commit ada23b7f06)
2007-10-10 12:28:52 -05:00
Volker Lendecke
799c3ec8d4 r23987: Remove static pid in switch_message()
There's no point in duplicating functionality that exists in
sys_getpid() that also only used in a debug statement
(This used to be commit ebf1b1e97c)
2007-10-10 12:28:52 -05:00
Volker Lendecke
fa919f24f0 r23813: Remove unused global variable
(This used to be commit 3b811134c0)
2007-10-10 12:28:29 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
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
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
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
ac3f08ddbe r23055: Rewrite messages.c to use auto-generated marshalling in the tdb. I'm
doing this because for the clustering the marshalling is needed in more
than one place, so I wanted a decent routine to marshall a message_rec
struct which was not there before.

Tridge, this seems about the same speed as it used to be before, the
librpc/ndr overhead in my tests was under the noise.

Volker
(This used to be commit eaefd00563)
2007-10-10 12:22:17 -05:00
Volker Lendecke
fad7dd8a60 r22868: Replace some message_send_pid calls with messaging_send_pid calls. More
tomorrow.
(This used to be commit 74fa57ca5d)
2007-10-10 12:22:04 -05:00
Volker Lendecke
bf7008abb8 r22695: Dummy checkin (reformatting) to make the AIX hosts retry.
(This used to be commit cd55ccef6a)
2007-10-10 12:21:46 -05:00
Volker Lendecke
fb56443427 r22691: Fix a 64-bit warning and a const const discard warning
(This used to be commit 3a2ca1b1b8)
2007-10-10 12:21:46 -05:00
Volker Lendecke
2541e0d590 r22458: Fix a comment
(This used to be commit f5ccec4228)
2007-10-10 12:19:34 -05:00
Jeremy Allison
0829e1ad1c r22391: Looks bigger than it is. Make "inbuf" available
to all callers of smb_setlen (via set_message()
calls). This will allow the server to reflect back
the correct encryption context.
Jeremy.
(This used to be commit 2d80a96120)
2007-10-10 12:19:30 -05:00
Jeremy Allison
dc90cd89a7 r22389: Start preparing for multiple encryption contexts in the
server. Allow server to reflect back to calling client
the encryption context that was sent.
Jeremy.
(This used to be commit b49e90335d)
2007-10-10 12:19:30 -05:00
Volker Lendecke
a633b42592 r22213: We can't use become_root() here, as it does DEBUG()
itself. become_root_uid_only did not :-)

Revert 21868, we need to find a better way.

Volker
(This used to be commit 629f966714)
2007-10-10 12:19:20 -05:00
Jeremy Allison
a098724734 r22145: Fix bug #4494 - reported by Kevin Jamieson <bugzilla@kevinjamieson.com>.
If returning a mapped UNIX error from sendfile, don't call chain_reply.
Jeremy.
(This used to be commit 38404c990d)
2007-10-10 12:19:16 -05:00
Volker Lendecke
496dbdf435 r21879: Move process_blocking_lock_queue to a timed event.
The idea is that we have blocking.c:brl_timeout as a timed
event that is present whenever we do have a blocking lock
pending. It fires brl_timeout_fn() which calls
process_blocking_lock_queue().

Whenever we make changes to blocking_lock_queue, we trigger
a recalc_brl_timeout() which sets a new brl_timout event if
necessary. This makes the call to
blocking_locks_timeout_ms() in setup_select_timeout()
unnecessary, this is implicitly done in
event_add_to_select_args() from the timed events.

Volker
(This used to be commit 7e31b8ce21)
2007-10-10 12:18:42 -05:00
Volker Lendecke
fe0b56ead1 r21871: Move deadtime processing into an idle event. While there, simplify
conn_idle_all() a bit.

Volker
(This used to be commit 3fc00977a9)
2007-10-10 12:18:41 -05:00
Volker Lendecke
c0e37a7496 r21870: Move sending auth_server keepalives out of the main loop into an idle event.
Volker
(This used to be commit 6226b30f38)
2007-10-10 12:18:41 -05:00
Volker Lendecke
7c2bc9c070 r21869: Move sending keepalives out of the main processing loop into idle event.
On the way, make lp_keepalive() a proper parameter.

Volker
(This used to be commit 9499fd9c80)
2007-10-10 12:18:41 -05:00
Volker Lendecke
8d0cfddb26 r21868: Remove check_log_size from the central smbd processing loop. This can be done
with a become_root/unbecome_root in debug.c.
(This used to be commit 4632a0caaf)
2007-10-10 12:18:41 -05:00
Volker Lendecke
2864d86b37 r21867: Simplify calling convention of timeout_processing. lp_deadtime is only
referenced in conn_idle_all().
(This used to be commit c0aaee6d36)
2007-10-10 12:18:40 -05:00
Volker Lendecke
0d91334fe7 r21784: Replace smb_register_idle_event() with event_add_timed(). This fixes winbind
who did not run the idle events to drop ldap connections.

Volker
(This used to be commit af3308ce5a)
2007-10-10 12:18:33 -05:00
Jeremy Allison
235b0f97f2 r21731: Fix long-standing bug in our chain processing code.
Should fix a bug with WinPE. Probably a candidate
for the Vista patchset.
Jeremy.
(This used to be commit ef32de6b59)
2007-10-10 12:18:26 -05:00
Volker Lendecke
fe881c3e38 r21278: The main goal of this was to get rid of the NetInBuffer / set_InBuffer. But it
turns out that this patch actually speeds up the async writes considerably.

I tested writing 100.000 times 65535 bytes with the allowed 10 ops in
parallel. Without this patch it took about 32 seconds on my dual-core 1.6GHz
laptop. With this patch it dropped to about 26 seconds. I can only explain it
by better cache locality, NewInBuffer allocates more than 128k, so we jump
around in memory more.

Jeremy, please check!

Volker
(This used to be commit 452d51bc6f)
2007-10-10 12:17:53 -05:00
Volker Lendecke
c59a49d83b r21184: Dummy checkin to let the build farm pick up r21183 of Samba4
(This used to be commit 22c9511314)
2007-10-10 12:17:46 -05:00
Jeremy Allison
14785319cc r21166: Ensure we return the correct "EROFS" error on a non-writable
filesystem.
Jeremy.
(This used to be commit 1e25501e8e)
2007-10-10 12:17:45 -05:00
Volker Lendecke
d5206610cd r20931: This changes the notify infrastructure from a polling-based to an event-driven
based approach. The only remaining hook into the backend is now

	void *(*notify_add)(TALLOC_CTX *mem_ctx,
			    struct event_context *event_ctx,
			    files_struct *fsp, uint32 *filter);

(Should we put this through the VFS, so that others can more easily plug in?)

The trick here is that the backend can pick filter bits that the main smbd
should not handle anymore. Thanks to tridge for this idea.

The backend can notify the main smbd process via

void notify_fsp(files_struct *fsp, uint32 action, char *name);

The core patch is not big, what makes this more than 1800 lines are the
individual backends that are considerably changed but can be reviewed
one by one.

Based on this I'll continue with inotify now.

Volker
(This used to be commit 9cd6a8a827)
2007-10-10 12:17:21 -05:00
Volker Lendecke
bf219447a3 r20846: Before this gets out of control...
This add a struct event_context and infrastructure for fd events to smbd. This
is step zero to import lib/events.

Jeremy, I rely on you to watch the change in receive_message_or_smb()
closely. For the normal code path this should be the only relevant change. The
rest is either not yet used or is cosmetic.

Volker
(This used to be commit cd07f93a8a)
2007-10-10 12:17:13 -05:00
Jeremy Allison
ab46f9cdd2 r20742: Rename chkpth -> checkpath for sanity's sake :-).
Start removing unneeded "BOOL ok" from this reply.c
(this logic is old, old, old..... :-).
Jeremy.
(This used to be commit 3d52268095)
2007-10-10 12:17:07 -05:00
Volker Lendecke
7a915ec3a6 r20700: In the main processing loop we select() on the fam socket. If it fires, it
might be possible that we hang in the receive_smb() although that socket is
not the reason for the select() to return.

This immediately reacts to the fam socket to become readable, and goes into
the select loop again. This fixes delays in files showing up in Windows.

Jeremy, James please review this and merge to 3_0_24 if appropriate.

Thanks,

Volker
(This used to be commit c846153b2e)
2007-10-10 12:17:04 -05:00
Volker Lendecke
ab7fc62edf r20432: Apply some const
(This used to be commit 22163fee59)
2007-10-10 12:16:49 -05:00
Stefan Metzmacher
258a465e20 r18605: sync dlinklist.h with samba4, that means DLIST_ADD_END()
and DLIST_DEMOTE() now take the type of the tmp pointer
not the tmp pointer itself anymore.

metze
(This used to be commit 2f58645b70)
2007-10-10 11:51:59 -05:00
Volker Lendecke
0be131725f r17569: Make 'max smbd processes' more robust. Counting on the child to decrement a
tdb entry is not the most reliable way to count children correctly.

This increments the number of children after a fork and decrements it upon
SIGCLD. I'm keeping a list of children just for consistency checks, so that we
at least get a debug level 0 message if something goes wrong.

Volker
(This used to be commit eb45de167d)
2007-10-10 11:38:39 -05:00
Jeremy Allison
b737f26764 r17105: Fix the race Volker found - we had a non-locked
region between detecting a pending lock was needed
and when we added the blocking lock record. Make
sure that we hold the lock over all this period.
Removed the old code for doing blocking locks on
SMB requests that never block (the old SMBlock
and friends).
Discovered something interesting about the strange
NT_STATUS_FILE_LOCK_CONFLICT return. If we asked
for a lock with zero timeout, and we got an error
of NT_STATUS_FILE_LOCK_CONFLICT, treat it as though
it was a blocking lock with a timeout of 150 - 300ms.
This only happens when timeout is sent as zero and
can be seen quite clearly in ethereal. This is the
real replacement for old do_lock_spin() code.
Re-worked the blocking lock select timeout to correctly
use milliseconds instead of the old second level
resolution (far too coarse for this work).
Jeremy.
(This used to be commit b81d6d1ae9)
2007-10-10 11:38:12 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Jeremy Allison
ce61fb21d9 r16397: Fix Klocwork #11767 and drasticly simplify the
logic in smbd/process.c. All interested (Volker,
Jerry, James etc). PLEASE REVIEW THIS CHANGE.
The logic should be identical but *much* easier
to follow and change (and shouldn't confuse Klockwork :-).
Jeremy.
(This used to be commit d357f8b335)
2007-10-10 11:18:52 -05:00
Volker Lendecke
b3a5633de0 r15495: current_user_info is not referenced in process.c
(This used to be commit 8cedbbfbcf)
2007-10-10 11:16:54 -05:00
Jeremy Allison
010c725b36 r15088: Remove all time() and gettimeofday() calls out of the mainline
packet processing code. Only do these when needed (ie. in the
idle timeout code). We drop an unneccessary global here too.
Jeremy.
(This used to be commit 8272a5ab06)
2007-10-10 11:16:22 -05:00
Jeremy Allison
cc203f3e59 r15084: Try and squeeze more out of the non-read/write code path.
Jeremy.
(This used to be commit 23dcff4d50)
2007-10-10 11:16:22 -05:00
Jeremy Allison
fc13f28417 r15030: On a performace hunt... Remove as many extraneous
memset's as possible.
Jeremy.
(This used to be commit 1217ed392b)
2007-10-10 11:15:58 -05:00
Jeremy Allison
eecdc6c956 r15022: Fix core dumps on normal server exit.
Jeremy.
(This used to be commit 13c3abf031)
2007-10-10 11:15:57 -05:00
Jeremy Allison
22dbd67708 r15018: Merge Volker's ipc/trans2/nttrans changes over
into 3.0. Also merge the new POSIX lock code - this
is not enabled unless -DDEVELOPER is defined.
This doesn't yet map onto underlying system POSIX
locks. Updates vfs to allow lock queries.
Jeremy.
(This used to be commit 08e52ead03)
2007-10-10 11:15:57 -05:00
James Peach
4fa5559800 r14898: This change is an attempt to improve the quality of the information that
is produced when a process exits abnormally.

First, we coalesce the core dumping code so that we greatly improve our
odds of being able to produce a core file, even in the case of a memory
fault. I've removed duplicates of dump_core() and split it in two to
reduce the amount of work needed to actually do the dump.

Second, we refactor the exit_server code path to always log an explanation
and a stack trace. My goal is to always produce enough log information
for us to be able to explain any server exit, though there is a risk
that this could produce too much log information on a flaky network.

Finally, smbcontrol has gained a smbd fault injection operation to test
the changes above. This is only enabled for developer builds.
(This used to be commit 56bc02d644)
2007-10-10 11:15:53 -05:00
Volker Lendecke
49ecd176ee r14559: Oplocks have changed, process_smb can be static again
(This used to be commit 19e9bc03f8)
2007-10-10 11:15:37 -05:00
Jeremy Allison
ff122b308b r14229: Something Coverity hasn't caught (yet) but I've gotten
sensitive to null derefs. get_timed_events_timeout()
can potentially return NULL. Cope with this.
Jeremy.
(This used to be commit 0483807872)
2007-10-10 11:15:18 -05:00
Gerald Carter
fb5362c069 r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
(This used to be commit b65be8874a)
2007-10-10 11:10:14 -05:00
Jeremy Allison
5c149702b0 r13498: Fix the kernel oplocks code for IRIX. Should fix #3515.
Jeremy.
(This used to be commit 006cf9c365)
2007-10-10 11:10:07 -05:00
James Peach
8fbdd112b2 r13482: Push the FAM notification file descriptor into the select
set to avoid unnecessary polling.
(This used to be commit 1dce945ccb)
2007-10-10 11:10:05 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Gerald Carter
54abd2aa66 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
(This used to be commit 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Jeremy Allison
c46b4cabf4 r10188: 64-bit warning fix.
Jeremy.
(This used to be commit 3b8a8e2947)
2007-10-10 11:03:36 -05:00
Jeremy Allison
3dae794632 r9126: Fix valgrind bug Volker found in interaction with new aio buffer
flipping and oplocks.
Jeremy.
(This used to be commit a18c5ff3ea)
2007-10-10 11:00:26 -05:00
Volker Lendecke
880d62843a r8798: Save one system call per SMB. smb_run_idle_events right now is only used to
close idle pdb_ldap connections, and from my point of view this can wait until
normal timeout handling, this does not need to be done per client request.

Volker
(This used to be commit 404b817d72)
2007-10-10 11:00:17 -05:00
Jeremy Allison
a344155b8d r8782: Fix bug #2918. The problem was using Inbuffer to push a deferred open message onto the queue
when we're in a chained message set - we're actually processing a different
buffer then. Added current_inbuf as a static inside smbd/process.c to ensure the
correct message gets pushed and processed.
Jeremy.
(This used to be commit ccef758171)
2007-10-10 11:00:16 -05:00
Jeremy Allison
f2f55d703d r7963: Add aio support to 3.0.
Jeremy.
(This used to be commit 1de27da470)
2007-10-10 10:58:05 -05:00
Simo Sorce
7ebd74e6c5 r7961: randomize reloading so that smbds do not pverload cupsd
by reloading printers all at the same time.
						sss
(This used to be commit da227d5f43)
2007-10-10 10:58:05 -05:00
Jeremy Allison
19ca97a70f r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us
from using C++ reserved keywords in our code.
Jeremy
(This used to be commit 9506b8e145)
2007-10-10 10:58:00 -05:00
Jeremy Allison
a59149b86a r7550: Steal the correct error return for invalid TID on NTcreateX from Samba4
(thanks tridge !).
Jeremy.
(This used to be commit 0288823aac)
2007-10-10 10:57:13 -05:00
Volker Lendecke
b6fb046249 r7344: Correctly return if malloc fails.
Jeremy, you might want to check this.

Thanks,

Volker
(This used to be commit 560f9d3735)
2007-10-10 10:57:06 -05:00
Jeremy Allison
f60ad8ded6 r6346: Add a counter for the number of SMB operations per connection/file.
You will need to do a make clean after SVN updating this. Next will
come a smbcontrol message to dump this info. This should be interesting
to profile client activity.
Jeremy.
(This used to be commit 743174da86)
2007-10-10 10:56:37 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Jeremy Allison
0557c6cba2 r6172: Tidy up error processing significantly. Remove unix_ERR_XXX global nastyness.
Jeremy.
(This used to be commit d3379fe61b)
2007-10-10 10:56:27 -05:00
Gerald Carter
d097ea4905 r4539: patch from Rob -- adding real printcap name cache function to speed up printcap reloads
(This used to be commit 1cad525093)
2007-10-10 10:53:46 -05:00
Jeremy Allison
32f9ee7c20 r4190: When changing length calculations, get them right......
Jeremy.
(This used to be commit 63cfa904ad)
2007-10-10 10:53:37 -05:00
Jeremy Allison
5b713a206b r4186: Fix client & server to allow 127k READX calls.
Jeremy.
(This used to be commit 831cb21a87)
2007-10-10 10:53:36 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
6219c997cb r1936: Fix bug noticed by Steve - ensure extended security bit is on only
if we negotiated extended security. Do not merge for 3.0.6. Works
with W2K but needs further testing.
Jeremy.
(This used to be commit 284689aa18)
2007-10-10 10:52:24 -05:00
Jeremy Allison
3e0f586298 r1263: Make "defer sharing violations" a global parameter.
Jeremy.
(This used to be commit 42cdeccc36)
2007-10-10 10:52:04 -05:00
Jeremy Allison
2acd084866 r1154: Change default setting for case sensitivity to "auto". If set to auto
then is the client supports it (current clients supported are Samba and
CIFSVFS - detected by the negprot strings "Samba", "POSIX 2" and a bare
"NT LM 0.12" string) then the setting of the per packet flag smb_flag
FLAG_CASELESS_PATHNAMES is taken into account per packet. This allows
the linux CIFS client to use Samba in a case sensitive manner.
Additional command in smbclient "case_sensitive", toggles the
flag in subsequent packets.
Docs to follow.
Jeremy.
(This used to be commit cf84c0fe1a)
2007-10-10 10:51:57 -05:00
Jeremy Allison
effd4a3385 r1089: Removed spurious oplock message in deferred open processing.
Fix smb signing sequence counts.
Jeremy.
(This used to be commit 7e2a5c3661)
2007-10-10 10:51:54 -05:00
Jeremy Allison
2fc57c9a2c r1085: Now it's had some proper user testing, merge in the deferred open fix. I'm
still doing more testing, but it fixes a behaviour that we've been wrong
on ever since the start of Samba.
Jeremy.
(This used to be commit 894cc6d162)
2007-10-10 10:51:54 -05:00
Jeremy Allison
a6f5c88563 r998: Arrrgggh. Do it right this time :-(.
Jeremy.
(This used to be commit 7ac7cd4162)
2007-10-10 10:51:53 -05:00
Jeremy Allison
b7ac82294f r996: Fix error in change to queuing code (dlink).
Jeremy.
(This used to be commit 6bd6359090)
2007-10-10 10:51:53 -05:00
Jeremy Allison
03d4344432 r971: Auto remove store dos attributes if underlying filesystem
doesn't support EA's.
Jeremy.
(This used to be commit 9de6b25c9e)
2007-10-10 10:51:51 -05:00
Herb Lewis
99d8aa8b17 r814: conn is 0 during ioctl (at least during smbtorture IOCTL test)
fix smbd panic
(This used to be commit 61da0bb1f6)
2007-10-10 10:51:47 -05:00
Gerald Carter
67d474861d r799: BUG 1259 -- add 'printcap cache time' patch from Lars
(This used to be commit fac9074113)
2007-10-10 10:51:46 -05:00
Jeremy Allison
89db7e1001 r656: Make widelinks use realpath(). Tidy up cases where we need to become a service.
Jeremy.
(This used to be commit a03b6a05e0)
2007-10-10 10:51:33 -05:00
Jeremy Allison
1843f6905c r478: Added Volkers fix to be able to force DOS errors when needed.
Jeremy.
(This used to be commit a9d1738eba)
2007-10-10 10:51:24 -05:00
Jeremy Allison
b88f446352 Added NTrename SMB (0xA5) - how did we miss this.... ?
Jeremy.
(This used to be commit dfd7d1c2b7)
2004-02-24 00:06:08 +00:00
Jeremy Allison
27891bdef1 Subtract NT_STATUS from common flag, don't add it...
Jeremy.
(This used to be commit 4e73faa7b4)
2003-12-01 06:19:17 +00:00
Jeremy Allison
6bb8f54e01 Don't automatically set nt status code flag unless client tells us it can
cope.
Jeremy.
(This used to be commit 0d82ac57a5)
2003-12-01 02:25:56 +00:00
Jeremy Allison
9c8d23e5d5 Fix debug message warning.
Jeremy.
(This used to be commit 154793981a)
2003-11-05 00:16:01 +00:00
Tim Potter
fbb8f131c2 Fix more 64-bit printf warnings.
(This used to be commit 23443e3aa0)
2003-11-03 14:34:25 +00:00
Jeremy Allison
3fe18a46a3 Fix signing miss-sequence noticed by Stefan Metzmacher <metze@metzemix.de>
Jeremy.
(This used to be commit 63f3315643)
2003-10-21 17:40:58 +00:00
Jeremy Allison
245fbf7efb Used cachegrind to track down some bottlenecks.
Removed calls to clobber_region when not compiling with developer as
they were hiding speed problems.
Added fast path to convert_string() when dealing with ascii -> ascii,
ucs2-le to ascii and ascii to ucs2-le with values <= 0x7F. This
gives a speedup of 22% on my nbench tests.
Next I will do this on convert_string_allocate.
Jeremy.
(This used to be commit ef140d15ea)
2003-09-04 01:12:39 +00:00
Jeremy Allison
fcdebdae6f Fix bug found by tridge in 2.2.x. Ensure that %U substitution is
restored on next valid packet if a logon fails. This has relevence
if people are using su.exe within logon scripts !
Jeremy.
(This used to be commit d405a93a9d)
2003-08-28 23:57:34 +00:00
Jeremy Allison
110abf10d2 Turns out I had my packet sequences wrong for oplock break code.
I was storing the mid of the oplock break - I should have been
storing the mid from the open. There are thus 2 types of deferred
packet sequence returns - ones that increment the sequence number
(returns from oplock causing opens) and ones that don't (change notify
returns etc). Running with signing forced on does lead to some
interesting tests :-).
Jeremy.
(This used to be commit 85907f02ce)
2003-08-07 02:59:52 +00:00
Jeremy Allison
ceb68ee051 Fix packet signing with asynchronous oplock breaks. Removed bad error message
due to w2k bug. I think this code is now working.... Need more testing of course
but works on all the obvious cases I can think of.
Jeremy.
(This used to be commit a6e537f661)
2003-07-24 19:05:32 +00:00
Jeremy Allison
0c9433c031 Ensure everywhere we defer an incoming SMB request (blocking lock queue,
in oplock break state, change notify queue) we also push the MID onto
the deferred signing queue. Tomorrow I will test this with valgrind and
oplock tests.
Jeremy.
(This used to be commit 33a377f372)
2003-07-24 06:56:56 +00:00
Jeremy Allison
1eff052300 Reformatting fixes to bring in line with the rest of the source.
Jeremy.
(This used to be commit 3c11d93623)
2003-07-16 18:06:27 +00:00
Jelmer Vernooij
06551c644c Patch from metze to add exit and interval events. Useful for modules
(This used to be commit 3033a63cef)
2003-05-06 02:34:59 +00:00
Andrew Bartlett
f071020f5e Merge from HEAD - save the type of channel used to contact the DC.
This allows us to join as a BDC, without appearing on the network as one
until we have the database replicated, and the admin changes the configuration.

This also change the SID retreval order from secrets.tdb, so we no longer
require a 'net rpc getsid' - the sid fetch during the domain join is sufficient.
Also minor fixes to 'net'.

Andrew Bartlett
(This used to be commit 876e00fd11)
2003-04-21 14:09:03 +00:00
Jelmer Vernooij
a8c95d79f8 Add support for the new modules system to auth/ (merge from HEAD)
(This used to be commit c7a1de090d)
2003-04-16 12:13:07 +00:00
Andrew Bartlett
1f499a79f5 (merge from HEAD)
Small clenaup patches:
 - safe_string.h - don't assume that __FUNCTION__ is available
 - process.c - use new workaround from safe_string.h for the same
 - util.c - Show how many bytes we smb_panic()ed trying to smb_xmalloc()
 - gencache.c - Keep valgrind quiet by always null terminating.
 - clistr.c - Add copyright
 - srvstr.h - move srvstr_push into a .c file again, as a real function.
 - srvstr.c - revive, with 'safe' checked srvstr_push
 - loadparm.c - set a default for the display charset.

 - connection.c - use safe_strcpy()
Andrew Bartlett
(This used to be commit c91e76bddb)
2003-03-22 13:47:42 +00:00
Jeremy Allison
fb3e4b8797 Fix to allow blocking lock notification to be done rapidly (no wait
for smb -> smb lock release). Adds new PENDING_LOCK type to lockdb
(does not interfere with existing locks).
Jeremy.
(This used to be commit 766928bbba)
2003-02-27 01:04:34 +00:00
Jeremy Allison
bbf9f09ee5 Add 3 second timeout when terminating server and sending print notify
messages. Stops build-up of large numbers of smbd's waiting to terminate
on large print throughput.
Jeremy.
(This used to be commit 07efebb984)
2003-01-30 23:55:58 +00:00
Tim Potter
142837e5d3 Merge of controversial 'max log size' fix.
(This used to be commit 71e2b60d8f)
2003-01-30 04:38:39 +00:00
Jeremy Allison
dd072d240b Fixed typo found by tpot.
Jeremy.
(This used to be commit 7e2bc1fe58)
2003-01-24 19:05:32 +00:00
Gerald Carter
071af8f007 [merge] make sure to update print queue cache during timeout_processing() to send notify events; CR 1491
(This used to be commit f8a915b14d)
2003-01-11 02:38:36 +00:00
Herb Lewis
195ec103d6 Moved smbd process counting functions from smbd/server.c to smbd/process.c
so that bin/vfstest can link.  merge from head
(This used to be commit 9151cd7d64)
2003-01-09 06:26:04 +00:00
Jeremy Allison
38aee23f80 Ensure we don't get an invalid number for total smbd's if the tdb update
fails.
Jeremy.
(This used to be commit e048259472)
2003-01-08 21:42:53 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Jeremy Allison
39c78bf516 Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.
Jeremy.
(This used to be commit ec4ed45563)
2002-12-11 23:54:40 +00:00
Gerald Carter
612e1ffdba merges from HEAD - change_trust_account_password() must always talk to PDC
(This used to be commit af2fa43850)
2002-12-04 20:57:48 +00:00
Jeremy Allison
2f194322d4 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit f755711df8)
2002-11-12 23:20:50 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Jelmer Vernooij
127e77e6e3 Sync 3.0 branch with head
(This used to be commit 42615b945e)
2002-08-17 15:27:10 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Jeremy Allison
840279f342 Now we have reliable signals take SIGTERM inband.
Jeremy.
(This used to be commit cad82926a8)
2002-03-14 02:15:08 +00:00
Andrew Bartlett
d79e11ad6d Various comment fixes from Rafal Szczesniak <mimir@diament.ists.pwr.wroc.pl>
(This used to be commit 3bf4b42771)
2002-03-01 01:24:30 +00:00
Jeremy Allison
69adbb0ce3 Fix from Michael Steffens <michael_steffens@hp.com> to make signal
processing work correctly in winbindd. This is a really good patch
that gives full select semantics to the Samba modified select.
Jeremy.
(This used to be commit 3af16ade17)
2002-01-31 23:26:12 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Jim McDonough
723b368dc2 Check request flag for unicode capability and respond accordingly, rather than only doing unicode. smbfs didn't work.
(This used to be commit 95857a3515)
2002-01-23 18:09:56 +00:00
Jeremy Allison
e400bfce39 Report write fail in smb_dump.
Jeremy.
(This used to be commit 832b9e7838)
2002-01-19 21:29:20 +00:00
Jeremy Allison
d6823366b8 Same fix as went into 2.2 (I'm waiting for jerry to finish some code).
Jeremy.
(This used to be commit 01ff6ce496)
2002-01-11 19:10:25 +00:00
Jeremy Allison
d2687a00e1 Fixed up atomic update code.
Jeremy.
(This used to be commit 274b04d4a6)
2002-01-09 02:35:08 +00:00
Andrew Bartlett
2e28f8ff0e I've decided to move the auth code around a bit more...
The auth_authsupplied_info typedef is now just a plain struct - auth_context,
but it has been modified to contain the function pointers to the rest
of the auth subsystem's components.

(Who needs non-static functions anyway?)

In working all this mess out, I fixed a number of memory leaks and moved the
entire auth subsystem over to talloc().

Note that the TALLOC_CTX attached to the auth_context can be rather long-lived,
it is provided for things that are intended to live as long.  (The
global_negprot_auth_context lasts the whole life of the smbd).

I've also adjusted a few things in auth_domain.c, mainly passing the domain as
a paramater to a few functions instead of looking up lp_workgroup().  I'm
hopign to make this entire thing a bit more trusted domains (as PDC) freindly
in the near future.

Other than that, I moved a bit of the code around, hence the rather messy diff.

Andrew Bartlett
(This used to be commit 12f5515f55)
2002-01-05 04:55:41 +00:00
Martin Pool
f55c47b1ff Fix talloc msg registration
(This used to be commit 9a473ecf96)
2002-01-03 05:57:41 +00:00
Martin Pool
af643d5f1f smbd children should also register for POOL_USAGE
(This used to be commit b46d874f47)
2002-01-03 05:41:13 +00:00
Andrew Tridgell
216f3ae908 cleanup a little namespace pollution
(This used to be commit e5b484451a)
2001-12-10 03:21:38 +00:00
Andrew Tridgell
1fb4d2f1b0 don't try to auto-change the trust password unless we are in domain
security
(This used to be commit 00e4f0c803)
2001-11-27 01:51:10 +00:00
Tim Potter
178f6a64b2 challange -> challenge
(This used to be commit d6318add27)
2001-11-26 04:05:28 +00:00
Andrew Bartlett
d0a2faf78d This is another rather major change to the samba authenticaion
subystem.

The particular aim is to modularized the interface - so that we
can have arbitrary password back-ends.

This code adds one such back-end, a 'winbind' module to authenticate
against the winbind_auth_crap functionality.  While fully-functional
this code is mainly useful as a demonstration, because we don't get
back the info3 as we would for direct ntdomain authentication.

This commit introduced the new 'auth methods' parameter, in the
spirit of the 'auth order' discussed on the lists.  It is renamed
because not all the methods may be consulted, even if previous
methods fail - they may not have a suitable challenge for example.

Also, we have a 'local' authentication method, for old-style
'unix if plaintext, sam if encrypted' authentication and a
'guest' module to handle guest logins in a single place.

While this current design is not ideal, I feel that it does
provide a better infrastructure than the current design, and can
be built upon.

The following parameters have changed:
 - use rhosts =

  This has been replaced by the 'rhosts' authentication method,
 and can be specified like 'auth methods = guest rhosts'

 - hosts equiv =

  This needs both this parameter and an 'auth methods' entry
  to be effective.  (auth methods = guest hostsequiv ....)

 - plaintext to smbpasswd =

  This is replaced by specifying 'sam' rather than 'local'
  in the auth methods.

The security = parameter is unchanged, and now provides defaults
for the 'auth methods' parameter.

The available auth methods are:

guest
rhosts
hostsequiv
sam (passdb direct hash access)
unix (PAM, crypt() etc)
local (the combination of the above, based on encryption)
smbserver (old security=server)
ntdomain (old security=domain)
winbind (use winbind to cache DC connections)


Assistance in testing, or the production of new and interesting
authentication modules is always appreciated.

Andrew Bartlett
(This used to be commit 8d31eae52a)
2001-11-24 12:12:38 +00:00
Tim Potter
d876260d88 Don't put a \n on the end of the arg to exit_server()
(This used to be commit dfb8566220)
2001-11-05 00:02:38 +00:00
Tim Potter
7cd889f566 Converted a bunch of 0x85 constants to SMBkeepalive.
(This used to be commit b16a15a13e)
2001-10-20 23:34:40 +00:00
Jeremy Allison
6cc3953196 Restored old Bmpx code - actually used by OS/2.
Jeremy.
(This used to be commit 7c1688fd67)
2001-10-19 00:56:03 +00:00
Jeremy Allison
c416ff851b Merge the become_XXX -> change_to_XXX fixes from 2.2.2 to HEAD.
Ensure make_conection() can only be called as root.
Jeremy.
(This used to be commit 8d23a7441b)
2001-10-18 20:15:12 +00:00
Andrew Tridgell
b728042334 added basic NTLMSSP support in smbd. This is still quite rough, and
loses things like username mapping. I wanted to get this in then
discuss it a bit to see how we want to split up the existing
session setup code
(This used to be commit b74fda69bf)
2001-10-17 08:54:19 +00:00
Jeremy Allison
d731149a41 Fixed inconsistent definitions of InBuf/OutBuf/last_char.
Noticed by albert chin (china@thewrittenword.com) .
Jeremy.
(This used to be commit f5781f11eb)
2001-10-17 01:38:23 +00:00
Jeremy Allison
76745313b1 Fixed bug when status=no and max smbd processes > 0.
Jeremy.
(This used to be commit d1adaee373)
2001-10-11 05:53:15 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Simo Sorce
61b2794968 move to SAFE_FREE()
(This used to be commit a95943fde0)
2001-09-17 11:25:41 +00:00
Jeremy Allison
45706091f3 Fix for second logic bug when handing oplock breaks and client messages
simultaneously.
Jeremy.
(This used to be commit 227325b2d6)
2001-09-10 23:03:14 +00:00
Jeremy Allison
11f0402a74 Fix I think for the fcntl spinning problem. Re-prioritize so
that oplock break messages get priority over incoming client messages.
Jeremy.
(This used to be commit 1779f6a223)
2001-09-05 22:45:48 +00:00
Andrew Tridgell
e8e98c9ea0 converted smbd to use NTSTATUS by default
major changes include:

- added NSTATUS type
- added automatic mapping between dos and nt error codes
- changed all ERROR() calls to ERROR_DOS() and many to ERROR_NT()
  these calls auto-translate to the client error code system
- got rid of the cached error code and the writebmpx code

We eventually will need to also:
- get rid of BOOL, so we don't lose error info
- replace all ERROR_DOS() calls with ERROR_NT() calls

but that is too much for one night
(This used to be commit 83d9896c1e)
2001-08-27 08:19:43 +00:00
Herb Lewis
c50ef23215 force checking of log size after 200 smbd in a row or after 30 sec with no
smbds. This should fix one case of logs not getting rotated properly.

We may need to test this to make sure there is no big performance hit from
the extra stat call.
(This used to be commit 2501fe7c04)
2001-08-22 04:58:00 +00:00
Jeremy Allison
541f2b73bc Fix inspired by Don @ HP. Close down password server connection if keepalive
fails.
Jeremy.
(This used to be commit 1f6e3d18cd)
2001-08-09 19:22:51 +00:00
Jeremy Allison
5b69009b25 Fixed the nastiest locking bug to track down.... smb_pids are sent in the
lockingX calls - use that instead of smb_pid in the packet.
Jeremy.
(This used to be commit a3925cb9c6)
2001-07-02 02:42:41 +00:00
Andrew Tridgell
b95a294a08 fixed usage of socklen_t and also tidied up SIG_ATOMIC_T, using a typedef instead of a define
(This used to be commit e2ecff419f)
2001-06-25 02:53:13 +00:00
Jeremy Allison
5ba566efb7 Fixed logic bug in timeout processing spotted by Ying Chen <ying@almaden.ibm.com>.
Jeremy.
(This used to be commit 08c1682423)
2001-06-22 20:56:52 +00:00
Andrew Tridgell
fcda2645f0 added a close-share smbcontrol message that forcibly closes a share in smbd (to allow unmount)
(This used to be commit 15b17a80db)
2001-06-20 03:05:09 +00:00
Jeremy Allison
f63ee18c68 *Wonderful* patch from Andrew Bartlett that will help ensure tdb's are
cleaned on clients abending connections. Thanks Andrew !
Jeremy.
(This used to be commit 1b3977c536)
2001-06-09 01:38:54 +00:00
Jeremy Allison
15e66ba37a Added tdb_change_int_atomic() to allow atomic updates of a tdb int value.
Jeremy.
(This used to be commit cf5015f159)
2001-05-25 00:48:28 +00:00
Jeremy Allison
9ff6634db9 Fixup the large_writex problem (a large_writex can send a full 64k of data,
we already have space for this we just need to understand the length correctly).
Jeremy.
(This used to be commit 19145bae72)
2001-05-24 19:28:22 +00:00
Jeremy Allison
f9a15ce1a6 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
(This used to be commit 94747b4639)
2001-04-08 20:22:39 +00:00
Andrew Tridgell
23e5cf060d this patch does a number of things:
- removes SMB_ALIGNMENT. That macro caused all sorts of problems with
  getting unicode aligned right in sub-protocols (such as SMBtrans and
  SMBtrans2). I believe the performance reasons for having
  SMB_ALIGNMENT has gone away with the new variants of the SMB
  protocol anyway, as newer commands tend to have their own internal
  alignment.

- fix the locations where we set smb_flg2 to absolute values. We must
  never do this if we want a hope of coping with unicode.

- add initial support for unicode on the wire in smbd. Currently
  enabled using SMBD_USE_UNICODE environment variable.
(This used to be commit b98b1435e9)
2001-03-13 00:55:19 +00:00
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Jeremy Allison
5265ce7837 Added total memory allocated counter to talloc, so we can tell if a talloc
pool is getting bloated. Also added a talloc_zero function to return zeroed memory.
Added debug in rpc_server/srv_pipe_hnd.c so we know when a talloc pool is being
freed. Syncup with srv_pipe_hnd.c from 2.2 so we are freeing memory at the same time.
Jeremy.
(This used to be commit d3a56c6042)
2001-02-27 19:22:02 +00:00
Jeremy Allison
94fc44a93c Merge of JohnR's changes to appliance-head, JF's changes to 2.2,
updated the POSIX_ACL code to be in sync.
Jeremy.
(This used to be commit c0517d6f4e)
2001-02-12 16:18:02 +00:00
Jeremy Allison
24f8e973b2 smbd/process.c: & type with 0xff for paranioa sake...
smbd/reply.c smbd/service.c: cause all "add home service" calls to go through a
winbindd aware function.
Jeremy.
(This used to be commit a72d12e992)
2001-01-24 19:34:53 +00:00
Jeremy Allison
918c3ebe32 smbd/lanman.c: Fix for calling qsort with 0 number.
smbd/nttrans.c: Realloc mem fixes based on those that went into trans2.c
smbd/process.c: Move to a table based dispatch, based on a comment from Andrew
				about Antons work.
Jeremy.
(This used to be commit a958f7822e)
2001-01-24 19:04:56 +00:00
Jeremy Allison
2f7c1db093 include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added fchmod_acl and chmod_acl.
lib/substitute.c:
smbd/lanman.c:
smbd/open.c:
smbd/process.c:
smbd/reply.c:
smbd/service.c: Removed sessetup_user variable. Added current_user_info struct
which conatins domain info etc. Added '%D' for client domain parameter.
Jeremy.
(This used to be commit 2844ec3d51)
2001-01-23 01:52:30 +00:00
Jeremy Allison
2bd3a436fd Fix for updating of print queues changed from a local box. Essentially,
this makes sure that the change messages sent to ourselves are handled
synchronously w.r.t. other smb packets incoming.
Jeremy.
(This used to be commit 78a1307445)
2000-11-21 00:30:15 +00:00
Herb Lewis
7a42a9da7d use macros for incrementing profile counters
(This used to be commit cae5eeb16e)
2000-10-12 15:41:16 +00:00
Jeremy Allison
e9270d61fc Remove lpq as root fix - do this in print_job_start instead
as part of print queue length processing.
Jeremy.
(This used to be commit e85a0fadd8)
2000-10-11 02:04:46 +00:00
Jeremy Allison
cdb71ca518 Fixes to periodically scan printing.tdb in idle time and occasionally
on exit. Needed to fix printing.tdb from groving to 300Mb+ if being
driven by smbclient clients that never ask for status... (effective
DOS attack :-).
Jeremy.
(This used to be commit 6581066b93)
2000-10-10 21:52:31 +00:00
Andrew Tridgell
3689e4ffc1 the first cut of the internal messaging system.
The motivation for this system is to replace the UDP message for
oplocks, but this commit only does the "set debug level" message.
(This used to be commit 2a34ee95f3)
2000-09-11 07:02:43 +00:00
Jeremy Allison
17dcd9a834 Started to canonicalize our handling of uid -> sid code in order to
get ready and fix se_access_check().
Added cannonical lookup_name(), lookup_sid(), uid_to_sid(), gid_to_sid()
functions that look via winbind first the fall back on local lookup.

All Samba should use these rather than trying to call winbindd code
directly.

Added NT_USER_TOKEN struct in user_struct, contains list of NT sids
associated with this user.

se_access_check() should use this (cached) value rather than attempting
to do the same thing itself when given a uid/gid pair.

More work needs to be done to preserve these things accross security
context changes (especially with the tricky pipe problem) but I'm
beginning to see how this will be done..... probably by registering
a new vuid for an authenticated RPC pipe and not treating the
pipe calls specially.

More thoughts needed - but we're almost there...

Jeremy.
(This used to be commit 5e5cc6efe2)
2000-08-02 02:11:55 +00:00
Jeremy Allison
5ec1642809 Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256)
character comment in the printer properties page.

The new system associates a TALLOC_CTX with the pipe struct, and frees
the pool on return of a complete PDU.

A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx
code, and is freed in the main loop.

This code works with insure, and seems to be free of memory leaks and
crashes (so far) but there are probably the occasional problem with
code that uses UNISTRxx structs on the stack and expects them to contain
storage without doing a init_unistrXX().

This means that rpcclient will probably be horribly broken.
A TALLOC_CTX also needed associating with the struct cli_state also,
to make the prs_xx code there work.

The main interface change is the addition of a TALLOC_CTX to the
prs_init calls - used for dynamic allocation in the prs_XXX calls.

Now this is in place it should make dynamic allocation of all RPC
memory on unmarshall *much* easier to fix.

Jeremy.
(This used to be commit 0ff2ce543e)
2000-07-27 00:47:19 +00:00
Andrew Tridgell
cc5502a4d0 allow the notify implementation to choose the select timeout change
(This used to be commit b1441d9622)
2000-06-14 07:11:27 +00:00
Andrew Tridgell
b2d01bd2db totally rewrote the async signal, notification and oplock notification
handling in Samba. This was needed due to several limitations and
races in the previous code - as a side effect the new code is much
cleaner :)

in summary:

- changed sys_select() to avoid a signal/select race condition. It is a
  rare race but once we have signals doing notification and oplocks it
  is important.

- changed our main processing loop to take advantage of the new
  sys_select semantics

- split the notify code into implementaion dependent and general
  parts. Added the following structure that defines an implementation:

struct cnotify_fns {
	void * (*register_notify)(connection_struct *conn, char *path, uint32 flags);
	BOOL (*check_notify)(connection_struct *conn, uint16 vuid, char *path, uint32 flags, void *data, time_t t);
	void (*remove_notify)(void *data);
};


then I wrote two implementations, one using hash/poll (like our old
code) and the other using the new Linux kernel change notify. It
should be easy to add other change notify implementations by creating
a sructure of the above type.

- fixed a bug in change notify where we were returning the wrong error
  code.

- rewrote the core change notify code to be much simpler

- moved to real-time signals for leases and change notify

Amazingly, it all seems to work. I was very surprised!
(This used to be commit 44766c39e0)
2000-06-12 15:53:31 +00:00
Andrew Tridgell
8843a6379d Linux kernel oplocks now seem to work, but need a _lot_ of testing
I had to modify sys_select() to not loop on EINTR. I added a wrapper
called sys_select_intr() which gives the old behaviour.
(This used to be commit b28cc4163b)
2000-06-11 05:57:58 +00:00
Andrew Tridgell
da44845a09 moved secrets fns into secrets.c
(This used to be commit f890bcf067)
2000-06-03 06:22:19 +00:00
Luke Leighton
62707533f7 debug output to /tmp.
(This used to be commit f9077e50cb)
2000-05-28 20:11:04 +00:00
Luke Leighton
712a30ed51 prs_give_memory in wrong place, also poss. was losing mem.
(This used to be commit 9805e17cd0)
2000-05-27 09:19:57 +00:00
Jeremy Allison
b27886addb passdb/secrets.c: Fix typo in comment.
rpc_server/srv_pipe.c: Use accessor functions rather than diddling with structure
internals directly.
smbd/process.c:
smbd/reply.c: Remove READ_PREDICTION #ifdefs.
Jeremy.
(This used to be commit eba825ff03)
2000-05-15 17:13:50 +00:00
Andrew Tridgell
e86cba2194 check for sighup on each packet - otherwise it can take a _long_ time
to reload services
(This used to be commit 0fb4ba4e03)
2000-05-10 11:49:55 +00:00
Andrew Tridgell
49a0e6d598 more merging voodoo
this adds "#define OLD_NTDOMAIN 1" in lots of places. Don't panic -
this isn't permanent, it should go after another few merge steps have
been done
(This used to be commit 92109d7b3c)
2000-05-10 10:41:59 +00:00
Andrew Tridgell
2958dfcdf8 added secrets.tdb and changed storage of trust account password to use
it
(This used to be commit 88ad00b82a)
2000-05-08 10:42:21 +00:00
Andrew Tridgell
32d5416b6a split the username in the vuser structure into a separate
userdom_struct. As the name implies this also contains a domain
(unused at the moment).

This will be important shortly, as operation in appliance mode needs
the domain to be always carried with the username.
(This used to be commit ee8546342d)
2000-05-02 13:55:42 +00:00
Jeremy Allison
693ffb8466 Added sys_fork() and sys_getpid() functions to stop the overhead
of doing a system call every time we want to just get our pid.
Jeremy.
(This used to be commit 148628b616)
2000-05-02 02:23:41 +00:00
Andrew Tridgell
05cb3464f9 - added some error checking
- removed the VTP hook in smbd
(This used to be commit 09355fcd50)
2000-04-30 15:13:15 +00:00
Jeremy Allison
4b60a33c6f Ok - this is more subtle than it looks :-).
When a file is being closed, once it passes the fnum and tid tests then
the locking context should be ignored when removing all locks. This is
what is done in the brl close case, but when you have outstanding
POSIX locks, then you cannot remove all the brl locks in one go, you
have to get the lock list and call do_unlock individually. As this
uses global_smbpid as the locking context, you need to make sure
that this is set correctly for the specific lock being removed. I
now do this by storing the smbpid in each entry in the unlock list returned from
the query call. I removed the smbpid from fsp (not needed) and
things seem ok (even with the stupid smbpid tricks that smbtorture plays :-).

Jeremy.
(This used to be commit 6baa96bb46)
2000-04-27 23:28:56 +00:00
Jeremy Allison
36db78feda Fixed subtle unlocking bug when a file is closed. We need to store the
smbpid used when a file was opened in the files_struct. Else we use
the wrong global_smbpid when we are closing the file and trying to
remove the brl locks - this causes the brl locks to be left when the
file is closed as the samba_context check fails.
Jeremy.
(This used to be commit 2746e5602e)
2000-04-27 22:23:04 +00:00
Jeremy Allison
ce5e230952 Log file check patch from Mattias Gronlund <Mattias.Gronlund@sa.erisoft.se>.
Modified to do checks in timeout processing not in main loop. This (IMHO)
is the correct place as (a) we are already root, and (b) it is guarenteed
to be called every 200 smb requests.
Jeremy.
(This used to be commit c3794fd29f)
2000-04-15 00:31:56 +00:00
Andrew Tridgell
2fa922611b finally got sick of the "extern int Client" code and the stupid
assumption that we have one socket everywhere

while doing so I discovered a few bugs!

1) the clientgen session retarget code if used from smbd or nmbd would
cause a crash as it called close_sockets() which closed our main
socket! fixed by removing close_sockets() completely - it is unnecessary

2) the caching in client_addr() and client_name() was bogus - it could
easily get fooled and give the wrong result. fixed.

3) the retarget could could recurse, allowing an easy denial of
service attack on nmbd. fixed.
(This used to be commit 5937ab14d2)
2000-04-11 13:55:53 +00:00
Shirish Kalele
952799d9af dded Microsoft Dfs services.
* added a new msdfs/ directory under source/
* added msdfs sources under this directory.
* modified configure setup to add a --with-msdfs configure time option

 Modified Files:
 	Makefile.in acconfig.h configure configure.in
 	include/config.h.in include/includes.h include/proto.h
 	include/smb.h include/smb_macros.h param/loadparm.c
 	smbd/negprot.c smbd/nttrans.c smbd/process.c smbd/reply.c
 	smbd/server.c smbd/trans2.c
 Added Files:
 	include/msdfs.h msdfs/README msdfs/msdfs.c msdfs/msdfs_tdb.c
 	msdfs/parse_dfs_map.c
 ----------------------------------------------------------------------
(This used to be commit 4684b4a188)
2000-03-08 22:14:30 +00:00
Jeremy Allison
b5e7e4277d First set of speed improvements from Ying Chen <ying@almaden.ibm.com>.
Inline several commonly used functions as macros.
Jeremy.
(This used to be commit fc0219c7cc)
2000-01-25 22:57:51 +00:00
Andrew Tridgell
2afd5d5eb5 some more work on the byte range locking
note the ugly global_smbpid - I hope that won't bethere for long, I
just didn't want to do two lots of major surgery at the one time.
Using global_smbpid avoids the big change of getting rid of our
inbuf/outbuf interface to reply routines. I'll do that once the
locking stuff passes all tests.
(This used to be commit f8bebf91ab)
2000-01-14 00:50:48 +00:00
Andrew Tridgell
5e9f559187 implemented talloc() as described on samba-technical. This fixes the
lp_string() bug properly.

we still need to add lp_talloc_free() calls in all the main event
loops, I've only put it in smbd and nmbd thus far.
(This used to be commit aa7f815525)
2000-01-05 06:36:36 +00:00
Jeremy Allison
7b39ef2950 Fix from tulipant-gergely@dbrt.hu for returning incorrect error code
on user auth fail.
Jeremy.
(This used to be commit 886ad59d79)
1999-12-21 00:06:00 +00:00
Andrew Tridgell
3db52feb1f first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76)
1999-12-13 13:27:58 +00:00