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

732 Commits

Author SHA1 Message Date
Jeremy Allison
4c3ee228fc Ensure that only parse_prs.c access internal members of the prs_struct.
Needed to move to disk based i/o later.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a823fee5b4 Ensure that only parse_prs.c access internal members of the prs_struct.
Needed to move to disk based i/o later.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f4f1f84a6b initial server side privileges implementation, using a tdb. This needs to be hooked into pdb, and we need some access control on changing privileges. That's next 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3ddb5fb0dd added the 'lsaenumacctwithright' command to rpcclient. This allows you
to lookup what SIDs have a particular privilege (that is how
privileges are stored).
0001-01-01 00:00:00 +00:00
Andrew Bartlett
013fa87473 One more signed/unsigned fix 0001-01-01 00:00:00 +00:00
Jeremy Allison
1e752b48a1 Merge tpot's changes to request the correct sizes for user dispinfo
from HEAD. I had to do this for him as he was *so* tired, the poor
chap, plus he has this bad leg, plus the dog ate his homework etc. etc.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
2eea2813d9 Pass down max_size parameter to cli_samr_query_dispinfo() instead of
using a hardcoded value later on.

Added a helper function that returns the observed values for
max_entries and max_size for each cli_samr_query_dispinfo() call.
These values were obtained from watching the NT4 user manager
application with ethereal and are the only ones that can enumerate a
60k user domain reliably under Windows 2000.
0001-01-01 00:00:00 +00:00
Jeremy Allison
49739be1e2 Merge tridge's client priv code from HEAD.
Jeremy
0001-01-01 00:00:00 +00:00
Andrew Tridgell
bf99440398 added LsaRemoveAccountRights
this now gives us complete remove privileges control in the client
libs, so we are in good shape for starting on the server side.
0001-01-01 00:00:00 +00:00
Jeremy Allison
30a33920b4 Merging tridge's privillage client changes from HEAD.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
2e5e659e09 cleaned up the lsa_enum_acct_rights function and added a
lsa_add_acct_rights function.

This allows us to add privileges remotely to accounts using rpcclient.
0001-01-01 00:00:00 +00:00
Tim Potter
648307ab3d Merge: remove dead function. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e3d00fa47d reverted this patch till I sort out the craziness with UNIHDR 0001-01-01 00:00:00 +00:00
Andrew Tridgell
b9eff31b14 This removes the 3rd argument from init_unistr2(). There were 240
calls to init_unistr2() in the code and every one of them got the 3rd
argument incorrect, so I thought it best just to remove the argument.

The incorrect usage was caused by callers using strlen() to determine
the length of the string. The 3rd argument to init_unistr2() was
supposed to be the character length, not the byte length of the
string, so for non-english this could come out wrong.

I also removed the bogus 'always allocate at least 256 bytes'
hack. There may be some code that relies on this, but if there is then
the code is broken and needs fixing.
0001-01-01 00:00:00 +00:00
Tim Potter
a1c790b5ea Let's clean up client side ntlmssp!
Removed a dead function.
0001-01-01 00:00:00 +00:00
Gerald Carter
7a4c874842 merging some rpcclient and net functionality from HEAD 0001-01-01 00:00:00 +00:00
Andrew Tridgell
65bac11d71 added cli_lsa_enum_account_rights() call. Note that this is in
principal similar to the existing cli_lsa_enum_privsaccount() call,
except that cli_lsa_enum_account_rights() doesn't require a call to
open_account first. There is also the minor matter that
cli_lsa_enum_account_rights() works whereas
cli_lsa_enum_privsaccount() doesn't!

this call can be used to find what privileges an account or group
has. This is a first step towards proper privileges support in Samba.
0001-01-01 00:00:00 +00:00
Tim Potter
056bdfbce7 Added comment about a SMB_ASSERT() 0001-01-01 00:00:00 +00:00
Richard Sharpe
9a38e37811 Make sure that those cleanups actually went in. 0001-01-01 00:00:00 +00:00
Richard Sharpe
fd847aa936 Now that I am running config.developer, I decided to get rif of some warnings:
1. reboot in parse_reg and cli_reg was shadowing a definition on FreeBSD
   4.3 from system includes.

2. Added a bit of const to places.

3. Made sure internal functions were declared where needed.
0001-01-01 00:00:00 +00:00
Gerald Carter
f8a915b14d [merge] make sure to update print queue cache during timeout_processing() to send notify events; CR 1491 0001-01-01 00:00:00 +00:00
Gerald Carter
142c5029c7 [merge] make sure to updatre print queue cache during timeout_processing() to send notify events; CR 1491 0001-01-01 00:00:00 +00:00
Andrew Bartlett
a4f7777ca0 Merge from HEAD - idra's fix for the fact that the shutdown command takes two 1
byte boolean flags, not a 16 bit bitmask.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
3a7458f947 Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
92a777d0ea BIG patch...
This patch makes Samba compile cleanly with -Wwrite-strings.
 - That is, all string literals are marked as 'const'.  These strings are
always read only, this just marks them as such for passing to other functions.

What is most supprising is that I didn't need to change more than a few lines of code (all
in 'net', which got a small cleanup of net.h and extern variables).  The rest
is just adding a lot of 'const'.

As far as I can tell, I have not added any new warnings - apart from making all
of tdbutil.c's function const (so they warn for adding that const string to
struct).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Simo Sorce
c5892b656d the shutdown call does not have a 16 bit flags, but 2 byte representing booleans
this commit change the structure and code to reflect this

some test revelead I'm right.

some other revelead currently the abort shutdown does not work against my test machine even if it returns successfully ... need investigation
0001-01-01 00:00:00 +00:00
Simo Sorce
ea2154b269 fix rpcclient querygroup command (from 2.2 and head) 0001-01-01 00:00:00 +00:00
Simo Sorce
8877ff2482 make querygroup in rpcclient working, same fix as per 2.2 tree 0001-01-01 00:00:00 +00:00
Jeremy Allison
ddd7099595 Ensure callid is not used uninitialized.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
481a8a8aa9 fix cli_ds_getprimarydominfo(); merge from SAMBA_3_0 0001-01-01 00:00:00 +00:00
Gerald Carter
e6184bbd8f * finializnig RedHat package for alpha21 release
* fix cli_ds_getprimarydominfo() (bad memcpy() )
0001-01-01 00:00:00 +00:00
Tim Potter
e643003dd4 Merge from appliance:
>Fix memory leak in cli_ds_getprimarydominfo()
0001-01-01 00:00:00 +00:00
Tim Potter
ca689916da Merge from appliance:
>Fix memory leak in cli_ds_getprimarydominfo()
0001-01-01 00:00:00 +00:00
Tim Potter
fdce4be719 A cool idea from mbp: create a big shared library of all Samba objects
which we can use to link against Samba unit test programs.  Now we can
compile and link unit tests without having to create 4MB executables
for each program

It's called libbigballofmud.so both to discourage casual usage and
also to reflect what the dependencies within Samba have become.
0001-01-01 00:00:00 +00:00
Jeremy Allison
f755711df8 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
82b8f749a3 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.
0001-01-01 00:00:00 +00:00
Jim McDonough
f6e21ba4c7 Sync with HEAD to get enumprinterkey api. 0001-01-01 00:00:00 +00:00
Jeremy Allison
121c456d43 Merge Jim's new rpc client code to 3.0.
Jeremy.
0001-01-01 00:00:00 +00:00
Jim McDonough
1fd6d34526 What is wrong with you, Jim? Check in the final version, not an interim one... 0001-01-01 00:00:00 +00:00
Jim McDonough
d423e6424b Allow multiple fragment RPC's to be sent. 0001-01-01 00:00:00 +00:00
Jeremy Allison
10024ed06e Merge of scalable printing code fix... Needs testing.
Also tidied up some of Richard's code (I don't think he uses the compiler
flags -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual like
I do :-) :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d030df7643 Merge of scalable printing code fix... Needs testing.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
f56ce473b6 Client side functions for enumprinterkey. 0001-01-01 00:00:00 +00:00
Tim Potter
62ab0f8cbe Display pipe name in rpc bind failure debug. 0001-01-01 00:00:00 +00:00
Tim Potter
70838b33a6 Display pipe name in rpc bind failure debug. 0001-01-01 00:00:00 +00:00
Tim Potter
bd64de3716 Tidyup of some DCERPC pipe connection debugs. The new LSA_DS stuff
generates some errors we haven't seen before which are inappropriately
logged at level 0.
0001-01-01 00:00:00 +00:00
Tim Potter
40d5112048 Tidyup of some DCERPC pipe connection debugs. The new LSA_DS stuff
generates some errors we haven't seen before which are inappropriately
logged at level 0.
0001-01-01 00:00:00 +00:00
Tim Potter
41a22b3a00 Fix a silly memset typo.
Change a int* to a uint32* in the cli_spoolss_enum_ports() function.
0001-01-01 00:00:00 +00:00
Tim Potter
4663d79d3e Fix a silly memset typo.
Change a int* to a uint32* in the cli_spoolss_enum_ports() function.
0001-01-01 00:00:00 +00:00
Tim Potter
e28a719f04 Zero tallocated memory in decode_printer_info, decode_driver_info,
decode_port_info and decode_printerdriver functions.
0001-01-01 00:00:00 +00:00
Tim Potter
bf2d9dd5ba Zero tallocated memory in decode_printer_info, decode_driver_info,
decode_port_info and decode_printerdriver functions.
0001-01-01 00:00:00 +00:00
Tim Potter
1094e1ffde Merge of SMB_ASSERT. 0001-01-01 00:00:00 +00:00
Tim Potter
b5111f47b5 Do a SMB_ASSERT() in cli_nt_session_open() when the pipe index is out
of range instead of silently failing.
0001-01-01 00:00:00 +00:00
Gerald Carter
09c6f6329d merge from APP_HEAD of winbindd's domain local group fix 0001-01-01 00:00:00 +00:00
Gerald Carter
764b58e2c0 merge from APP_HEAD
* s/driverlocation/comment
* detect native mode domain and enumerate local groups

