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

313 Commits

Author SHA1 Message Date
Andrew Tridgell
0c5a5632a8 r1519: show the ldb_errstring() value in the log for failed ldb calls 2007-10-10 12:57:38 -05:00
Stefan Metzmacher
0e1f5e66d3 r1514: close stuff from the server_connection not in the
close_connection fn of a specific service

metze
2007-10-10 12:57:37 -05:00
Stefan Metzmacher
d7dd5347dd r1513: change DEBUG level to 1
metze
2007-10-10 12:57:37 -05:00
Andrew Bartlett
b97d3cb2ef r1498: (merge from 3.0)
Rework our random number generation system.

On systems with /dev/urandom, this avoids a change to secrets.tdb for every fork().

For other systems, we now only re-seed after a fork, and on startup.
No need to do it per-operation.  This removes the 'need_reseed'
parameter from generate_random_buffer().

This also requires that we start the secrets subsystem, as that is
where the reseed value is stored, for systems without /dev/urandom.

In order to aviod identical streams in forked children, the random
state is re-initialised after the fork(), at the same point were we do
that to the tdbs.

Andrew Bartlett
2007-10-10 12:57:35 -05:00
Stefan Metzmacher
bbe5e00715 r1486: commit the start of the generic server infastructure
the idea is to have services as modules (smb, dcerpc, swat, ...)

the process_model don't know about the service it self anymore.

TODO:
- the smbsrv should use the smbsrv_send function
- the service subsystem init should be done like for other modules
- we need to have a generic socket subsystem, which handle stream, datagram,
  and virtuell other sockets( e.g. for the ntvfs_ipc module to connect to the dcerpc server
  , or for smb or dcerpc or whatever to connect to a server wide auth service)
- and other fixes...

NOTE: process model pthread seems to be broken( but also before this patch!)

metze
2007-10-10 12:57:35 -05:00
Stefan Metzmacher
80851e6778 r1335: NT_STATUS_INTERNAL_DB_CORRUPTION
should cause DEBUG(0,(...));

metze
2007-10-10 12:56:50 -05:00
Tim Potter
0edf17ac38 r1313: Split up OpenPrinterEx into functions to handle opening printers and print
servers.
2007-10-10 12:56:50 -05:00
Andrew Bartlett
07fd885fd4 r1294: A nice, large, commit...
This implements gensec for Samba's server side, and brings gensec up
to the standards of a full subsystem.

This means that use of the subsystem is by gensec_* functions, not
function pointers in structures (this is internal).  This causes
changes in all the existing gensec users.

Our RPC server no longer contains it's own generalised security
scheme, and now calls gensec directly.

Gensec has also taken over the role of auth/auth_ntlmssp.c

An important part of gensec, is the output of the 'session_info'
struct.  This is now reference counted, so that we can correctly free
it when a pipe is closed, no matter if it was inherited, or created by
per-pipe authentication.

The schannel code is reworked, to be in the same file for client and
server.

ntlm_auth is reworked to use gensec.

The major problem with this code is the way it relies on subsystem
auto-initialisation.  The primary reason for this commit now.is to
allow these problems to be looked at, and fixed.

