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

40 Commits

Author SHA1 Message Date
Jeremy Allison
15bb28ccd2 IRIX include fixes.
Jeremy.
(This used to be commit 3a39acd353)
2000-03-31 20:44:55 +00:00
Jeremy Allison
5e22394654 Fixups for compiles with gcc flags -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual
Partially implemented rpc daemon redirect (needs more work).
Jeremy.
(This used to be commit a462191698)
2000-03-10 19:50:03 +00:00
Jean-François Micouleau
115d98e639 removed unused variable
J.F.
(This used to be commit e2557ae551)
2000-03-10 17:06:12 +00:00
Jeremy Allison
6bb92a6d38 Big update moving the multi-pdu support from 2.0.x into HEAD for JF
and the printer functions.
Also tidied up some header includes and got the order right so you
can now do a :

make proto
make clean
make

Jeremy.
(This used to be commit 833cd9fba9)
2000-03-09 21:45:16 +00:00
Jeremy Allison
9db96b7646 lib/system.c: Fixed gcc warnings.
nmbd/nmbd_processlogon.c: Use "True" and "False" instead of 1 and 0.
Others - preparing for multiple pdu write code.
Jeremy.
(This used to be commit 9f879ec396)
2000-02-23 02:02:33 +00:00
Luke Leighton
d91bfabc5d made cvs main up-to-date with samba_tng, with addition of process id to
msrpc loop-back interface.
(This used to be commit adbf97c0a9)
2000-01-21 02:33:21 +00:00
Luke Leighton
8433aa4379 modified smbd/msrpc credential transfer system. user session key
is *missing* from samba cvs main, therefore it is set to all zeros.
this will cause, amongst other things, administrator-changing-user-passwords,
and setting up new accounts, to fail, as the user's password can only be
decoded with the session key (in this case, the administrator's usr sess key).

it's never a perfect world, is it?
(This used to be commit 3362fcdfa4)
2000-01-11 02:00:31 +00:00
Luke Leighton
fbd17c8daf simple mods to add msrpc pipe redirection. default behaviour: fall back
to using internal msrpc code in smbd.
(This used to be commit 8976e26d46)
2000-01-03 19:19:48 +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
Luke Leighton
4f8a24522c final part of "first" phase converting over to msrpc daemon architecture.
done a minimal amout of clean-up in the Makefile, removing unnecessary
modules from the link stage.  this is not complete, yet, and will
involve some changes, for example to smbd, to remove dependencies on
the password database API that shouldn't be there.  for example,
smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa
API.

this first implementation has minor problems with not reinstantiating
the same services as the caller.  the "homes" service is a good example.
(This used to be commit caa5052522)
1999-12-12 20:03:42 +00:00
Luke Leighton
0ce128e355 delineation between smb and msrpc more marked. smbd now constructs
pdus, and then feeds them over either a "local" function call or a "remote"
function call to an msrpc service.  the "remote" msrpc daemon, on the
other side of a unix socket, then calls the same "local" function that
smbd would, if the msrpc service were being run from inside smbd.

this allows a transition from local msrpc services (inside the same smbd
process) to remote (over a unix socket).

removed reference to pipes_struct in msrpc services.  all msrpc processing
functions take rpcsrv_struct which is a structure containing state info
for the msrpc functions to decode and create pdus.

created become_vuser() which does everything not related to connection_struct
that become_user() does.

removed, as best i could, connection_struct dependencies from the nt spoolss
printing code.

todo: remove dcinfo from rpcsrv_struct because this stores NETLOGON-specific
info on a per-connection basis, and if the connection dies then so does
the info, and that's a fairly serious problem.

had to put pretty much everything that is in user_struct into parse_creds.c
to feed unix user info over to the msrpc daemons.  why?  because it's
expensive to do unix password/group database lookups, and it's definitely
expensive to do nt user profile lookups, not to mention pretty difficult
and if you did either of these it would introduce a complication /
unnecessary interdependency.  so, send uid/gid/num_groups/gid_t* +
SID+num_rids+domain_group_rids* + unix username + nt username + nt domain
+ user session key etc.  this is the MINIMUM info identified so far that's
actually implemented.  missing bits include the called and calling
netbios names etc.  (basically, anything that can be loaded into
standard_sub() and standard_sub_basic()...)
(This used to be commit aa3c659a8d)
1999-12-12 01:25:49 +00:00
Luke Leighton
a0ba234cf9 the first independent msrpc daemon - lsarpcd.
one horrible cut / paste job from smbd, plus a code split of shared
components between the two.

the job is not _yet_ complete, as i need to be able to do a become_user()
call for security reasons.  i picked lsarpcd first because you don't
_need_ security on it (microsoft botched so badly on this one, it's not
real.  at least they fixed this in nt5 with restrictanonymous=0x2).
fixing this involves sending the current smb and unix credentials down
the unix pipe so that the daemon it eventually goes to can pick them
up at the other end.

i can't believe this all worked!!!
(This used to be commit 2245b0c6d1)
1999-12-06 00:44:32 +00:00
Luke Leighton
003f7364fd adding error checking in parsing code
(This used to be commit 4c98d71ebd)
1999-10-15 20:00:30 +00:00
Luke Leighton
43a460075a SAM database "set user info".
----------------------------

- removed DOM_RID4

- removed SAMR_UNKNOWN_32

- added SAMR_SET_USERINFO (opcode 0x32)

- added level 0x1 to SAMR_QUERY_DOM_INFO (needed for create user)

- fixed pwdb_gethexpwd() it was failing on XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

- added mod_sam21pwd_entry()

- preparing to call mod_sam21pwd_entry()

- added "user session key" to user_struct.dc.  this is md4(nt#) and is
  needed to decode user's clear-text passwords in SAMR_SET_USERINFO.

- split code out in chgpasswd.c to decode 516 byte password buffers.
(This used to be commit 2e58ed7424)
1999-03-25 13:54:31 +00:00
Matthew Chapman
a4bc522a72 The line:
this_pdu_data_pos = data_pos - p->prev_pdu_file_offset;

is correct for first two PDU's only, after that it results in extra
garbage after each fragment and hence "Protocol Error" messages from
NT4 SP4. Changed to:

    this_pdu_data_pos = (pdu_data_sent == 0) ? 0 : (pdu_data_sent - 0x18);
(This used to be commit b9e8a3ef3a)
1999-03-21 13:01:31 +00:00
Luke Leighton
96983a13ba when multiple independent large rpc calls come in on the same pipe,
prev_pdu_file_offset was not being re-initialised to zero.
(This used to be commit fcaa121441)
1999-02-09 21:42:39 +00:00
Luke Leighton
f61fc8923d corrections to get data stream for 2nd and subsequent pdus copied from
right place (forgot to subtract 0x18 header bytes)
(This used to be commit 5b9a7278da)
1999-02-03 01:58:52 +00:00
Luke Leighton
fe609d810e multiple dce/rpc PDUs failed to work after ntlmssp update was added.
(This used to be commit f082f07e76)
1999-02-03 00:48:27 +00:00
Luke Leighton
1ebeb54932 some quite important bug-fixes i missed because i transferred the wrong
smb.tgz file from my portable.

particularly the call to mem_data followed by a realloc of that data in
cli_pipe.c's rpc_read() function.

smbd responses now use p->rdata_i which is a faked-up pointer into
p->rdata's response data.  rdata can be very long; rdata_i is limited
to point to no more than max_tsize - 0x18 in length.  this will make
it an almost trivial task to add the encrypted rpc headers after
rdata_i, and mem_buf_copy will cope admirably with rhdr chained to
rdata_i chained to auth_verifier etc etc...
(This used to be commit 05a297e3a9)
1998-10-20 18:27:49 +00:00
Luke Leighton
a785f8d2c9 dce/rpc
(This used to be commit 29434f496c)
1998-10-16 23:40:59 +00:00
Luke Leighton
d4a82ea26d rpc client mods (ntlmssp flags)
(This used to be commit 16256f86bf)
1998-10-16 20:07:02 +00:00
Luke Leighton
a42afcdcc7 bug-fixing against:
AS/U:
      it returns dce/rpc "first" and "last" bits _clear_ in a bind/ack
      response, when they should be set in a (small) packet.  they also,
      in the bind/ack do not set a secondary address string at all, so
      we can't check against that...

Win95:
      client-side dce/rpc code is a bit odd.  it does a "WaitNamedPipeState"
      and has slightly different pipe-naming (\PIPE\LANMAN is joined by
      \PIPE\SRVSVC, \PIPE\WINREG etc whereas nt just has \PIPE\LANMAN
      and \PIPE\).

Win95-USRMGR.EXE:
      added LsaOpenPolicy (renamed existing to LsaOpenPolicy2).
      added SamrConnect (renamed existing to SamrConnect2).
(This used to be commit a7fccd807b)
1998-10-15 05:47:29 +00:00
Luke Leighton
6909350ed9 dce/rpc
(This used to be commit 62fdeef1b7)
1998-10-08 23:57:46 +00:00
Luke Leighton
48b31ae44f dce/rpc
(This used to be commit 6677b888bd)
1998-10-07 21:42:24 +00:00
Luke Leighton
2fef8f2e87 dce/rpc
(This used to be commit 34afa638f6)
1998-10-07 15:22:49 +00:00
Jeremy Allison
5b4d94e20f (Finally) implemented "max open files" as a global smb.conf parameter.
Sets up the files array correctly - limited by the smb.conf parameter
and by the max fd's per process as found by getrlimit().
Jeremy.
(This used to be commit eca24bd243)
1998-09-30 01:49:24 +00:00
Jeremy Allison
9066025a8a Got very strict about the differences and uses of
uid_t, gid_t and vuid. Added sys_getgroups() to get
around the int * return problem. Set correct datatypes
for all uid, gid and vuid variables.
Jeremy.
(This used to be commit e570db46fc)
1998-09-29 20:24:17 +00:00
Luke Leighton
500a474aae nttrans.c:
winreg was missing from the list of pipes.  advise using the array
already defined in... rpc_parse/parse_rpc.c's pipe_names[], but
writing code to strip "\PIPE\" from the front when making the
check.

one location to update when adding new pipes, not two.


srv_pipe_hnd.c:

moved the ZERO_STRUCT(p) macro to _before_ the DLIST_ADD(Pipes, p) macro.

dlinklist.h:

added { }s around the code inserted by DLIST_ADD and DLIST_REMOVE macros
(This used to be commit 29201d4b9b)
1998-09-23 21:49:09 +00:00
Andrew Tridgell
f6044c87c0 some cleanups to use ZERO_STRUCT() and friends
(This used to be commit 7b154dc431)
1998-09-05 13:24:20 +00:00
Andrew Tridgell
e9ea36e4d2 tridge the destroyer returns!
prompted by the interpret_security() dead code that Jean-Francois
pointed out I added a make target "finddead" that finds potentially
dead (ie. unused) code. It spat out 304 function names ...

I went through these are deleted many of them, making others static
(finddead also reports functions that are used only in the local
file).

in doing this I have almost certainly deleted some useful code. I may
have even prevented compilation with some compile options. I
apologise. I decided it was better to get rid of this code now and add
back the one or two functions that are needed than to keep all this
baggage.

So, if I have done a bit too much "destroying" then let me know. Keep
the swearing to a minimum :)

One bit I didn't do is the ubibt code. Chris, can you look at that?
Heaps of unused functions there. Can they be made static?
(This used to be commit 2204475c87)
1998-09-05 05:07:05 +00:00
Andrew Tridgell
72ed7049d8 added some optimisation for the case where the number of open files is
very large. files.c now promotes a files_struct to the top of the list
if it is used when it is more than 10 elements from the top.

also moved common linked list code for the 5 sets of linked lists that
I've created over the past few days into dlinklist.h (I've explained
to Chris why I didn't use the ubiqx code)
(This used to be commit 1eb9ae2996)
1998-08-17 06:47:53 +00:00
Andrew Tridgell
8978aae696 much cleaner chain pointer handling for both files and pipes.
the chain pointer is now stored as a static and is set whenever a
handle is created or extracted. This also makes the code less error
prone.
(This used to be commit 068a862982)
1998-08-17 03:52:05 +00:00
Andrew Tridgell
f2d538a105 some cleanups from the conversion of Pipes[] to a linked list. I also
removed most cases where a pnum is used and substituted a pipes_struct*.

in files.c I added a offset of 0x1000 to all file handles on the
wire. This makes it much less likely that bad parsing will give us the
wrong field.
(This used to be commit 8bc2627ff2)
1998-08-17 03:06:20 +00:00
Andrew Tridgell
127655cc88 this checkin gets rid of the global Files[] array and makes it local
in files.c

it should now be faily easy to expand the default MAX_OPEN_FILES to
many thousands.
(This used to be commit b088c804f9)
1998-08-15 07:27:34 +00:00
Andrew Tridgell
b9623ab59e this is the bug change to using connection_struct* instead of cnum.
Connections[] is now a local array in server.c

I might have broken something with this change. In particular the
oplock code is suspect and some .dll files aren't being oplocked when
I expected them to be. I'll look at it after I've got some sleep.
(This used to be commit c7ee025ead)
1998-08-14 17:38:29 +00:00
Luke Leighton
4ff2a51c15 compiler warning for unimportant uninitialised variable
(This used to be commit 81bf263092)
1998-05-06 12:11:35 +00:00
Luke Leighton
9189005f7f ABOUT time. dce/rpc long packet format now works, server-side.
turns out that [it can be deduced that] microsoft ignores the SMBreadX
offset, and goes by the SMBreadX length only.  this makes for a lot simpler
code, in both client and server.
(This used to be commit a8b641c027)
1998-04-24 21:01:08 +00:00
Luke Leighton
76d3bc36a5 put server-side long dce/rpc code in main branch.
(This used to be commit 2e1a08b28c)
1998-04-21 02:36:37 +00:00
Jeremy Allison
e300c0346f includes.h: Moved HPUX undefine of SEMMSL to where it actually does something.
ipc.c: Added Luke's debug statement.
locking_slow.c: Added FTRUNCATE_NEEDS_ROOT code for broken systems that
need it (not sure what these are yet).

membuffer.c ntdomain.h proto.h
lib/rpc/include/rpc_dce.h lib/rpc/include/rpc_srvsvc.h
lib/rpc/parse/parse_prs.c lib/rpc/parse/parse_rpc.c
lib/rpc/server/srv_pipe_hnd.c lib/rpc/server/srv_util.c:
   Re-merge of Luke's NTDOM changes 'cos he's a lazy git with
   carpel tunnel syndrome :-).

Jeremy.
(This used to be commit 52e3966fbc)
1998-04-10 18:21:16 +00:00
Jeremy Allison
fdeea341ed "For I have laboured mightily on Luke's code, and hath broken
all I saw" - the book of Jeremy, chapter 1 :-).

So here is the mega-merge of the NTDOM branch server code.
It doesn't include the new client side pieces, we'll look
at that later.

This should give the same functionality, server wise, as
the NTDOM branch does, only merged into the main branch.

Any fixes to domain controler functionality should be
added to the main branch, not the NTDOM branch.

This code compiles without warnings on gcc2.8, but will
need further testing before we are sure all the working
functionality of the NTDOM server branch has been
correctly carried over.

I hereby declare the server side of the NTDOM branch
dead (and all who sail in her :-).

Jeremy.
(This used to be commit 118ba4d77a)
1998-03-11 21:11:04 +00:00