Also

* Added sendfile stats from SAMBA_2_2
0001-01-01 00:00:00 +00:00
Gerald Carter
29159c9737 * merge native_mode flag in winbindd_domain struct from app-head
* add some files missing from a previous commit
0001-01-01 00:00:00 +00:00
Gerald Carter
dd948a302a merge native_mode flag in winbindd_domain struct from app-head 0001-01-01 00:00:00 +00:00
Gerald Carter
028477e352 merge of working dsrolegetprimdominfo() client code from APP_HEAD 0001-01-01 00:00:00 +00:00
cvs2svn Import User
7950dfc795 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. 0001-01-01 00:00:00 +00:00
Gerald Carter
f70caa25e4 merge of working dsrolegetprimdominfo() client code from APP_HEAD 0001-01-01 00:00:00 +00:00
Gerald Carter
1cfd2ee433 merge of new client side support the Win2k LSARPC UUID in rpcbind
from APP_HEAD
0001-01-01 00:00:00 +00:00
Gerald Carter
38c9e42998 merge of new client side support the Win2k LSARPC UUID in rpcbind
from APP_HEAD
0001-01-01 00:00:00 +00:00
Gerald Carter
9d9f7bbf87 remove files not in HEAD 0001-01-01 00:00:00 +00:00
Gerald Carter
65e7b5273b sync'ing up for 3.0alpha20 release 0001-01-01 00:00:00 +00:00
Gerald Carter
b5227f0a64 change notify merge from APP_HEAD 0001-01-01 00:00:00 +00:00
Tim Potter
d30da51956 Return WERR_UNKNOWN_LEVEL for unknown info levels. 0001-01-01 00:00:00 +00:00
Tim Potter
1338f623c2 Return WERR_UNKNOWN_LEVEL for getprinterdriver level 6 as we don't
know how to decode a printer driver into a DRIVER_INFO_6 structure.
0001-01-01 00:00:00 +00:00
Tim Potter
0379a32d82 cli_spoolss_enumprinterdrivers:
Return WERR_UNKNOWN_LEVEL if we can't decode the returned buffer.
0001-01-01 00:00:00 +00:00
Tim Potter
f0c6303beb Conver cli_spoolss routines to use REGISTRY_VALUE and REGVAL_CTR code. Nice one jerry!
(Hey I thought I checked this in already?)
0001-01-01 00:00:00 +00:00
Tim Potter
f7641c8fd1 Change JOB_INFO_CTR to return a pointer to an array rather than array of pointers.
Implemented client function for deleteprinterdataex.
0001-01-01 00:00:00 +00:00
Tim Potter
1f629aa54e Return data from enumprinterdataex by deep copying on passed in tdb context. 0001-01-01 00:00:00 +00:00
Tim Potter
62a6078253 Implemented some more client side spoolss functions:
- getprinterdataex(), setprinterdataex(), enumprinterdataex()

Pass data type down to setprinterdata() fn instead of hardcoding REG_SZ
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
4d38caca40 added cli_net_auth_3 client code.
changed cli_nt_setup_creds() to call cli_net_auth_2 or cli_net_auth_3 based on a switch.
pass also the negociation flags all the way.
all the places calling cli_nt_setup_creds() are still using cli_net_aut2(), it's just for future use and for rpcclient.

in the future we will be able to call auth_2 or auth_3 as we want.

	J.F.
0001-01-01 00:00:00 +00:00
Tim Potter
e09007dd5d Don't try to convert enumprinters name to a unc name. 0001-01-01 00:00:00 +00:00
Tim Potter
d6b10fe969 Pass the object name down to the enum_printers rpc. By default this is the
server name and everything works as advertised.  See the MSDN doco for details.
0001-01-01 00:00:00 +00:00
Tim Potter
b8dba26978 Moved calculation of secure channel type into a new function. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e4cb106d2e added a 'net rpc samdump' command for dumping the whole sam via
samsync operations (as a BDC)
0001-01-01 00:00:00 +00:00
Shirish Kalele
b0bd42c946 The "max data count" value in SMB transacts indicates how much the other end can
send us. As it stands, we incorrectly set it to the number of bytes we are
sending. Correcting this by setting a static value of 1024 (This could even be
something larger). Improves RPC client performance.
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
3823a2ff5a Sync 3.0 branch with HEAD 0001-01-01 00:00:00 +00:00
cvs2svn Import User
6938b5b98a This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. 0001-01-01 00:00:00 +00:00
Jim McDonough
c3b05b21a0 Add lsa 0x2e (queryinfo2) client side 0001-01-01 00:00:00 +00:00
Jim McDonough
ed2370b91f Add client side support for samr connect4 (0x3e). Seems to have one
additional parm compared to samr connect, but I've only seen 0x00000002
in that field...
0001-01-01 00:00:00 +00:00
Tim Potter
fe43c2ac2d Merge of incomplete rffpcnex testing code from APPLIANCE_HEAD. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e358d7b24c This fixes a number of ADS problems, particularly with netbiosless
setups.

- split up the ads structure into logical pieces. This makes it much
  easier to keep things like the authentication realm and the server
  realm separate (they can be different).

- allow ads callers to specify that no sasl bind should be performed
(used by "net ads info" for example)

- fix an error with handing ADS_ERROR_SYSTEM() when errno is 0

- completely rewrote the code for finding the LDAP server. Now try DNS
  methods first, and try all DNS servers returned from the SRV DNS
  query, sorted by closeness to our interfaces (using the same sort code
  as we use in replies from WINS servers). This allows us to cope with
  ADS DCs that are down, and ensures we don't pick one that is on the
  other side of the country unless absolutely necessary.

- recognise dnsRecords as binary when displaying them

- cope with the realm not being configured in smb.conf (work it out
  from the LDAP server)

- look at the trustDirection when looking up trusted domains and don't
  include trusts that trust our domains but we don't trust
  theirs.

- use LDAP to query the alternate (netbios) name for a realm, and make
  sure that both and long and short forms of the name are accepted by
  winbindd. Use the short form by default for listing users/groups.

- rescan the list of trusted domains every 5 minutes in case new trust
  relationships are added while winbindd is running

- include transient trust relationships (ie. C trusts B, B trusts A,
  so C trusts A) in winbindd.

- don't do a gratuituous node status lookup when finding an ADS DC (we
  don't need it and it could fail)

- remove unused sid_to_distinguished_name function

- make sure we find the allternate name of our primary domain when
  operating with a netbiosless ADS DC (using LDAP to do the lookup)

- fixed the rpc trusted domain enumeration to support up to approx
  2000 trusted domains (the old limit was 3)

- use the IP for the remote_machine (%m) macro when the client doesn't
  supply us with a name via a netbios session request (eg. port 445)

- if the client uses SPNEGO then use the machine name from the SPNEGO
  auth packet for remote_machine (%m) macro

- add new 'net ads workgroup' command to find the netbios workgroup
  name for a realm
0001-01-01 00:00:00 +00:00
Tim Potter
cb946b5dad Moved rpc client routines from libsmb back to rpc_client where they belong. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 0001-01-01 00:00:00 +00:00
Jeremy Allison
3603cd4947 Proper merge of all the working printing stuff from APPLIANCE_HEAD.
Now let's keep this in sync !
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
897e64d2e0 more debug classess activated 0001-01-01 00:00:00 +00:00
Jim McDonough
18854bcd2d Add user name to netsessenum RPC to stop 1783 messages 0001-01-01 00:00:00 +00:00
Jeremy Allison
3c05f7c06f More cleanup work preparing for SMB signing.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
ca61f68d5c Cleaned up srvsvc constants a bit. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
00ef4aad88 Remove unused files.
The size of samba going down for once :-)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
32dc5dbbfb WERROR merge from SAMBA_2_2 0001-01-01 00:00:00 +00:00
Tim Potter
1f007d3ed4 Renamed get_nt_error_msg() to nt_errstr(). 0001-01-01 00:00:00 +00:00
Gerald Carter
5760315c1d syncing up printing code with SAMBA_2_2 (already done some merges
in the reverse).

  * add in new printer change notify code from SAMBA_2_2

  * add in se_map_standard() from 2.2 in _spoolss_open_printer_ex()

  * sync up the _print_queue_struct in smb.h (why did someone change the
    user/file names in fs_user/fs_file (or vice-versa) ? )

  * sync up some cli_spoolss_XXX functions
0001-01-01 00:00:00 +00:00
Gerald Carter
50fa21c995 merge from 2.2 0001-01-01 00:00:00 +00:00
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
0001-01-01 00:00:00 +00:00
Martin Pool
92a3ab274e Add prs_dump_before to dump everything from the start of the prs
buffer up to the current position, and use this to dump pipe buffers
just before parsing.
0001-01-01 00:00:00 +00:00
Martin Pool
93fadcd111 Also capture received data 0001-01-01 00:00:00 +00:00
Martin Pool
9973b22b34 struct cli_state remembers the pipe name that it's talking to, if any,
so that we can print it in later debug messages.

Call prs_dump to dump out requests sent by the client at sufficiently
high debug levels.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
d870edce76 A farily large commit:
- Move rpc_client/cli_trust.c to smbd/change_trust_pw.c
  - It hasn't been used by anything else since smbpasswd lost its -j

 - Add a TALLOC_CTX to the auth subsytem.  These are only valid for the length
   of the calls to the individual modules, if you want a longer context hide it
   in your private data.

   Similarly, all returns (like the server_info) should still be malloced.

 - Move the 'ntdomain' module (security=domain in oldspeak) over to use the new
   libsmb domain logon code.  Also rework much of the code to use some better
   helper functions for the connection - getting us much better error returns
   (the new code is NTSTATUS).

   The only remaining thing to do is to figure out if tpot's 0xdead 0xbeef for
   the LUID feilds is sufficient, or if we should do random LUIDs as per the old
   code.

   Similarly, I'll move winbind over to this when I get a chance.