There are problems with the new code:
- I've tested it with smbtorture, but currently don't have VMware and
  valgrind working (this I'll fix soon).
- The SPNEGO code is client-only at this point.
- We still do not do kerberos.

Andrew Bartlett
2007-10-10 12:56:49 -05:00
Tim Potter
cf4e9080d5 r1276: Return data for enumprinters level 2 and 5. 2007-10-10 12:56:48 -05:00
Tim Potter
60e48790dc r1271: Return spoolss enumprinters info level1 from spoolss.ldb - woot! 2007-10-10 12:56:47 -05:00
Tim Potter
1162e2fcff r1270: Start to break samdb into general bits so we can share code with other
similar dbs.
2007-10-10 12:56:47 -05:00
Tim Potter
de5984c956 r1268: varient -> variant 2007-10-10 12:56:46 -05:00
Tim Potter
6b24ee3864 r1266: Start to split out EnumPrinters into a separate fn for each info level. 2007-10-10 12:56:46 -05:00
Stefan Metzmacher
d3b80fd40a r1235: as the pidl code init all output data.
we should do it manualy too.

metze
2007-10-10 12:56:46 -05:00
Stefan Metzmacher
b8b4d0d5bf r1234: valgrind found this uninitialised var...
But I don't know how to fix this correct,
so maybe this needs to be fixed

(tridge: can you please look at this)

metze
2007-10-10 12:56:46 -05:00
Tim Potter
5d0013438e r1226: Return dummy information for two printers. Note that ndr_push_array()
can be used here - neat!
2007-10-10 12:56:45 -05:00
Tim Potter
e216c6a707 r1211: Some output from rpcclient -c enumprinters to remind me what a relative
string looks like.  I'm not sure relstrs can be shoehorned into the ndr
code as easily as adding a LIBNDR_STR flag.
2007-10-10 12:56:45 -05:00
Tim Potter
487211f1ae r1210: A skeleton spoolssdb, based on samdb. 2007-10-10 12:56:45 -05:00
Tim Potter
1c749a3a34 r1208: Return some dummy printer information for the EnumPrinters RPC.
rpcclient enumprinters prints this information OK.

Some minor cut&paste cleanups.
2007-10-10 12:56:45 -05:00
Tim Potter
e21f324937 r1205: Whoops - this should fix the build. 2007-10-10 12:56:45 -05:00
Tim Potter
a5e3a26fc9 r1204: decrpc -> dcerpc 2007-10-10 12:56:45 -05:00
Tim Potter
3e79a6219e r1201: Skeleton versions of OpenPrinterEx() and ClosePrinter() to get the hang
of things.
2007-10-10 12:56:44 -05:00
Tim Potter
261531ce0a r1188: Use generated pidl template for this file and return DCESRV_FAULT instead
of a bogus WERROR.
2007-10-10 12:56:44 -05:00
Tim Potter
ed9c4d7d70 r1185: Hey look an endpoint for the spoolss pipe!
Doesn't do much at the moment except compile.
2007-10-10 12:56:43 -05:00
Andrew Tridgell
9b397356ae r1168: fixed a little-endian/big-endian mixup in the rpc server code 2007-10-10 12:56:43 -05:00
Andrew Tridgell
0e557fe857 r1165: fixed handling of SMBtrans replies that should return STATUS_BUFFER_OVERFLOW when more data is present. 2007-10-10 12:56:42 -05:00
Andrew Tridgell
db9ea488b0 r1150: - fixed interactive sam logon in the rpc server
- added a torture test for interactive login in smbtorture

These changes allow winxp to perform an interactive login (a login on
the winxp console) against a Samba4 DC. Our netlogon server code is
still filling in many of the fields incorrectly, but it fills in
enough that winxp can login.
2007-10-10 12:56:41 -05:00
Andrew Tridgell
cb3d3b5e51 r1145: added server support for logon level 5 in sam logon 2007-10-10 12:56:40 -05:00
Andrew Tridgell
705205083a r1141: - consolidated the netr_SamInfo structures using a netr_SamBaseInfo
structure (andrew, this is the type of structure consolidation I think
  you were asking about. It's possible here in NDR as it isn't in the
  top level fn code)

- added validation level 6 in sam logon

With these changes I can successfully authentication smbclient to a
winxp server, with the winxp server using a Samba4 ADS DC for account
auth
2007-10-10 12:56:40 -05:00
Andrew Tridgell
4eac7340d8 r1139: added IDL and server code for netr_LogonSamLogonWithFlags() 2007-10-10 12:56:40 -05:00
Andrew Tridgell
a35459387d r1136: - added IDL for netr_LogonGetDomainInfo()
- added workstation to auth_session_info in rpc servers

- added session key fetch hook in crypto backends in dcesrv

- store and fetch seed as well as a session key in schannel ldb

- when a client uses schannel to setup a netlogon pipe connection we
  also need to setup the credentials from the schannel negotiation so
  credentials chaining works

- added server side netr_LogonGetDomainInfo() call
2007-10-10 12:56:39 -05:00
Andrew Bartlett
de97d9df22 r1080: Make sure to initialise all the returned elements in the SamLogon
reply also initialise the LM session key, when we have it (was failing
because the auth code was setting it's length wrong).

Andrew Bartlett
2007-10-10 12:56:37 -05:00
Stefan Metzmacher
ad3dd1789e r1078: the dxesrv_crypto_* implementations should now explicit set
the dce_conn->auth_state.session_info
( the ntlmssp one works fine, but the schannel one isn't implemented yet)

this is also set by the ntvfs_ipc backend on the endpoint connect.

metze
2007-10-10 12:56:37 -05:00
Stefan Metzmacher
6f8b51e290 r1066: fix compiler warning
metze
2007-10-10 12:56:36 -05:00
Andrew Bartlett
6c92563b79 r1061: The start of the SamLogon call for the NETLOGON pipe.
Changes:

- Check for a valid 'pipe_state' in netr_ServerAuthenticate3 before
  we dereference it

- removes the expansionroom[7] in the netr_SamInfo* structs to 7
individual elements.
- renames netr_SamInfo -> netr_SamInfo2
          netr_SamInfo2 -> netr_SamInfo3
  - Having the thing we always called an 'info3' being 'netr_SamInfo2'
    was just too confusing.

- Expand and fill in extra details about users from the SAM, into
  the server_info, for processing into the SamLogon reply.

- Add a dum_sid_dup() function to duplicate a struct dom_sid

The SamLogon code currently does not return supplementary groups, and is
only tested with Samba4 smbtorture.

Andrew Bartlett
2007-10-10 12:56:35 -05:00
Andrew Tridgell
5a90187c2c r1060: check for an invalid session key in samr_set_password() 2007-10-10 12:56:35 -05:00
Stefan Metzmacher
d62c0661f9 r1059: add dcesrv_crypto_schannel_session_info() dummy function.
every backend must implement all functions!

metze
2007-10-10 12:56:35 -05:00
Andrew Bartlett
3ccd96bd94 r1058: The start of work on the SamLogon call for NETLOGON.
This starts to store information about the user in the server_info
struct - like the account name, the full name etc.

Also, continue to make the names of the structure elements in the
logon reply more consistant with those in the SAMR pipe.

Andrew Bartlett
2007-10-10 12:56:35 -05:00
Andrew Tridgell
0cde043592 r1057: added rpc packet logging for packets that generate rpc faults. This
makes it much easier to develop the IDL for new requests, especially
for sealed pipes, where ethereal cannot easily extract the data.
2007-10-10 12:56:35 -05:00
Andrew Tridgell
536aa86aa9 r1056: fixed a comment on handling of the initial challenge in the ntlmssp rpc server backend 2007-10-10 12:56:35 -05:00
Andrew Tridgell
55e0b014fe r1048: - moved the schannel definitions into a separate schannel.idl
- added server side support for schannel type 23. This allows WinXP to establish a schannel connection
  to Samba4 as an ADS DC

- added client side support for schannel type 23, but disabled it as currently the client
  code has now way of getting the fully qualified domain name (which is needed)

- report dcerpc faults in the server code in the log
2007-10-10 12:56:34 -05:00
Andrew Tridgell
4daab1eaec r1046: initialise a structure element caught by valgrind 2007-10-10 12:56:34 -05:00
Andrew Tridgell
2ac79dfba0 r1030: added server side schannel support 2007-10-10 12:56:30 -05:00
Andrew Tridgell
ee6c17f373 r1029: cope wiith samdb_result_passwords() returning a null machine password 2007-10-10 12:56:30 -05:00
Andrew Bartlett
0d2ae66d3a r1028: More consistancy fixes, which should also fix the build.
Andrew Bartlett
2007-10-10 12:56:30 -05:00
Tim Potter
b7fe73613a r1026: Spelling. 2007-10-10 12:56:30 -05:00
Andrew Bartlett
4e35418c27 r1025: Rename (across the samr and netlogon pipes, so far)
pwd -> password
passwd -> password

username -> account_name

Also work on consistant structure feild names between these two pipes,
and fix up some callers to use samr_Password for the netlogon
credential code.

Andrew Bartlett
2007-10-10 12:56:30 -05:00
Stefan Metzmacher
d1ab26b907 r1022: add the session_info() call to the dcerpc server auth backends
metze
2007-10-10 12:56:28 -05:00
Andrew Tridgell
2b9b752875 r1016: - store the schannel session key after it is established
- move to a centralised way of handling talloc/ldb interaction
2007-10-10 12:56:27 -05:00
Andrew Tridgell
768cc0193a r1015: commit the schannel session key handling code now, so abartlet and
metze can have a look. Not tested yet, as I'm still writing the server
side schannel code.
2007-10-10 12:56:27 -05:00
Stefan Metzmacher
e21f8a3430 r1013: WE NEED ALWAYS TO INIT THE OUTPUT VARS!
in rpc server code!

add missing ZERO_STRUCT(r->out.info);
in samr_GetDomPwInfo

metze
2007-10-10 12:56:26 -05:00
Stefan Metzmacher
90f4777dfc r1010: make the dcesrv_crypto code a bit more generic...
fix type 'cyrpto' -> 'crypto'

metze
2007-10-10 12:56:26 -05:00
Andrew Bartlett
49d545a820 r1009: Make all users of NT and LM passwords use the samr_Password structure.
This includes the netlogon pipe, for the machine account password
change system.

Andrew Bartlett
2007-10-10 12:56:26 -05:00
Stefan Metzmacher
d09abeb686 r1004: continue tridge's work on dcerpc server auth/crypto code
I made it much more generic, and we should be able to add a
module interface to this code, so that other DCERPC_AUTH types can be added
via modules...

metze
2007-10-10 12:56:25 -05:00
Stefan Metzmacher
ac5f6f7e51 r1001: in samba4 we don't(shouldn't) use typedef's anymore...
metze
2007-10-10 12:56:25 -05:00
Andrew Tridgell
729b2f41c9 r995: - renamed many of our crypto routines to use the industry standard
names rather than our crazy naming scheme. So DES is now called
  des_crypt() rather than smbhash()

- added the code from the solution of the ADS crypto challenge that
  allows Samba to correctly handle a 128 bit session key in all of the
  netr_ServerAuthenticateX() varients. A huge thanks to Luke Howard
  from PADL for solving this one!

- restructured the server side rpc authentication to allow for other
  than NTLMSSP sign and seal. This commit just adds the structure, the
  next commit will add schannel server side support.

- added 128 bit session key support to our client side code, and
  testing against w2k3 with smbtorture. Works well.
2007-10-10 12:56:25 -05:00
Andrew Tridgell
7ad56fc4db r951: from w2k3 behaviour, the netlogon server is supposed to give back the negotiate flags it can support. 2007-10-10 12:56:21 -05:00
Andrew Tridgell
2d740b6570 r950: - added netr_ServerAuthenticate3(). This is used by WinXP clients who try to login to Samba4, as
WinXP sees us as an ADS server.

Unfortunately WinXP also uses a set of negotiate_flags that we don't
support yet. Some crypto work needed.
2007-10-10 12:56:21 -05:00
Andrew Tridgell
ae5a5113fb r937: - added a simple QuerySecurity implementation in samr server
- moved some sec desc defines into misc.idl

 - fixed pw_len field in UserInfo26

 - made some pipes available on TCP

 - added netr_DsrEnumerateDomainTrusts() to netlogon

 - added templates for remaining netlogon IDL calls (from ethereal)

 - added a unistr_noterm vs unistr error detector in ndr basic decoder

 - added torture test for netr_DsrEnumerateDomainTrusts()
2007-10-10 12:56:20 -05:00
Andrew Tridgell
d6dca96352 r919: - added lsa_QueryInfoPolicy2() to IDL, test suite and server
- added lsa_OpenPolicy2() to server

- added guid handling in samdb

- added a couple more info policy levels in lsa server

- added some DNS info in the provisioning template and script

With the above changes WinXP professional can join a Samba4 domain
2007-10-10 12:56:20 -05:00
Andrew Tridgell
876a6eecc3 r918: - dcerpc endpoint name are case insensitive
this fix allows samba3 to join a samba4 domain using "net rpc join"
2007-10-10 12:56:19 -05:00
Andrew Tridgell
0a2c6a1062 r917: - added the start of a LSA server to samba4.
- added start of QueryDomainInfo in samr server

"net rpc info" from samba3 now works against a samba4 server. I
suspect join will work fairly soon.
2007-10-10 12:56:19 -05:00
Andrew Tridgell
41f9b144f9 r904: - fixed account expiry testing in auth_sam
- added printf style format attribute checking to samdb varargs fns

- fix nt_time_to_unix() for zero and -1 times
2007-10-10 12:56:19 -05:00
Andrew Tridgell
8feeecf303 r903: used samdb_result_passwords() in samr_ChangePasswordUser2() and fix the error handling on a bad change.
With this change WinXP can now successfully change the password on a
Samba4 server via SAMR. After the change you can't login because the
handling of much_change_time seems to be broken in the auth code, but
that should be easy to fix.
2007-10-10 12:56:19 -05:00
Andrew Tridgell
e128bcca56 r901: w2k3 completely ignores the domain name argument to GetDomPwInfo,
always returning the info for the primary domain. I noticed this
because WinXP sends the wrong information in this field (it sends
\\server_name) and gets away with it
2007-10-10 12:56:19 -05:00
Andrew Tridgell
965748cbee r897: - user/group creation needs to create unique names across both the
Builtin and local domain, as some calls (notably password change
  calls) don't specify a domain name, they just specifiy an account
  name.

- added the remaining password set levels to SetUserInfo in the samr
  server. We now support all of the password set and change levels
  that we know about in SAMR.
2007-10-10 12:56:18 -05:00
Andrew Tridgell
b5324a4b80 r896: - use andrews samdb_result_passwords() for the remaining password change mechanisms
- added samr_ChangePasswordUser2() (just a subset of samr_ChangePasswordUser3)
2007-10-10 12:56:18 -05:00
Stefan Metzmacher
2986c5f08c r890: convert samba4 to use [u]int8_t instead of [u]int8
metze
2007-10-10 12:56:16 -05:00
Stefan Metzmacher
af6f1f8a01 r889: convert samba4 to use [u]int16_t instead of [u]int16
metze
2007-10-10 12:56:16 -05:00
Stefan Metzmacher
0e5517d937 r884: convert samba4 to use [u]int32_t instead of [u]int32
metze
2007-10-10 12:56:15 -05:00
Andrew Tridgell
c75b763f41 r879: fixed a typo in the password fetch wrapper 2007-10-10 12:56:15 -05:00
Andrew Bartlett
399e2e2b11 r874: This patch is a pile of work on NTLMSSP:
Samba's NTLMSSP code is now fully talloc based, which should go a long
way to cleaning up the memory leaks in this code.  This also avoids a
lot of extra copies of data, as we now allocate the 'return' blobs on
a caller-supplied context.

I have also been doing a lot of work towards NTLM2 signing and
sealing.  I have this working for sealing, but not for the verifier
(MD5 integrity check on the stream) which is still incorrect.

(I can aim a rpcecho sinkdata from a Win2k3 box to my server, and the
data arrives intact, but the signature check fails.  It does however
match the test values I have...).

The new torture test is cludged in - when we get a unit test suite
back, I'll happliy put it in the 'right' place....

Andrew Bartlett
2007-10-10 12:56:14 -05:00
Andrew Tridgell
9a9244a1c6 r873: converted samba4 to use real 64 bit integers instead of
structures. This was suggested by metze recently.

I checked on the build farm and all the machines we have support 64
bit ints, and support the LL suffix for 64 bit constants. I suspect
some won't support strtoll() and related functions, so we will
probably need replacements for those.
2007-10-10 12:56:14 -05:00
Andrew Tridgell
2fdf33c6e5 r871: add a comment about how samdb_set_password() works 2007-10-10 12:56:14 -05:00
Andrew Tridgell
abe90bc7ba r870: we should issue a rpc fault OP_RANGE_ERROR not a WERR_NOT_SUPPORTED for
functions we don't implement yet so that we don't put uninitialised
result data on the wire (found with valgrind)
2007-10-10 12:56:14 -05:00
Andrew Tridgell
2712e26a5d r868: we should issue a rpc fault OP_RANGE_ERROR not a WERR_NOT_SUPPORTED for
functions we don't implement yet so that we don't put uninitialised
result data on the wire (found with valgrind)
2007-10-10 12:56:14 -05:00
Stefan Metzmacher
7fffc124e3 r846: convert DCESRV subsystem to a config.mk file
metze
2007-10-10 12:53:54 -05:00
Andrew Tridgell
2ba7ff824c r839: password set/change in the samr server is complex enough that it
deserves its own C module
2007-10-10 12:53:54 -05:00
Andrew Bartlett
7c69a85984 r816: - Make use of tridge's new samdb_result_sid_prefix() helper function.
- Remove legacy sid_to_string (which contained a memleak)

 - Remove some unused parts of lib/util_sid.c

Andrew Bartlett
2007-10-10 12:53:52 -05:00
Andrew Tridgell
255d6e77e7 r812: added a new samdb_replace() call that simplifies the code in the main samr server a bit. 2007-10-10 12:53:51 -05:00
Andrew Tridgell
24bbf9f1bc r796: fixed samr_OemChangePasswordUser2() to replace attributes, not add 2007-10-10 12:53:51 -05:00
Andrew Tridgell
c1a65f83f6 r793: - don't make templates members of any class that would make them show
up in searches like "objectclass=user"

 - auto-add the computer objectclass for computer accounts on create

 - added two types of password change call in samr server

 - reset last_fault_code before each dcerpc call
2007-10-10 12:53:51 -05:00
Simo Sorce
c0c1596dbd r789: we return wrong number of entries 2007-10-10 12:53:50 -05:00
Stefan Metzmacher
4bfecf337b r758: just move the util file to the additional object file list
metze
2007-10-10 12:53:49 -05:00
Andrew Bartlett
f9f581b580 r754: Implement the SetPassword operation on the netlogon pipe.
This involves allowing the password set code in samdb to take an
already hashed password, and some fixes to our torture code.

Andrew Bartlett
2007-10-10 12:53:48 -05:00
Andrew Bartlett
b886cb65f8 r745: Move netr_ServerPasswordSet up with the other secure channel
management functions, and make sure to include the fault until this is
no longer a stub.

Andrew Bartlett
2007-10-10 12:53:46 -05:00
Andrew Bartlett
94624e519b r743: Start on a NETLOGON server in Samba4.
Currently this only authentiates the machine, not real users.

As a consequence of running the Samba4 NETLOGON test against Samba4, I
found a number of issues in the SAMR server, which I have addressed.
There are more templates in the provison.ldif for this reason.

I also added some debug to our credentials code, and fixed some bugs
in the auth_sam module.

The static buffer in generate_random_string() bit me badly, so I
removed it in favor of a talloc based system.

Andrew Bartlett
2007-10-10 12:53:46 -05:00
Stefan Metzmacher
c78a2ddb28 r665: merge over the new build system from my tmp branch
to the main SAMBA_4_0 tree.

NOTE: that it's not completely ready, but it's functional:-)

metze
2007-10-10 12:53:36 -05:00
Stefan Metzmacher
c39e450702 r649: return unknown interface when the client not yet
binds succesful to an interface

metze
2007-10-10 12:51:56 -05:00
Stefan Metzmacher
81b94718e4 r626: make the code a bit more readable
metze
2007-10-10 12:51:56 -05:00
Andrew Tridgell
6c3f22a685 r625: - handle passwords longer than length 14 (thanks to abartlet for pointing out the bug)
- delete unicodePwd if not storing a plaintext password
2007-10-10 12:51:56 -05:00
Andrew Tridgell
cb070b9084 r623: setUserInfo level 24 (password set) now works in the SAMR server. This includes all
of the password complexity, password history and other password restrictions.
2007-10-10 12:51:55 -05:00
Volker Lendecke
945d747860 r615: Implement samr_OpenGroup, samr_QueryGroupInfo, samr_SetGroupInfo,
samr_DeleteDomainGroup.

I've added the hidden attribute numMembers that must be maintained by
Add/DelGroupMember for the GroupInfoAll query.

Volker
2007-10-10 12:51:52 -05:00
Andrew Tridgell
0250f5d6aa r608: - a couple of very minor fixes to the CreateGroup code
- added samr_GetUserPwInfo() samr server call
2007-10-10 12:51:51 -05:00
Volker Lendecke
59241c0c9a r605: Implement CreateDomainGroup, essentially cut&paste from CreateUser2.
Volker
2007-10-10 12:51:50 -05:00
Andrew Tridgell
ec0a51898f r601: added the server code for all the samr_SetUserInfo and samr_QueryUserInfo levels except for the password
set levels.

This means that a large part of the RPC-SAMR torture test now runs correctly against Samba4
2007-10-10 12:51:50 -05:00
Andrew Tridgell
defaf0d817 r596: log all ldb searches at level 4 in samdb 2007-10-10 12:51:49 -05:00
Andrew Tridgell
994baba7eb r595: nicer handling on max_size multiplier 2007-10-10 12:51:49 -05:00
Andrew Tridgell
e0db9659a8 r587: added server code for samr_EnumDomainUsers, and started adding
samr_SetUserInfo and samr_QueryUserInfo
2007-10-10 12:51:48 -05:00
Andrew Tridgell
10b6e0011b r578: initial server side implementation of samr_CreateUser(),
samr_CreateUser2(), samr_LookupNames(), samr_OpenUser(),
and samr_DeleteUser()

this uses a user template in the SAM db, of objectclass "userTemplate"
and dn CN=TemplateUser,CN=Templates,$BASEDN. Using a template allows
an admin to add any default user attributes that they might want to
the user template and all new users will receive those attributes.
2007-10-10 12:51:48 -05:00
Andrew Tridgell
b1cd98188d r514: added a context pointer to the samdb interface, as suggested by
metze. Also added a reference count so that a client can close the
connection handle and still used a derived domain handle.
2007-10-10 12:51:46 -05:00
Andrew Tridgell
74b89d5f96 r513: added a generic ldb debug system to allow the Samba debug functions to
be cleanly interfaced to ldb
2007-10-10 12:51:46 -05:00
Andrew Tridgell
a3edd4bca8 r510: converted the samdb code to give ldb a talloc context rather than letting ldb use malloc 2007-10-10 12:51:46 -05:00
Andrew Tridgell
bba0044a51 r466: implemented samr_OpenDomain() and samr_GetDomPwInfo() server side calls
if you take a look at samr_GetDomPwInfo() then you will get a fairly good idea
of what I am planning for the database oriented SAMR server implementation.
2007-10-10 12:51:44 -05:00
Andrew Tridgell
d96b68169a r465: we need common.h in two more rpc server pipes 2007-10-10 12:51:44 -05:00
Andrew Tridgell
a4df5c7cf8 r464: a big improvement to the API for writing server-side RPC
servers. Previously the server pipe code needed to return the RPC
level status (nearly always "OK") and separately set the function call
return using r->out.result. All the programmers writing servers
(metze, jelmer and me) were often getting this wrong, by doing things
like "return NT_STATUS_NO_MEMORY" which was really quite meaningless
as there is no code like that at the dcerpc level.

I have now modified pidl to generate the necessary boilerplate so that
just returning the status you want from the function will work. So for
a NTSTATUS function you return NT_STATUS_XXX and from a WERROR
function you return WERR_XXX. If you really want to generate a DCERPC
level fault rather than just a return value in your function then you
should use the DCESRV_FAULT() macro which will correctly generate a
fault for you.

As a side effect, this also adds automatic type checking of all of our
server side rpc functions, which was impossible with the old API. When
I changed the API I found and fixed quite a few functions with the
wrong type information, so this is definately useful.

I have also changed the server side template generation to generate a
DCERPC "operation range error" by default when you have not yet filled
in a server side function. This allows us to correctly implement
functions in any order in our rpc pipe servers and give the client the
right information about the fault.
2007-10-10 12:51:44 -05:00
Andrew Tridgell
e2002e40a5 r458: this is the (very primitive) beginnings of a SAMR server for
Samba4. I'm committing this now so I can get comments on the approach.

Note that you need to do something like this to initialise the SAM db:

 edit script/provision.pl
 script/provision.pl > provision.ldif.out
 bin/ldbadd /path/to/private/sam.ldb provision.ldif.out
2007-10-10 12:51:44 -05:00
Andrew Tridgell
f3799e7720 r445: fixed the bind_nak code 2007-10-10 12:51:42 -05:00
Andrew Tridgell
62f59d1180 r441: added an example of how to use the remote rpc interface 2007-10-10 12:51:42 -05:00
Stefan Metzmacher
3e911db7c2 r424: let this code compile on every machine hopefully
metze
2007-10-10 12:51:37 -05:00
Andrew Tridgell
6fbbfc4462 r374: allow for a policy_handle fetch using a handle type of
DCESRV_HANDLE_ANY. This is needed for operations like samr_Close()
that take any handle type.
2007-10-10 12:51:35 -05:00
Tim Potter
0be7a866dc r355: Fix a bunch of compiler warnings in the registry code. 2007-10-10 12:51:34 -05:00
Stefan Metzmacher
f8605b39ab r286: use talloc_array_p() instead of talloc()
add some more WERR_NOT_SUPPORTED stubs to pass our torture tests
(wkssvc and srvsvc)

metze
2007-10-10 12:51:19 -05:00
Stefan Metzmacher
7e42465192 r138: fix typo
metze
2007-10-10 12:51:10 -05:00
Jelmer Vernooij
3adffa0217 r128: Another registry update. Changes:
- Start with the LDB backend
- The API is now more windows-like, which should make it easier to use
  in rpc_server
- Added a GTK+ front-end
- Added some more IDL

More updates will follow, especially in the RPC field..
2007-10-10 12:51:09 -05:00
Stefan Metzmacher
975bf13f17 r127: NetWkstaGetInfo level 101
and return WERR_ACCESS_DENIED for level 102, 502 so does my winXP box
for a non-admin user

metze
2007-10-10 12:51:09 -05:00
Stefan Metzmacher
6f213a3494 r126: - add first srvsvc and wkssvc server side stuff
- we know can browse the server via the Windows Explorer

- some little fixes to the winreg server pipe

metze
2007-10-10 12:51:09 -05:00
Andrew Tridgell
af0c21c1e1 r67: added a destroy hook in the policy handle -> wire handle code to allow backends
to cleanup handle data
2007-10-10 12:50:41 -05:00
Jelmer Vernooij
1396db8537 r62: Fix the build 2007-10-10 12:50:41 -05:00
Jelmer Vernooij
ae2b63b6f1 r61: - Implement first call in the winreg rpc server
- Add some initial implementation of the ldb backend
- More checks in the winreg torture test
2007-10-10 12:50:41 -05:00
Gerald Carter
11717ae912 r42: importing .cvsignore files 2007-10-10 12:50:40 -05:00
Jelmer Vernooij
98224f5436 r31: More registry updates. regdiff/regpatch work now. 2007-10-10 12:50:40 -05:00
Jelmer Vernooij
7cab3a00d7 r20: Add the registry library. Still needs a lot of work,
see source/lib/registry/TODO for details.
2007-10-10 12:50:33 -05:00
Gerald (Jerry) Carter
6e50109b66 [GLUE] Sync tree with SVN r17. 2007-10-10 12:39:20 -05:00
Stefan Metzmacher
40abf3c584 - add 'print' to the DCERPC binding strings
e.g.
  ncacn_np:myserver:[samr,sign,print]

  will now enable the packet debugging

  and the debugging is not bound anymore to the debuglevel >= 2
  in the torture tests

- also the dcesrv_remote module now supports debugging of the packets
  use the 'dcerpc_remote:binding' smb.conf parameter.

metze
0001-01-01 00:00:00 +00:00
Stefan Metzmacher
a2beaa0823 const fixes
metze
0001-01-01 00:00:00 +00:00
Stefan Metzmacher
2e57ee884e - we now specify the object files in the subsystems config.m4 file
I plan to convert all objectfile group to use SMB_SUBSYSTEM
  later I'll add a SMB_BINARY() and SMB_LIBRARY(), then there will be no more need
  to touch Makefile.in, because all make rules will be autogenerated by configure

- convert the PROCESS_MODEL subsystem to this new scheme
  and move the pthread test to smbd/process_model.m4

- convert the CHARSET subsystem to this new scheme
  and move the iconv test to lib/iconv.m4
0001-01-01 00:00:00 +00:00
Stefan Metzmacher
5ac4f87868 some DEBUG and comment fixes
metze
0001-01-01 00:00:00 +00:00
Stefan Metzmacher
904ce91ed9 Makefile.in cleanups:
lib/util_smbd.c is not used anymore

reorder the SMB_MODULE() parameters the goal is to autogenerate the
make rules for shared modules:

dnl SMB_MODULE(1:name,2:subsystem,3:default_build,
		4:object_files,5:shared_object,6:libs
		7:whatif-static,8:whatif-shared,9:whatif-not)

and generate <SUBSYSTEM>_LIBS and MODULE_<name>_LIBS with the SMB_MODULE() macro

metze
0001-01-01 00:00:00 +00:00
Stefan Metzmacher
92a3eb83d4 - remove all STFS related stuff
(which were already removed in revision 1.37 and
   readded by mistake in revision 1.39)

- change the SMB_MODULE() macro a bit
  Now we have:

dnl Specify the default build method of this module
dnl SMB_MODULE_DEFAULT(name,default_build)
AC_DEFUN(SMB_MODULE_DEFAULT,...

dnl Mark specified module as shared
dnl SMB_MODULE(name,default_build,static_files,shared_files,subsystem,whatif-static,whatif-shared,whatif-not)

  this let us specify the default build method inside of the included config.m4
  files

metze
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e7c53ad185 dcerpc server output now copes with the client blocking part way
through a read. This happens to also avoid a memcpy on output for
dcerpc over tcp.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
9aab321fb6 avoid a copy of the data being input to the dcerpc server in the most
common case of there being no pending partial data and a full dcerpc
packet being received.

We should use this same model for the smb server. It gives us
efficient memory usage while allowing for completely async socket
operations.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
6ac547fa5f fixed the rpc epmapper server. This fixes rpc over tcp. 0001-01-01 00:00:00 +00:00
Stefan Metzmacher
917e45dafd This patch adds a better dcerpc server infastructure.
1.) We now register endpoint servers add startup via register_backend()
    and later use the smb.conf 'dcerpc endpoint servers' parameter to setup the dcesrv_context

2.) each endpoint server can register at context creation time as much interfaces as it wants
    (multiple interfaces on one endpoint are supported!)
    (NOTE:  there's a difference between 'endpoint server' and 'endpoint'!
	    for details look at rpc_server/dcesrv_server.h)