This leaves the SPOOLSS code and some cli_pipe code as the only stuff still in
rpc_client, at least as far as smbd is concerned.

While I've given this a basic rundown, any testing is as always appriciated.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Tridgell
435fdf276a added internal sasl/gssapi code. This means we are no longer dependent on cyrus-sasl which makes the code much less fragile. Also added code to auto-determine the server name or realm 0001-01-01 00:00:00 +00:00
Andrew Bartlett
575897e879 OK. Smbpasswd -j is DEAD.
This moves the rest of the functionality into the 'net rpc join' code.

Futhermore, this moves that entire area over to the libsmb codebase, rather
than the crufty old rpc_client stuff.

I have also fixed up the smbpasswd -a -m bug in the process.

We also have a new 'net rpc changetrustpw' that can be called from a
cron-job to regularly change the trust account password, for sites
that run winbind but not smbd.

With a little more work, we can kill rpc_client from smbd entirly!
(It is mostly the domain auth stuff - which I can rework - and the
spoolss stuff that sombody else will need to look over).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Tim Potter
4215048f7b I think the lookup_pdc_name() should be called lookup_dc_name() and the
name_status_find() call here should look up a #1c name instead of #1d.
This fixes some bugs currently with BDC authentication in winbindd and in
smbd as you can't query the #1d name with the ip address of a BDC.

Who is Uncle Tom Cobbley anyway?
0001-01-01 00:00:00 +00:00
Andrew Bartlett
8d31eae52a 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
0001-01-01 00:00:00 +00:00
Jeremy Allison
6bf2505cce I *love* removing code :-). Removed 4 files that weren't being used.
All this stuff was being pulled in due to *one* unneeded call to
fetch a domain SID which smbpasswd already puts in the database...
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
5c3521c937 Removed duplicate debug. 0001-01-01 00:00:00 +00:00
Jeremy Allison
ee5e7ca547 Added NT_USER_TOKEN into server_info to fix extra groups problem.
Got "medieval on our ass" about const warnings (as many as I could :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f70fb819b2 This is a farily large patch (3300 lines) and reworks most of the AuthRewrite
code.

In particular this assists tpot in some of his work, becouse it provides the
connection between the authenticaion and the vuid generation.

Major Changes:
	- Fully malloc'ed structures.
	  - Massive rework of the code so that all structures are made and destroyed
	    using malloc and free, rather than hanging around on the stack.
	- SAM_ACCOUNT unix uids and gids are now pointers to the same, to allow them
	   to be declared 'invalid' without the chance that people might get ROOT by
	   default.

	- kill off some of the "DOMAIN\user" lookups.  These can be readded at a more
	  appropriate place (probably domain_client_validate.c) in the future. They
	  don't belong in session setups.

	- Massive introduction of DATA_BLOB structures, particularly for passwords.

	- Use NTLMSSP flags to tell the backend what its getting, rather than magic
	  lenghths.

	- Fix winbind back up again, but tpot is redoing this soon anyway.

	- Abstract much of the work in srv_netlog_nt back into auth helper functions.

This is a LARGE change, and any assistance is testing it is appriciated.

Domain logons are still broken (as far as I can tell) but other functionality
seems
intact.

Needs testing with a wide variety of MS clients.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Tim Potter
27cd7ac857 Don't accidentally return success when sending a broken NET_SAMLOGON
request.  This exposes a domain authentication bug with win2k where a rpc
fault is returned but not propagated up as an error.
0001-01-01 00:00:00 +00:00
Tim Potter
26fa0374bb Fixed typo in debug message. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
5296b20ad8 the next step in the intl changeover. This should get us compiling agian,
and also completes the switch to lang_tdb.c. SWAT should now work
with a po file in the lib/ directory

also removed useless SYSLOG defines in many files
0001-01-01 00:00:00 +00:00
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. 0001-01-01 00:00:00 +00:00
Tim Potter
e0bdcbc599 Converted cli_net_auth2() and cli_nt_setup_creds() to return NTSTATUS. 0001-01-01 00:00:00 +00:00
Simo Sorce
549fe42bd4 move to SAFE_FREE() 0001-01-01 00:00:00 +00:00
Andrew Bartlett
7f04a139b2 Fix up workstaion and kickoff time checks, moved to auth_smbpasswd.c where
they can have general effect.

Fixed up workstaion support in the rest of samba, so that we can do these
checks.

Pass through the workstation for cli_net_logon(), if supplied.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
dcd6e735f7 the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1d36250e33 converted another bunch of stuff to NTSTATUS 0001-01-01 00:00:00 +00:00
Tim Potter
031a19639c More status32 conversions. 0001-01-01 00:00:00 +00:00
Tim Potter
ea8c0a75af Fixed typo in debug message. 0001-01-01 00:00:00 +00:00
Tim Potter
7d5440a7ae Set secure channel type depending on server role. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
ea1c547ac8 This patch does a number of things, mostly smaller than they look :-)
In particuar, it moves the domain_client_validate stuff out of
auth_domain.c to somwhere where they (I hope) they can be shared
with winbind better.  (This may need some work)

The main purpose of this patch was however to improve some of the
internal documentation and to correctly place become_root()/unbecome_root()
calls within the code.

Finally this patch moves some more of auth.c into other files, auth_unix.c
in this case.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Tim Potter
b196a52483 Use new client error api. 0001-01-01 00:00:00 +00:00
Tim Potter
688da3c41d Use the new client error api. 0001-01-01 00:00:00 +00:00
Tim Potter
589aaa5fb1 Removed nt_error field from cli_state as it was not used anywhere. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
b30b6202f3 This is my 'Authentication Rewrite' version 1.01, mostly as submitted to
samba-technical a few weeks ago.

The idea here is to standardize the checking of user names and passwords,
thereby ensuring that all authtentications pass the same standards.  The
interface currently implemented in as

nt_status = check_password(user_info, server_info)

where user_info contains (mostly) the authentication data, and server_info
contains things like the user-id they got, and their resolved user name.

The current ugliness with the way the structures are created will be killed
the next revision, when they will be created and malloced by creator functions.

This patch also includes the first implementation of NTLMv2 in HEAD, but which
needs some more testing.  We also add a hack to allow plaintext passwords to be
compared with smbpasswd, not the system password database.

Finally, this patch probably reintroduces the PAM accounts bug we had in
2.2.0, I'll fix that once this hits the tree.  (I've just finished testing
it on a wide variety of platforms, so I want to get this patch in).
0001-01-01 00:00:00 +00:00
Tim Potter
2e33940360 Held a shoot-out between NT_STATUS_NO_PROBLEMO and NT_STATUS_NOPROBLEMO.
According to the incorruptible judges find and grep, the latter won.

Mmm - procrastination.  (-:
0001-01-01 00:00:00 +00:00
Andrew Bartlett
cf1d1cd9d6 This fixes security=domain, which has been broke since the big charset
changeover.  For my own sainity I have created a new function to fill out both
the header and buffer for a string in an RPC struct.  This DOES NOT take a
length argument, only the actual string to be placed.

The RPC code is currently littered with code that does init_uni_hdr() followed
immidiatly by init_unistr2(), and often the length argument is wrong.  (It was
for the code I changed, even before the charset stuff).  Another bug where we
made strings AT LEAST MAX_UNICODE_LEN long hid this bug.

This works for loopback connections to Samba, and can't be any more broke than
it was before :-).  (We had double and revese conversions, fun...).

In particular this makes us multibyte complient.

In any case, if there are no objections I will slowly convert other bits of
code to the same system.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c41fc06376 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
debb471267 The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2999eab5ab Use a logical cli_read(), removed the cli_read_one() hack.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
f179e0ff61 Use cli_read_one() for reading DCE/RPC reply fragments. We need to check
for and ignore ERRmoredata errors as the client library doesn't support
32-bit error messages.

Added some annotations for the RPC pipe code to make it a bit clearer
maybe.
0001-01-01 00:00:00 +00:00
Tim Potter
3e3b9bc538 Fixed some return code checks for cli_initialise() from False to NULL.
Spotted by Joe Doran <joed@interlude.eu.org>
0001-01-01 00:00:00 +00:00
Tim Potter
b49c4cd441 Removed irritating and unecessary debug message. 0001-01-01 00:00:00 +00:00
Tim Potter
d1e5d5d62f Broke out change trust account password routines into separate file
since they're only used in one place anyway (timeout_processing() in
process.c)
0001-01-01 00:00:00 +00:00
Tim Potter
657804f3be Added a SMB_ASSERT() so that two cli_state structures aren't opened
on different pipes.  This seriously confuses NT.  Unfortunately HEAD
branch is limited to one rpc pipe per connection as the fnum is stored
inside the cli_state structure.  It should really be broken out into
it's own structure so multiple pipes can be opened on one TCP/IP socket.

What a good idea!  But look over here! I've already done it in another
workarea but it will require a day or two to refactor some of the internal
samba rpc client stuff (i.e netlogon requests) so it will remain uncommitted
for another while.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
5d899e51a4 fixed some uninitialised variables 0001-01-01 00:00:00 +00:00
Gerald Carter
0feaac00a1 few cleanups to bring in line with 2.2 0001-01-01 00:00:00 +00:00
Gerald Carter
83d6bc4454 added getdriver and enumdrivers commands. Also fixed
enumprinters so that it works as well.  Couple of other
misc fixes while we're working on rpcclient.
0001-01-01 00:00:00 +00:00
Jeremy Allison
be9933ce35 Removed JRATEST line.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0be41d5158 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0cd37c831d Serious (and I *mean* serious) attempt to fix little/bigendian RPC issues.
We were reading the endainness in the RPC header and then never propagating
it to the internal parse_structs used to parse the data.
Also removed the "align" argument to prs_init as it was *always* set to
4, and if needed can be set differently on a case by case basis.
Now ready for AS/U testing when Herb gets it set up :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0e6a34510e Sync up handle creation with 2.2 branch. We can now join AS/U domains and
authenticate against them. Big/little endian issues fixed.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
70beabf73b Ooops - forgot to check the rpcclient and smbcacls compile with the new
code :-(.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
14d5997dc8 Move to talloc control of SPOOL_XXX structs. Move to talloc control of
security descriptors and pointers. Syncup with 2.2 tree.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
f0d11b6997 rpc_client/cli_netlogon.c: Fixed incorrect printf.
Added Solaris ACL support.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
bda1d6d4a4 This patch (donated by Marc Jacobsen of HP) should make Sun and HP very happy :-).
Probably Veritas too... :-).
It allows Samba as a domain member to authenticate against an AS/U server such
as the older HP PDC product or PD Netlink. It does this by trying a netlogon
with info level 3 and then falling back to info level 2 if the PDC returns
invalid info level.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
ba3ce3404e pipe opening now works with unicode 0001-01-01 00:00:00 +00:00
Jeremy Allison
3ded1e6bd5 configure configure.in smbd/posix_acls.c smbd/dosmode.c: Fix for zero permission W2K profiles.
libsmb/cliconnect.c rpc_client/cli_login.c smbd/reply.c: codepage fixes from Tim.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
79045bd72a Merge of i18n fixes from appliance branch. Samba can now talk to a network
with a PDC that has international netbios name and domain name.  There's
still quite a bit of i18n stuff to fix though...
0001-01-01 00:00:00 +00:00
Jeremy Allison
c25533de99 Fixed bug found by Gerald. If a Samba server joins a domain and is set
to search for a DC to authenticate to using the "*" syntax than ensure
that for the first hour after the password change is searches for the
PDC using the 1B name not the 1C name as domain replication may not
have occured.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
506b5e34c3 Added lock backouts on fail.
When chaining together long lines of bloody "if" statements, which should
logically be separated, and one of them allocates memory, remember to
*free* it *WHETHER OR NOT THE IF STATEMENTS SUCCEEDED* !!!!
Yes I do consider this a bug in the coding style of Tridge, Rusty, Tim et al. :-).
I'm just pissed 'cos this took 4 hours to track down even with an insure error report
stating me in the face and also Ben Woodward looking over the code with me :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0a40bc83e1 Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. Merged
in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open
problem.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
1db0f31ae0 Wrong length for unistr2 in init_q_lookup_names()
Removed some more static arrays and replaced with tallocated memory
blocks.
0001-01-01 00:00:00 +00:00
Tim Potter
fa604bc85e Fixed some accidentally reversed patches. 0001-01-01 00:00:00 +00:00
Jeremy Allison
9e9c71c8b3 Merged in Tim's changes : Removed static limit of MAX_LOOKUP_SIDS in rpc server and client
lsa_lookup_names() and lsa_lookup_sids().
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
4c8ce7af46 Removed a dead function. 0001-01-01 00:00:00 +00:00
Tim Potter
817819d0cc Port of lsa_lookup_sids() and lsa_lookup_names() rpc client functions from
TNG branch.

Re-instated lsa_lookup_sids and lsa_lookup_names functions in rpcclient.

This requires most samba binaries to link in another handful of object
files due to uncessary coupling between modules.  )-:
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c9e4dea1cb fixed a typo 0001-01-01 00:00:00 +00:00
Andrew Tridgell
a2d07994e0 pass the desired access into cli_nt_create() 0001-01-01 00:00:00 +00:00
Andrew Tridgell
9ec4b1fa48 no longer pass the type to make_sec_desc(), instead the type is
derived from the other arguments
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
b655bc281f added samr_set_user_info and info_2.
cleanup of create_user
cleanup of rid/sid mix in samr. now we only have sid.

some prs_align() missing in parse_samr.c

a small debug change in srv_pipe.c

You still can't change a user's password in this commit.
Will be availble in the next one.

	J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
dfe77c7046 Herb's warning fixes. Also the POSIX locking fix.
We now use our own vfs layer to do get/set acl calls (hurrah!).
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
4c63c91858 printer notify code.
It only sends notifies to one client. The broadcasting notify code will
code soon.

	J.F.
0001-01-01 00:00:00 +00:00
Gerald Carter
ae7dd77c24 spoolgetprinterdriver now returns "Windows NT x86" and "Windows 4.0"
driver information.

Will merge into TNG.



jerry
0001-01-01 00:00:00 +00:00
Tim Potter
2d23607bb0 Removed compiler warning. 0001-01-01 00:00:00 +00:00
Gerald Carter
facef51be4 changing some debug message levels
j-
0001-01-01 00:00:00 +00:00
Gerald Carter
95355d2cf2 minor formatting fixes.
jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
ce2d20395a FIxed some unmarshalling problems with relstr and unistr arrays
jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
4bc5b8aa34 code formatting cleanup
jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
880e811616 Needed to add the SHARED attribute bit when creating a printer
on a Samba host.  Also needed to add an option to pass the share
name (printer name) on the command line.

And fixed the checking of the return code for spoolss_r_addprinterex()




jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
8ecd5dd52a More work on AddPrinterDriver() and AddPrinterEx() client RPC's
Also fixed init_unistr() to deal with a NULL source character string.



-jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
3bf9a29f34 All changes related to rpcclient...
- cleaned up some code
- Fixed a few memory leaks of my own making
- Add AddPrinterDriver(); I'm missing some of the semantics
  here as the call is done correctly, but I'm not getting all
  the information right in the DRIVER_INFO_3 struct I think.
  Will work on it tomorrow some more...



--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
8e5e929561 spoolss_addprinterex() was adding the printer and returning the
correct handle, but was deleting the connection to the server.
Doh!!



--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
e15d9befd2 clunky support for calling AddPrinterEx(). The code currently reports
that the call failed, but the printer shows up on the remote NT client.
(note this is the client side call).  I've botched the return value
somewhere and will fix that today.




jerry
0001-01-01 00:00:00 +00:00
Jeremy Allison
c55bcec817 Tidyup removing many of the 0xC0000000 | NT_STATUS_XXX stuff (only need NT_STATUS_XXX).
Removed IS_BITS_xxx macros as they were just reproducing "C" syntax in a more
obscure way.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
45fbf31b69 More work on rpcclient...
* Fixed to work with Jeremy's recent changes re: dunamic
    memory allocation when unmarshalling unistr[2]
  * included EnumPorts level 1
  * more work on AddPrinterEx




--jerry
0001-01-01 00:00:00 +00:00
Jeremy Allison
0ff2ce543e 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.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
883f7402d4 Found out that we are crashing spoolss in enumprinterdata.
So fixed enumprinterdatas in rpcclient to debug the server code,
and found that the parsing code was missing 2 prs_align().

We are not crashing NT anymore. :-)

        J.F.
0001-01-01 00:00:00 +00:00
Tim Potter
7145689bf5 Fixed memory leak in modify_trust_password() 0001-01-01 00:00:00 +00:00
Gerald Carter
2c0f6bcc8f some initial code for AddPrinterEx() project. Most is ifdef'd out
'cause it's not all written.


-jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
a9522f560d * Added EnumPorts()
* Fixed an off-by-one bug noticed by JF in GetPrinterDriverDirectory()



jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
c8abc31187 Fixed unitilized secdesc pointer which was causing spoolgetprinter
rpcclient command to fail on shared printers.




jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
84349394a9 Fixed some more client SPOOLSS functions. The following
functions work now:

  - spoolenum
  - spoolopen
  - spoolgetprinter
  - spoolgetprinterdriver

Items todo:

  - track down memory bug with spoolenumdata
  - fix spoolgetprinterdriverdir
  - fix spoolgetdata
  - fix display_job_info_ctr in spooljobs

All part of the rpcclient work.

Jeremy, this check includes emthods for associating
POLICY_HNDs and client states.  See the RpcHndList_...()
function calls (implemented in lib/util_list.c)



--jerry
0001-01-01 00:00:00 +00:00
Tim Potter
dea06ad7a5 Reverted changes from rpcclient merge - contains memory leak! 0001-01-01 00:00:00 +00:00
Gerald Carter
f850935617 Lots of changes but no real progress in functionality.
more changes to remove the ncarpc_l_* stuff.

Fixed some cut and paste errors from TNG

There are very subtle bugs in this code.  I'll work on simplifying
them in round two or three.



--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
233b074f49 More functions merged from TNG for rpcclient. They don't all work
currently as I have to do something about the policy handle caching
issues.



--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
3d00e969df cleaned up access to prs_struct variables. Replaced all calls
prs_free_data() => prs_mem_free
	prs_realloc_data => prs_grow


--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
549d1d2621 removed references to loopback RPC connections.
added a few more kfunctions from TNG for rpcclient



--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
588aadb29f spoolenum commend (when compiled with the new prs_unistr())
now works.   :-)




jerry
0001-01-01 00:00:00 +00:00
Tim Potter
3ee111bff7 Fix for passing NULL pointer as an array parameter in
domain_client_validate()
0001-01-01 00:00:00 +00:00
Gerald Carter
61d2aad5dc More rpcclient merge issues:
* fixes some readline bugs from the merge
        * first attempt at commands (spoolenum almost works)
        * no changes to existing functions in HEAD; only additions
          of new functions.  I'll weed out what I can as I go.