3.) one endpoint can have a security descriptor registered to it self
    this will be checked in the future when a client wants to connect
    to an smb pipe endpoint.

4.) we now have a 'remote' endpoint server, which works like the ntvfs_cifs module
    it takes this options in the [globals] section:

    dcerpc remote:interfaces = srvsvc, winreg, w32time, epmapper
    dcerpc remote:binding = ...
    dcerpc remote:user = ...
    dcerpc remote:password = ...

5.) we currently have tree endpoint servers: epmapper, rpcecho and remote

    the default for the 'dcerpc endpiont servers = epmapper, rpcecho'

    for testing you can also do
    dcerpc endpoint servers = rpcecho, remote, epmapper
    dcerpc remote:interfaces = srvsvc, samr, netlogon

6,) please notice the the epmapper now only returns NO_ENTRIES
    (but I think we'll find a solution for this too:-)

7.) also there're some other stuff left, but step by step :-)

This patch also includes updates for the
register_subsystem() , ntvfs_init(), and some other funtions
to check for duplicate subsystem registration


metze

(hmmm, my first large commit...I hope it works as supposed :-)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f740b02ac3 added a bunch of alias functions in samr.idl based on work by Kai. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
44df662960 added a smb.conf flag "rpc big endian" that tells our rpc server to
send packets in bigendian format.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
9b1c76a8e9 it turns out that a wire policy handle isn't a blob either, its a
uint32 followed by a GUID. I needed to fix this to support running in
mixed-mode rpc (where smbtorture is bigendian and w2k3 is
little-endian). Otherwise when you send back a policy handle the
server doesn't recognise it.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
bb1af644a5 a fairly large commit!
This adds support for bigendian rpc in the client. I have installed
SUN pcnetlink locally and am using it to test the samba4 rpc
code. This allows us to easily find places where we have stuffed up
the types (such as 2 uint16 versus a uint32), as testing both
big-endian and little-endian easily shows which is correct. I have now
used this to fix several bugs like that in the samba4 IDL.