--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
269051aa0c first pass at merging rpcclient from TNG to HEAD. You can get a
semi-connection and a rpcclient prompt, but no functionality there yet.
Will be a few more days on that.

--jerry
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f890bcf067 moved secrets fns into secrets.c 0001-01-01 00:00:00 +00:00
Jeremy Allison
f0a7540831 rpc_client/cli_lsarpc.c: Removed unused variable.
rpc_server/srv_spoolss_nt.c: Fixed more memory leaks.
smbd/nttrans.c: Fixed shadow variable problem.
Jeremy.
0001-01-01 00:00:00 +00:00
Matthew Chapman
7710b4f48d Fixed LsaQueryInformationPolicy level 3 to return primary domain info.
Domain SID is saved in secrets.tdb upon joining domain.

Added "Authenticated Users" and "SYSTEM" well-known SIDs (under
NT Authority).
0001-01-01 00:00:00 +00:00
Shirish Kalele
15e7d8f6c5 Added the NETDFS pipe to allow remote administration of the msdfs symlinks
on the samba server.
0001-01-01 00:00:00 +00:00
Jeremy Allison
87c4d46abe Cutover from 2.2.x - missed in merge.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f76c037255 the beginnings of a new scheme I've working on to allow an easier
head/tng merge.

It goes something like this:

- headers from tng get copied over one at a time

- the old headers get renamed to *_old.h

- server side code that used the old headers gets a
  #define OLD_NTDOMAIN 1
  #undef OLD_NTDOMAIN
  at the start and end of the code

- mkproto.awk recognises these special defines and does magic stuff so
  that each .c file sees the right headers

- we start moving the rpc client libraries from tng to head.

if this goes OK then, in theory, we should be able to move the client
side rpc code from tng to head without disturbing the existing head
server side code. Then when that works we can consider merging the
server side.

it remains to be seen if this scheme will work. So far I've moved
rpc_samr.h and don't seem to have broken anything.

Note this this is still a very delicate operation, as at every step of
the way I want to keep head fully functional. Please don't take part
unless you discuss it with me first.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
88ad00b82a added secrets.tdb and changed storage of trust account password to use
it
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d7cd7c88fd moved trans2.h and nterr.h into includes.h with all our other includes 0001-01-01 00:00:00 +00:00
Jeremy Allison
f02999dbf7 acconfig.h configure configure.in: Added check for UT_SYSLEN for utmp code.
include/byteorder.h: Added alignment macros.
include/nameserv.h: Added defines for msg_type field options - from rfc1002.
lib/time.c: Typo fix.
lib/util_unistr.c: Updates from UNICODE branch.
printing/nt_printing.c: bzero -> memset.
smbd/connection.c: Added check for UT_SYSLEN for utmp code.

Other fixes : Rollback of unapproved commit from Luke.
Please *ask* next time before doing large changes to HEAD.

Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
cfaea90529 added the following message to all dce/rpc client/server code, except
the spoolss code (it's cut from TNG) and the smb-dce/rpc interface
code that jeremy has been working up to TNG-functionality.

i also want this message to go into SAMBA_2_0 and SAMBA_2_0_RELEASE,
because it is intolerable that potentially good modifications be made
to code that is going to be thrown away, and people waste their time
fixing bugs and adding enhancements that have already been carried
out already, up to two years ago in the TNG branch.

/*
 * THIS CODE IS OUT-OF-DATE BY TWO YEARS, IS LEGACY DESIGN AND VERY, VERY,
 * INCOMPLETE.  PLEASE DO NOT MAKE ANY FURTHER ENHANCEMENTS TO THIS CODE
 * UNLESS THEY ARE ALSO CARRIED OUT IN THE SAMBA_TNG BRANCH.
 *
 * PLEASE DO NOT TREAT THIS CODE AS AUTHORITATIVE IN *ANY* WAY.
 *
 * REPEAT, PLEASE DO NOT MAKE ANY MODIFICATIONS TO THIS CODE WITHOUT
 * FIRST CHECKING THE EQUIVALENT MODULE IN SAMBA_TNG, UPDATING THAT
 * FIRST, *THEN* CONSIDER MAKING THE SAME MODIFICATION IN THIS BRANCH
 *
 * YOU WILL, ALMOST GUARANTEED, FIND THAT THE BUG-FIX OR ENHANCEMENT THAT
 * YOU THINK IS NECESSARY, HAS ALREADY BEEN IMPLEMENTED IN SAMBA_TNG.
 * IF IT HAS NOT, YOUR BUG-FIX OR ENHANCEMENT *MUST* GO INTO SAMBA_TNG
 * AS THE SAMBA_TNG CODE WILL REPLACE THIS MODULE WITHOUT REFERENCE TO
 * ANYTHING IN IT, WITH THE POSSIBLE RISK THAT THE BUG-FIX OR ENHANCEMENT
 * MAY BE LOST.
 *
 * PLEASE OBSERVE AND RESPECT THIS SIMPLE REQUEST.
 *
 * THANK YOU.
 *
 * lkcl@samba.org
 */
0001-01-01 00:00:00 +00:00
Tim Potter
e9da530120 system_name not server_name 0001-01-01 00:00:00 +00:00
Andrew Tridgell
b563be824b this looks like a big commit, but it isn't really :)
This fixes our netbios scope handling. We now have a 'netbios scope' option
in smb.conf and the scope option is removed from make_nmb_name()

this was prompted by a bug in our PDC finding code where it didn't append
the scope to the query of the '*' name.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e48c2d9937 converted all our existing shared memory code to use a tdb database
instead of either sysv or mmap shared memory or lock files.

this means we can now completely remove
	locking_shm.c
	locking_slow.c
	shmem.c
	shmem_sysv.c
and lots of other things also got simpler

locking.c got a bit larger, but is much better compartmentalised now
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d7b2087865 2nd phase of head branch sync with SAMBA_2_0 - this delets all the files that were in the head branch but weren't in SAMBA_2_0 0001-01-01 00:00:00 +00:00
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch 0001-01-01 00:00:00 +00:00
Luke Leighton
caa5052522 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
aa3c659a8d 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()...)
0001-01-01 00:00:00 +00:00
Gerald Carter
e1d2b174ca OK. This code works on a RedHat 6.0 system. However smbpasswd
time out of sending the session setup on Solaris 2.6.  No idea.
I'll work on it some tomorrow.  This is to fix the "Unable to
setup password vectors" thingy.

Also changed an inet_aton() to inet_addr() as the former is
not very portable :-)

Luke,  I set the redir flag to false because the connection to
the smb-agent was failing and smbpasswd bombed.  Double check me
on this one.



-jc
0001-01-01 00:00:00 +00:00
Luke Leighton
631814302d jerry spotted that get_domain_sids() was being called with the wrong
arguments: get_any_dc_name() was being called with a server name
not a domain name.  oops.
0001-01-01 00:00:00 +00:00
Luke Leighton
30c7fdd6ef ABOUT TIME!!!!!!!!
damn, this one is bad.

started, at least two days ago, to add an authentication mechanism to
the smbd<->msrpc redirector/relay, such that sufficient unix / nt
information could be transferred across the unix socket to do a
become_user() on the other side of the socket.

it is necessary that the msrpc daemon inherit the same unix and nt
credentials as the smbd process from which it was spawned, until
such time as the msrpc daemon receives an authentication request
of its own, whereupon the msrpc daemon is responsible for authenticating
the new credentials and doing yet another become_user() etc sequence.
0001-01-01 00:00:00 +00:00
Luke Leighton
5e5a1dceee first version of msrpc agent redirector code. client-side only. 0001-01-01 00:00:00 +00:00
Luke Leighton
d923bc8da2 jeremy is going to hate me for this.
created an "nmb-agent" utility that, yes: it connects to the 137 socket
and accepts unix socket connections which it redirects onto port 137.

it uses the name_trn_id field to filter requests to the correct
location.

name_query() and name_status() are the first victims to use this
feature (by specifying a file descriptor of -1).
0001-01-01 00:00:00 +00:00
Luke Leighton
e9e5a34de8 argh! smb-agent redirection client reusage is a nightmare!
moved smb-agent over to a single-process model instead of fork()
in order to reuse client connections.  except, of course, you
can't do a select() on the same socket connections!  argh!
0001-01-01 00:00:00 +00:00
Luke Leighton
d54a64ae3a starting "connection reuse" system in smb-agent. added version number
which isn't actually used right now :-)
0001-01-01 00:00:00 +00:00
Luke Leighton
294b653f2e cool! a unix socket smb redirector. code based on smbfilter and
ideas from ssh-agent.

the intent is to be able to share smb sessions using cli_net_use_add()
across multiple processes, where one process knows the target server
name, user name and domain, but not the smb password.
0001-01-01 00:00:00 +00:00
Luke Leighton
dd3ccdd7d9 new get_any_dc_name() function allows lookups of trusted domains from
lp_trusted_domains() parameter, so trusted domain logins should work,
right, if you put user = TRUSTED_DOMAIN\NTuser in "domain name map", right?

right - as _long_ as you're not using NTLMv2, because the damn NT username
gets mapped to the damn unix name too early, and NTLMv2 challenge-responses
are based on the client's user name, client's domain name, client's host name
etc damn etc.

so it becomes necessary to stop using char* username because this allows
for massive amounts of confusion as to which username is being referred to.
the underlying unix username on the local unix system that is associated with
the smbd process that represents the NT username?  or the NT username itself?
0001-01-01 00:00:00 +00:00
Luke Leighton
3a2b920ea2 cleaning up: removing those horrible references to server list
functions (cli_net_use_addlist()).  needed originally because
there was no get_dc_any_name() function.
0001-01-01 00:00:00 +00:00
Luke Leighton
f0946d1cca default SID map now reads in "trusted domains" from smb.conf. 0001-01-01 00:00:00 +00:00
Luke Leighton
50dc709fa9 improved enumdomains added -i option. 0001-01-01 00:00:00 +00:00
Luke Leighton
338d08f69b clearing up connection-related stuff. password credentials were messing
up.