In order to make this work I also had to redefine a GUID as a true
structure, not a blob. From the pcnetlink wire it is clear that it is
indeed defined as a structure (the byte order changes). This required
changing lots of Samba code to use a GUID as a structure.

I also had to fix the if_version code in dcerpc syntax IDs, as it
turns out they are a single uint32 not two uint16s.

The big-endian support is a bit ugly at the moment, and breaks the
layering in some places. More work is needed, especially on the server
side.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f21d6351d0 zero length echo is not an error 0001-01-01 00:00:00 +00:00
Andrew Tridgell
39a7c660f4 fixed the transfer syntax in the dcerpc bind reply 0001-01-01 00:00:00 +00:00
Andrew Tridgell
bd3dcfe582 added auto-generation of the server side boilerplate code for each
pipe.

The server side code gets generated as librpc/gen_ndr/ndr_NAME_s.c and
gets included in the pipe module
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f5df126c25 fixed fragmented signed connections to our rpc server over SMB 0001-01-01 00:00:00 +00:00
Andrew Tridgell
6ee0935afe ntlmssp over rpc over tcp now fully works
I needed to hack the ntlmssp code a little, as the auth code in samba4
is out of date relative to the samba3 auth code. I need to do a merge :)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
2045855601 fixed some memory leaks in the rpc server code 0001-01-01 00:00:00 +00:00
Andrew Tridgell
74041b6a0a fixed a bug handling multiple PDUs being read from a socket at one
time in the rpc server.