added a complicated prompt which i don't like, but it tells you
domain\user@hostname$
0001-01-01 00:00:00 +00:00
Luke Leighton
fcc39b3f4f more cli_session_setup() calls. what the heck are these doing???
they should all be replaced with cli_establish_connection().

created cli_use_wait_keyboard() which waits on multiple cli_states
and swallows session keepalives.
0001-01-01 00:00:00 +00:00
Luke Leighton
c98c666906 damn, that took a while. nt login password was being stored incorrectly
in private .mac file (oops).  ntlogin test now works.
0001-01-01 00:00:00 +00:00
Luke Leighton
cef258f1c9 fixing joining to domain plus something weird going down with nt logins... 0001-01-01 00:00:00 +00:00
Luke Leighton
7846818432 improving createuser account command to be able to add workstations
and then set a default random password.
0001-01-01 00:00:00 +00:00
Luke Leighton
301a6efaf6 1) when no domain used in ntlogin test command, should use default one
from previous lsaquery command.  over-ridden from DOMAIN\username

2) initialisation of cli_state is a little more specific: sets use_ntlmv2
   to Auto.  this can always be over-ridden.

3) fixed reusage of ntlmssp_cli_flgs which was being a pain

4) added pwd_compare() function then fixed bug in cli_use where NULL
   domain name was making connections multiply unfruitfully

5) type-casting of mallocs and Reallocs that cause ansi-c compilers to bitch
0001-01-01 00:00:00 +00:00
Luke Leighton
e4d92ff9df sys_select added one more argument (read, write selectors). 0001-01-01 00:00:00 +00:00
Luke Leighton
3c4a6256dd added failed connections to the net use array, even though they'd been
freed / cleaned up.  oops, dat bad, cos they get freed again when u quit.
0001-01-01 00:00:00 +00:00
Luke Leighton
0fcd8ce096 ok. this is where it gets interesting. client states are now maintained
by cli_net_use_add() and cli_net_use_del().  MSRPC connections are
established with cli_connection_init(), and automatically unlinked with
cli_connection_unlink.  client states are _reused_ by cli_connection_init.
0001-01-01 00:00:00 +00:00
Luke Leighton
1abdf9a45f bug-fix 0001-01-01 00:00:00 +00:00
Luke Leighton
86f4b1d3cc this is going to sound _really_ weird, ok, but i had to implement
equivalents of NetUseAdd and NetUseDel!
0001-01-01 00:00:00 +00:00
Luke Leighton
2ae9ee1485 sam sync - one of the files that use multiple connection server list
to \PIPE\NETLOGON.
0001-01-01 00:00:00 +00:00
Luke Leighton
d1986ade30 attempting to resolve the issue that multiple servers often specified in
parameters to connect to \PIPE\NETLOGON.
0001-01-01 00:00:00 +00:00
Luke Leighton
85cc680736 ok. got ntlogin command working. argh, it maintains a connection to
the remote machine, because i don't know what to _do_ with it!!!!

argh!!!
0001-01-01 00:00:00 +00:00
Luke Leighton
44dd3efa63 first attempt at getting \PIPE\NETLOGON working. it's pretty horrible. 0001-01-01 00:00:00 +00:00
Luke Leighton
4e92090016 cool! spooljobs works! this surprised me very much :-) helped to
specify \PIPE\spoolss instead of \PIPE\lsarpc...
0001-01-01 00:00:00 +00:00
Luke Leighton
7a69633058 well, i stuffed up the spooler commands. 0001-01-01 00:00:00 +00:00
Luke Leighton
0aaf0c9c80 moved at command over to new abstract connection system. matthew, you
initialised dest_wks _after_ using it in at_soon() :-) so i fixed this :)
0001-01-01 00:00:00 +00:00
Luke Leighton
601d217f44 moved browser command brsinfo over to new abstracted connection 0001-01-01 00:00:00 +00:00
Luke Leighton
4c3556fae7 this one's a handle-based one (missed in the first round). 0001-01-01 00:00:00 +00:00
Luke Leighton
e4e5743a40 removed do_ prefix from srvsvc API 0001-01-01 00:00:00 +00:00
Luke Leighton
3204829225 updated \PIPE\wkssvc commands to use new abstracted connection system.
modified resolve_srv_name() to return dest host of *SMBSERVER if
server name is \\ip.add.ress.format
0001-01-01 00:00:00 +00:00
Luke Leighton
6b67d6164d using "abstracted" cli_connection, got \PIPE\srvsvc commands up and running
again.
0001-01-01 00:00:00 +00:00
Luke Leighton
a1ff7e8fc3 further abstraction involving client states. main client-side code
is pretty much independent of SMB client states, which will make it
easier to add other transports.
0001-01-01 00:00:00 +00:00
Luke Leighton
4e029d50fc enhanced samuser command to do same thing as enumusers command (-g -u -a)
except with only one user.  done by sharing same code.
0001-01-01 00:00:00 +00:00
Luke Leighton
29c480085e whoa. _major_ restructure of rpcclient. fixed some buuugs, created a few.
found out that getopt() _must_ have optind set to 0 before reuse.

still haven't decided what to do with the net* api yet...
0001-01-01 00:00:00 +00:00
Luke Leighton
cda2577881 this file manages client states associated with handles. 0001-01-01 00:00:00 +00:00
Luke Leighton
c1ea396de2 previous commit added an abstraction function that didn't even have
struct cli_state, uint16 fnum into the code: rpc_hnd_api_req().
modified cli_lsarpc.c to use this.  the rest is const issues.
0001-01-01 00:00:00 +00:00
Luke Leighton
8ce93b80d3 cool! completed a samr* API that _would_ look like an msdn samr* api...
if microsoft bothered to publish it.  actually, there are good reasons
for not publishing it: people might write programs for it, and then
those programs wouldn't work on nt5, for example...
0001-01-01 00:00:00 +00:00
Luke Leighton
45e92258e7 registry API moved over to new format. reg_connect() is the top-level
function, which takes \\server_name.

tested a _few_ functions.  found that regcreatekey receives a Fault PDU.
0001-01-01 00:00:00 +00:00
Luke Leighton
7cacf8bd02 service control manager API completed. svcenum -i works, but does not
do so twice.  possible memory corruption, revolving around getopt().
0001-01-01 00:00:00 +00:00
Luke Leighton
57bff6fe82 ok. *whew*. this is the first completed part of the restructure.
verified that lsaquery, lsalookupsids work, and found some bugs in the
parameters of these commands :-)

soo... we now have an lsa_* api that has the same arguments as the nt
Lsa* api!  cool!

the only significant coding difference is the introduction of a
user_credentials structure, containing user, domain, pass and ntlmssp
flags.
0001-01-01 00:00:00 +00:00
Luke Leighton
c01b18e632 first stages of removing struct cli_state* and uint16 fnum from all
msrpc client code.  the intent is to hide / abstract / associate
connection info behind policy handles.

this makes the msrpc functions look more and more like their nt equivalents.

who-hou!
0001-01-01 00:00:00 +00:00
Luke Leighton
eaac0923e0 rewrote policy handle code to be generic (it's needed for client-side too)
attempted to fix regsetsec command
0001-01-01 00:00:00 +00:00
Luke Leighton
9193f0eff5 attempted a svcset command. password is encrypted / messed up, therefore
command fails.
0001-01-01 00:00:00 +00:00
Luke Leighton
cbbfef6d2a oops!!!! wrong command!!! 0001-01-01 00:00:00 +00:00
Luke Leighton
e88e7d529b shuffling msrpc code around so that it can be used independently of rpcclient 0001-01-01 00:00:00 +00:00
Luke Leighton
ab174759cd you know what? this sort of thing makes me laugh. hmm, what functions
have we got.  and what data do we have.  hmm.. i wonder what the NTLMv2
user session key can be... hmmm... weell.... there's some hidden data
here, generated from the user password that doesn't go over-the-wire,
so that's _got_ to be involved.  and... that bit of data took a lot of
computation to produce, so it's probably _also_ involved... and md4 no, md5?
no, how about hmac_md5 yes let's try that one (the other's didn't work)
oh goodie, it worked!

i love it when this sort of thing happens.  took all of fifteen minutes to
guess it.  tried concatenating client and server challenges.  tried
concatenating _random_ bits of client and server challenges.  tried
md5 of the above.  tried hmac_md5 of the above.  eventually, it boils down
to this:

kr = MD4(NT#,username,domainname)
hmacntchal=hmac_md5(kr, nt server challenge)
sess_key = hmac_md5(kr, hmacntchal);
0001-01-01 00:00:00 +00:00
Luke Leighton
be6a6b1393 hmmm... have to add client-side support in domain_client_validate() to
_use_ user session key.
0001-01-01 00:00:00 +00:00
Luke Leighton
e885027eb7 moving create user function into msrpc_samr.c 0001-01-01 00:00:00 +00:00
Luke Leighton
3ec269b402 doing a code reshuffle. want to add code to establish trust relationships. 0001-01-01 00:00:00 +00:00
Luke Leighton
569babb393 added \PIPE\browser plus experimental brsinfo command. you wouldn't
believe the XXXX that MIGHT be involved in getting nt5rc2 to join
a samba domain...
0001-01-01 00:00:00 +00:00
Luke Leighton
c3913f8ae2 added samuserset2 rpcclient command to test ACB_XXX bit-setting on
samr opcode 0x25.  _yet_ another failed attempt to get nt5rc2 to join
a samba domain.  what _is_ it with this stuff, dammit?
0001-01-01 00:00:00 +00:00
Luke Leighton
3df7c903c5 updating reg_value_info() parsing code to take BUFFER2 instead of just
a char*.  now copes with multiple types.
0001-01-01 00:00:00 +00:00
Luke Leighton
98ddeaf442 added regqueryval command (experimental) to get reg_io_q_info() and
reg_io_r_info() working properly.  previously they weren't well
understood (well, they were the first of the registry functions i did,
back in december 97, ok??? :-)

set ntversion to 0x1 in SAMQUERY, so that we reply same as NT4 srv.
0001-01-01 00:00:00 +00:00
Luke Leighton
3146aa6b60 added rpcclient "enumdomains" command. enumerates names of domains
for which a PDC is responsible.  typical answers are:
<Name of Domain> plus <Builtin>.

against a hierarchical, down-level-compatible NT5 PDC, there's likely to
be more than these two entries!!!!!
0001-01-01 00:00:00 +00:00
Luke Leighton
e6e5caf16c debugging rpcclient spoolenum and spooljobs commands. oh, did i forget
to mention, there's a spooljobs <printer name> command, and it uses
command-line completion?  prints out NT print jobs really nicely, too.
0001-01-01 00:00:00 +00:00
Luke Leighton
e0eb390ab3 const feeding frenzy 0001-01-01 00:00:00 +00:00
Luke Leighton
0f9d661ca2 horrible code to do SMBwriteX / SMBreadX for large MSRPC reads. ARGH! 0001-01-01 00:00:00 +00:00
Luke Leighton
681cbb9ec1 missed mem_grow_data call 0001-01-01 00:00:00 +00:00
Luke Leighton
6947f8fac7 added command-completion printer enum code. 0001-01-01 00:00:00 +00:00
Luke Leighton
135eaa9773 added rpcclient spoolenum command. enumerates printers.
spoolss_r_io_enumprinters doesn't decode strings correctly
as printer_info_1/2 code has only been written to write
structures, not read them.
0001-01-01 00:00:00 +00:00
Luke Leighton
ef7fa58fd3 spoolss openprinterex / closeprinter client-code.
experimental spoolopen <printer name> command added.

jean-francois, f.y.i. i changed the #define for SPOOLSS_OPENPRINTEREX from
op code 0x44 to 0x45.
0001-01-01 00:00:00 +00:00
Luke Leighton
f52504c553 samuserset <username> -p password. YESSSSS :)
you have to use "ntlmv1" at the moment (i.e set client ntlmv2 = no).
0001-01-01 00:00:00 +00:00
Luke Leighton
b3f16e6b5a adding experimental set user password command to rpcclient, it returns
error wrong password against nt.  ????
0001-01-01 00:00:00 +00:00
Luke Leighton
3f9455c535 created msrpc_srv_enum_tprt() function by massaging cmd_srv_enum_tprt(). 0001-01-01 00:00:00 +00:00
Luke Leighton
baa789fabc dynamic mem allocation in enum dom groups and enum dom aliases 0001-01-01 00:00:00 +00:00
Luke Leighton
953fe6ba94 added lsaenumdomains command.
attempting to get blood out of a stone^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H
querysecret to work, it keeps returning access denied.
0001-01-01 00:00:00 +00:00
Luke Leighton
492fdaaf20 rewrote rpcclient enumaliases command. 0001-01-01 00:00:00 +00:00
Luke Leighton
926fe6273a added rpcclient svcstop <service name> command. gnu readline
command-completion works.
0001-01-01 00:00:00 +00:00
Luke Leighton
2903f22e7e added yet another rpcclient command: svcstart <service name> [arg0] [arg1] ...
works with command-line completion on the service name (ohh yesss, this
is becoming my favourite bit of functionality-on-the-side hee hee :)

had to fix the svc_io_q_start_service() code which was missing the
ptr_argv[] array in between the array-size and the UNISTR2-array.
i.e it's actually an array of _pointers_ to unicode strings...
0001-01-01 00:00:00 +00:00
Luke Leighton
c243231d85 added svcinfo <service name> command. 0001-01-01 00:00:00 +00:00
Luke Leighton
37f4aac06f NetServerTransportEnum parsing, client-side and rpcclient "srvtransports" added. 0001-01-01 00:00:00 +00:00
Luke Leighton
bc5d021916 general, drastic improvements to rpcclient.
added samgroup <groupname> command
added samgroupmem <groupname> command

added proper registry key completion

added sam command user-completion (e.g samuser [tab])

added sam command group-completion (e.g samgroup [tab])
0001-01-01 00:00:00 +00:00
Luke Leighton
6a759c57dc rpcclient regenum key client code rewritten to use higher order functions. 0001-01-01 00:00:00 +00:00
Luke Leighton
497d423172 more reshuffling of enum groups code. more higher order functions. 0001-01-01 00:00:00 +00:00
Luke Leighton
b0aa933ef4 added HKEY_CLASSES_ROOT MSRPC open call. reg_open_hkcr etc. supported
in rpcclient, regenum HKEY_CLASSES_ROOT or regenum HKCR to test.
0001-01-01 00:00:00 +00:00
Luke Leighton
8d181924ce restructuring sam enum dom groups code to do multiple calls to
sam_enum_dom_groups.  enum dom aliases is still left to do (dom users
already done).
0001-01-01 00:00:00 +00:00
Luke Leighton
a78607b5db restructuring samr client code. 0001-01-01 00:00:00 +00:00
Luke Leighton
1be877114e adding extra parameter back in to trust account functions (trust account name).
restoring opening S-1-5-20 in sam enum users code.
0001-01-01 00:00:00 +00:00
Luke Leighton
c8fd555179 - typecast malloc / Realloc issues.
- signed / unsigned issues.
0001-01-01 00:00:00 +00:00
Luke Leighton
6e22bf912c signed / unsigned and typecast issues 0001-01-01 00:00:00 +00:00
Luke Leighton
19490d8b4f one of those wonderful moments when running against a different MSRPC
implementation (NT5) when you discover that your code is trash.
samr_enum_dom_users(), samr_enum_dom_aliases() and samr_enum_dom_groups()
all take a HANDLE for multiple-call enumeration purposes.
0001-01-01 00:00:00 +00:00
Luke Leighton
134b20e2a7 the dynamic memory alloc blood-fest goes on... 0001-01-01 00:00:00 +00:00
Luke Leighton
4b06f30323 turning some of the rpcclient functions dynamic. this is likely to
break a few things...
0001-01-01 00:00:00 +00:00
Luke Leighton
8976eca2db various. debug levels changed. nmbd doesn't need libsmb/clienttrust.c.
samr_lookup_rids() moved to a dynamic memory structure not a
static one limited to 32 RIDs.  cli_pipe.c reading wasn't checking
ERRmoredata when DOS error codes negotiated (this terminates
MSRPC code with prejudice).
0001-01-01 00:00:00 +00:00
Luke Leighton
02f2406042 need status codes from cli_net_req_chal() and cli_net_auth2().
this format is what i would like _all_ these functions to be
(returning status codes, not BOOL) but that's a horrendous
amount of work at the moment :)
0001-01-01 00:00:00 +00:00
Luke Leighton
134cb4cdff renamed "class" local variable to avoid global clash 0001-01-01 00:00:00 +00:00
Luke Leighton
57f95a0198 adding CAP_EXTENDED_SECURITY support in a hurry last week. forgot to
deal with linking issues in other binaries
0001-01-01 00:00:00 +00:00
Luke Leighton
e5b80bd2f7 - added rudimentary CAP_UNICODE support because i thought it was part of
a problem i was having.

- added rudimentary CAP_STATUS32 support for same reason.

- added hard-coded, copy-the-same-data-from-over-the-wire version of
CAP_EXTENDED_SECURITY, which is a security-blob to encapsulate
GSSAPI which encodes
SPNEGO which is used to negotiate
Kerberos or NTLMSSP.  i have implemented
NTLMSSP which negotiates
NTLMv1 or NTLMv2 and 40-bit or 128-bit etc.  i have implemented
NTLMv1 / 40-bit.

*whew*.
0001-01-01 00:00:00 +00:00
Luke Leighton
42eb916fae error-code checking in lsa_lookup_sids. anonymous connections for
domain info.  adjusting net_srv_get_info function.
0001-01-01 00:00:00 +00:00
Luke Leighton
9a43a25511 memory problems associated with when lsalookupsids returns
NT_STATUS_NONE_MAPPED.
0001-01-01 00:00:00 +00:00
Luke Leighton
d99eca020a split matthew's sync command (only currently called from smbpasswd)
into a separate module
0001-01-01 00:00:00 +00:00
Luke Leighton
cc19d5cc5c testing for attempts to get more info levels into samr_query_userinfo 0001-01-01 00:00:00 +00:00
Luke Leighton
f9f8aa72a5 use DEBUGLEVEL not DEBUGLVL() 0001-01-01 00:00:00 +00:00
Luke Leighton
6c98d6c9aa added rpcclient SamrQueryDisplayInfo command "dispinfo" 0001-01-01 00:00:00 +00:00
Luke Leighton
8fb2ff247a - initialising mach_passwd_file locks to zero (prev. uninit.)
- cleanup

- #defined report to sprintf as it's #defined to another function in
  other uses of cmd_lsarpc.c