started on the framework for the dcerpc authentication server code
0001-01-01 00:00:00 +00:00
Andrew Tridgell
593bc29bbe completed the linkage between the endpoint mapper and the dcerpc
server endpoints. We can now successfully setup listening endpoints on
high ports, then use our endpoint mapper redirect incoming clients to
the right port.

also greatly cleanup the rpc over tcp session handling.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
4f46606af8 make the IO in the dcerpc over TCP server completely async, handling
partial packets on both input and output
0001-01-01 00:00:00 +00:00
Andrew Tridgell
9fb0f03693 dcerpc over tcp in the samba4 server now works to some extent. It
needs quite a bit more work to get it finished. The biggest missing
feature is the lack of NTLMSSP which is needed for basic
authentication over tcp
0001-01-01 00:00:00 +00:00
Andrew Tridgell
097e7ca99d rpcdump.exe now works fine against a Samba4 server
for some reason the epm_Lookup replies can't be parsed by ethereal,
although w2k parses then fine as does the Samba4 NDR code.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
fbdcf9ef54 added the epm_Map() call.
the RPC-EPMAPPER torture test now passes
0001-01-01 00:00:00 +00:00
Andrew Tridgell
3f85f9b782 added a basic dcerpc endpoint mapper to Samba4. Currently only
implements the epm_Lookup() call, I'll add the other important calls
soon. I was rather pleased to find that epm_Lookup() worked first
time, which is particularly surprising given its complexity.