0001-01-01 00:00:00 +00:00
Luke Leighton
001b53866c matthew chapman identified 4 previously unknown samr functions. 0001-01-01 00:00:00 +00:00
Luke Leighton
e2a72e2c64 added call to samr_query_groupinfo in enumgroups command (-m option) 0001-01-01 00:00:00 +00:00
Luke Leighton
65a54b6e16 improved "dominfo" rpcclient command 0001-01-01 00:00:00 +00:00
Tim Potter
92ebd8f12c Don't print out a message in svcenum command for the ERRmoredata
error.
0001-01-01 00:00:00 +00:00
Luke Leighton
819af56074 event log update, netsessenum, netconnenum update. 0001-01-01 00:00:00 +00:00
Luke Leighton
bcc1212b07 event log update 0001-01-01 00:00:00 +00:00
Luke Leighton
b2d9cbef6f reverted jeremy's c++-like security descriptor modifications as the
simplest method to get rpcclient's reggetsec command working.  the
buffers passed as arguments in do_reg_get_key_sec() do need to be
locally allocated not dynamically allocated, as two calls to
reg_get_key_sec() are needed.  on the first, the server fills in the
size of the security descriptor buffer needed.  on the second, the
server fills in the security descriptor buffer.
0001-01-01 00:00:00 +00:00
Luke Leighton
1a211bafeb renaming AUTH VERIFIER to AUTH NTLMSSP VERIFIER. ready for adding
another RPC authentication system.
0001-01-01 00:00:00 +00:00
Matthew Chapman
4783ac3968 BDC support.
Added synchronise_passdb function to update accounts in a BDC's smbpasswd.
Improved rpc_read, which was still somewhat broken for multiple PDU's.
modify_trust_password must initialise cli.pwd (pwd_set_nullpwd).
0001-01-01 00:00:00 +00:00
Luke Leighton
2331aa32ab BDC support. 0001-01-01 00:00:00 +00:00
Luke Leighton
b60eb8c9fc use of safe_cli_errstr() and cli_establish_connection(). 0001-01-01 00:00:00 +00:00
Luke Leighton
ab1a6aa42d improving authentication code (tidyup). 0001-01-01 00:00:00 +00:00
Luke Leighton
ac0060443d safe string error reporting functions (found a potential buffer overflow
of a pstrcpy into an fstring).
0001-01-01 00:00:00 +00:00
Matthew Chapman
c3c25e762f Some more BDC-related fixes, mainly to the NET_SAM_SYNC RPC with respect
to alignment, missing fields, etc. - it should now work correctly.
There is still the problem of decoding the private data field.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
66b4b896fb Added a new command to rpcclient: eventlog <log> where <log> is System,
Security or Application. That's a crude equivalent to the eventviewer.

	Jean Francois
0001-01-01 00:00:00 +00:00
Matthew Chapman
f456dcf08e Adding "time" rpcclient command which displays the remote time.
Also added special "now" time to the "at" command, e.g.:
  at now /i cmd   ; pops up a command prompt
0001-01-01 00:00:00 +00:00
Matthew Chapman
cf30a472f7 Adding scheduler control pipe (\atsvc), client-side routines, and rpcclient
command "at" (compatible with NT's "at" command - see rpcclient commit) -
useful for remote NT administration.
0001-01-01 00:00:00 +00:00
Matthew Chapman
7b830350eb Mainly BDC-related changes.
* Added SEC_CHAN_BDC
* Propagate sec_chan into the various functions which change trust account
  passwords, so they can be used for domain control and inter-domain
  trusts.
* Fix for endianness problem reported by Edan Idzerda <edan@mtu.edu>. A
  BUFFER2 is really a "unibuf" in my terminology and we should treat it as
  such.
* Added some more common NT structures (BIGINT, BUFHDR2, BUFFER4).
* Added NET_SAM_SYNC (-> NetDatabaseSync2) RPC for account replication.
  Still experimental and incomplete, with a few too many NULL security
  descriptors lying around (must go look at Jeremy's SD code). Haven't
  worked out password encryption yet either.
  However, the XXX_INFO structures I've added to rpc_netlogon.h are quite
  nice as they give some insight into how these objects are stored in the
  SAM.
0001-01-01 00:00:00 +00:00
Matthew Chapman
6d03f61d25 Fixed LSA Lookup Names. There were a few too many NULL pointers in a
negative response, which tended to crash lsass.exe.
0001-01-01 00:00:00 +00:00
Luke Leighton
103557e26b dynamic memory allocation in samr enum dom users. works with 849 entries now. 0001-01-01 00:00:00 +00:00
Matthew Chapman
90b6fce780 Fixed a typo where the RPC header mem_buffer was initialised as 0x8 bytes long
rather than 0x18. Rather nasty, I doubt the client ever worked for multiple
PDU's.
0001-01-01 00:00:00 +00:00
Luke Leighton
fefb4bf191 added a "createuser" command. 0001-01-01 00:00:00 +00:00
Luke Leighton
96e358a2f0 valid_pol in lsa_query_secret() needed to be initialised to False. 0001-01-01 00:00:00 +00:00
Matthew Chapman
5951e16a11 querysecret now shows the real, fairdinkum, decrypted secret :-) 0001-01-01 00:00:00 +00:00
Matthew Chapman
365fa3b5fb Adding LSA_OPENSECRET (-> LsarOpenSecret) and LSA_QUERYSECRET
(-> LsarQuerySecret) on client side, including rpcclient command
"querysecret" for others to play with.

The major obstacle is working out the encryption algorithm used
for the secret value. It definitely uses the NT hash as part of the
key, and it seems the block size is 64 bits - probably DES based -
but I can't work out what's done in between. Help required.
0001-01-01 00:00:00 +00:00
Luke Leighton
65b0abe8b7 new "domtrust" test command. r&d into inter-domain trust accounts. 0001-01-01 00:00:00 +00:00
Matthew Chapman
7d03e6e219 Win9x user level security.
* Added SAMR_LOOKUP_DOMAIN (-> SamrLookupDomainInSamServer)

* Added real SAMR_ENUM_DOM_GROUPS (corresponding to
SamrEnumerateGroupsInDomain). The existing one is just an alias for
SamrQueryDisplayInformation (see below).

* Added three extra info levels to SAMR_QUERY_DISPINFO. Info level 3 is
what was previously SAMR_ENUM_DOM_GROUPS; info levels 4 and 5 are
simple user/group list requests used by Win9x and I suspect (haven't
checked) the "low speed connection" User Manager.

* Added another two aliases for SAMR_QUERY_DISPINFO, opcodes 0x30 and
0x33. Usually the first is with info level 3 and the second 4 but there is
some overlap so indeed these should be implemented as just aliases.

* Return ERRDOS/ERRmoredata on extra data instead of
STATUS_BUFFER_OVERFLOW for Win95's benefit. On a named pipe this results
in an SMBreadX as usual.

Still need to fix SAMR_QUERY_DOMAIN_INFO which has a hard-coded number of
users and groups - which Win95 proceeds to truncate at.
0001-01-01 00:00:00 +00:00
Luke Leighton
ec1b7000fd added jeremy's new c++-like code for parsing of security descriptors. 0001-01-01 00:00:00 +00:00
Luke Leighton
59f081069a rpcclient shutdown command 0001-01-01 00:00:00 +00:00
Matthew Chapman
ce24191939 Always null-terminate strings.
Also some string length and sizeof(pointer) corrections.
0001-01-01 00:00:00 +00:00
Matthew Chapman
a1d39af1ce UNICODE cleanup (see lib/util_unistr.c).
No more ugly static library buffers and all functions take a destination
string length (especially unistrcpy was rather dangerous; we were only
saved by the fact that datagrams are limited in size).
0001-01-01 00:00:00 +00:00
Luke Leighton
ac72fe1ab3 removal of the use of unistrn2 function: replace it with unistr2_to_str
which is more appropriate.
0001-01-01 00:00:00 +00:00
Luke Leighton
ad58cdfac6 fix for enumerate domain users (bug spotted by sean matthews).
also needed to use start index properly and generate next index.

both client and server code need to recognise error code 0x105
when there's not enough room to store all the users in one call.

sort this out another time.
0001-01-01 00:00:00 +00:00
Luke Leighton
a022710f1e rpcclient "Service Control Manager" svcenum [-i] command. 0001-01-01 00:00:00 +00:00
Luke Leighton
f4dd8f6b56 Service Control Manager - service enumeration. 0001-01-01 00:00:00 +00:00
Luke Leighton
0b2095e092 added sid_name_use array argument to lsa_lookup_names and lsa_lookup_sids. 0001-01-01 00:00:00 +00:00
Luke Leighton
dacf5b152b adding some enumerate services code, client and server. 0001-01-01 00:00:00 +00:00
Luke Leighton
e5ee965f8d adding "Service Control Manager" commands to rpcclient. 0001-01-01 00:00:00 +00:00
Luke Leighton
d06d636994 adding srvsvc pipe. 0001-01-01 00:00:00 +00:00
Luke Leighton
bee8f7fa6b removed nt_pipe_fnum from struct cli_state. need to be able to call
LsaLookupSids etc from within SamrQueryAliasMembers, for example.
fnum is now a parameter to client functions.  thanks to mike black
for starting the ball rolling.
0001-01-01 00:00:00 +00:00
Luke Leighton
b8175702ef - lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
	change module that is independent of "cnums" and "snums".
	a security context is needed for pipes, not just IPC$ or other
	services.

- group database API

	added add_group/alias_member, del_group/alias_member,
	del_group/alias_entry functions.  del_builtin_entry() is
	deliberately set to NULL to cause an exception, you cannot
	delete builtin aliases.

- parse_lsa.c srv_lsa.c

	fixed lookup_names code, it was a load of trash and didn't do
	anything.

- cmd_samr.c rpcclient.c srv_samr.c

	added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
	"addgroupmem", "addaliasmem", "createalias", "creategroup", to
	both client and server code.

	server code calls into unix stubs right now, which don't actually
	do anything.  the only instance where they are expected to do
	anything is in appliance mode NOT even in the ldap code or anything.

	client code modified to call samr_lookup_names() for group code
	(because we can) and lsa_lookup_names() for alias code (because
	we have to).

- srv_lookup.c

	oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
	instead of DOMAIN, name.
0001-01-01 00:00:00 +00:00