This required quite a bit of new infrastructure:

  * a generic way of handling dcerpc policy handles in the rpc server

  * added type checked varients of talloc. These are much less error
    prone. I'd like to move to using these for nearly all uses of
    talloc.

  * added more dcerpc fault handling code, and translation from
    NTSTATUS to a dcerpc fault code

  * added data_blob_talloc_zero() for allocating an initially zero
    blob

  * added a endpoint enumeration hook in the dcerpc endpoint server
    operations
0001-01-01 00:00:00 +00:00
Andrew Tridgell
30a996b682 after chatting with jeremy I decided to use a separate directory for
each rpc endpoint implementation, so we will have rpc_server/samr/
rpc_server/lsa/ etc.

this should encourage each pipe to be written in a more complete
manner, as it gives easy ways to split the pipe into multiple modules.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
6e7c50bcd9 added support for sending bind_nak replies in the rpc server 0001-01-01 00:00:00 +00:00
Andrew Tridgell
8ad47eff49 added the echo pipe test calls 0001-01-01 00:00:00 +00:00
Andrew Tridgell
4dac951718 we now support pdu fragmentation on both input and output in the rpc
server code
0001-01-01 00:00:00 +00:00
Andrew Tridgell
14005c95d7 added handling of fragmented requests in the rpc server
now we just need to handle fragmented replies ....
0001-01-01 00:00:00 +00:00
Andrew Tridgell
28fa62d63d handle the auto-allocation of [ref] output arrays in pidl. This
can simplify rpc servers a lot.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
46e0a35819 * the RPC-ECHO pipe now works in smbd, as long as the data sizes
don't cause fragmented pdus (I'll add fragments shortly)

 * change data_blob_talloc() to not zero memory when the 2nd argument
   is NULL. The zeroing just masks bugs, and can't even allow a DOS
   attack

 * modified pidl to ensure that [ref] arguments to the out side of
   functions are allocated when parsing the in side. This allows rpc
   backends to assume that [ref] variables are all setup. Doesn't work
   correctly for [ref] arrays yet

 * changed DLIST_ADD_END() to take the type instead of a tmp
   variable. This means you don't need to declare a silly tmp variable in
   the caller
0001-01-01 00:00:00 +00:00
Andrew Tridgell
4929c53bc8 the next step in the dcerpc server code. Added the link between the
IPC IO routines and the dcerpc endpoint servers.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
3706af7a6c initial rpc server side infrastructure 0001-01-01 00:00:00 +00:00
Andrew Tridgell
91aed7c6a6 removed some obsolete .cvsignore files 0001-01-01 00:00:00 +00:00
Andrew Tridgell
874bf4689d removed a bunch of the old rpc code in preparation for replacing it all with auto-generated code 0001-01-01 00:00:00 +00:00
Andrew Tridgell
b0510b5428 first public release of samba4 code 0001-01-01 00:00:00 +00:00