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

66 Commits

Author SHA1 Message Date
Gerald Carter
1e00ac19cd cleanup in init_unistr2_from_unistr()
--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
7b69cbbde3 it is not my day it seems. :-(
Fixed missing )


j-
0001-01-01 00:00:00 +00:00
Gerald Carter
34d4fb54c3 removed the for() loop to copy the buffer in init_unistr2_from_unistr()
Replaced with a memcpy()



Forgot to commit this a few moments ago


j-
0001-01-01 00:00:00 +00:00
Gerald Carter
4ecd15cd58 Fixed bug in init_unistr2_from_unistr() found by Elrond.
Thanks :-)





j-
0001-01-01 00:00:00 +00:00
Gerald Carter
c8f9e54bea After talking with Jeremy and JF (and staring at packet traces between
NT <-> NT), I've come to realize that UNISTR2 strings should be NULL
terminated.




jerry
0001-01-01 00:00:00 +00:00
Tim Potter
4ab75143c4 Fixed read overrun in init_string2() 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
Jeremy Allison
3cdcfa6325 More insure found memory leak and corruption fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
eba31e4e80 Back to building. Now to test with insure.
Added some frees needed to stop memory leaks.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c2099cfb03 Getting back to a compilable state (not there yet but close).
Added patches for random -> sys_random.
Added set_effective_xxx patches for AFS code.
Memory allocation changes in spoolss code.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
7030b7f06a init_unistr takes a const 2nd arg
(ps: I hate const)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
974813f0d4 added spool_io_printer_driver_info_level_6()
thsi function and the associated header structure were autogenerated
using a little awk based code geerator I wroe ths evening. I'll commit
that next ...
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
c212fbe009 rewrote getprinterdriver level 3, now correctly handle the dependent
files.
A number of memleak fixed
some error return values fixed.

	J.F.
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
Jean-François Micouleau
81e375bbbe spoolss definitions.
also added some prs_struct functions, 'cause I'm handling buffers as
prs_struct.

	J.F.
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
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
9193f0eff5 attempted a svcset command. password is encrypted / messed up, therefore
command fails.
0001-01-01 00:00:00 +00:00
Luke Leighton
70b2c1ecbb attempting to get nt5 wksta to join domain.
1) had to fix samr "create user" and "set user info" (level 23).

2) had to fix netlogon enum trust domains

3) registry key needed \\ in it not \.
0001-01-01 00:00:00 +00:00
Luke Leighton
e0eb390ab3 const feeding frenzy 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
e718ce9c4a had to move unistr2_dup(), unistr2_free() and unistr2_copy() into
util_unistr.c in order to get bin/testparm to compile.
0001-01-01 00:00:00 +00:00
Luke Leighton
a80ea2eb47 three types of array-creation / array-deletion functions:
char*
UNISTR2*
SID*

decided to create a higher-order function set, add_item_to_array()
free_item_array().

higher-order support routines needed to add a new type:

type* item_dup(const type*)
void item_free(type*)

of course, strdup() and free() are perfect, pre-existing examples
of such functions, used in the implementation of add_chars_to_array()
and free_char_array().

sid_dup() and free() work for the add_sids_to_array() and free_sid_array()
implementations.

use unistr2_dup() and created unistr2_free() because the functionality
behind these may change into something horrible, like [horror] dynamic
memory allocation of the UNISTR2 character array.  argh!!!!

jean-francois, this function set implements what we talked about over...
a year ago, now :-)
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
c8fd555179 - typecast malloc / Realloc issues.
- signed / unsigned issues.
0001-01-01 00:00:00 +00:00
Luke Leighton
3b583f7be5 return results on prs_xxxxx() and all xxx_io_xxx() routines.
the whole task is not complete, yet.  xxx_io_xxx() routines that
_call_ xxx_io_xxx() routines not done.

prs_xxxx() covered by macros.  considering doing xxx_io_xxxx in the same way.
0001-01-01 00:00:00 +00:00
Luke Leighton
1d05d2c959 wow!!!! this one's been here for two years!!!! alignment issues
in smb_io_dom_query() where the string name could mis-align!
added a call to prs_align() after the domain string name.
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
Jean-François Micouleau
4c515804b7 rpc_parse/parse_misc.c : defined a new BUFFER5 struct
include/ntdomain.h     : added rpc_spoolss.h include statement
include/proto.h
include/rpc_dce.h      : added definition of RPC_ALTER_CONTEXT request &
                         reply
param/loadparm.c       : 2 new options for NT printing support and some
                         changes to initial values in the LPRNG case.
rpc_parse/parse_prs.c  : added prs_uint16s()
rpc_parse/parse_rpc.c  : added SYNT_SPOOLSS_V1 and code for the
                         alter-context support.
rpc_server/srv_pipe.c  : alter-context support
smbd/nttrans.c
smbd/server.c
include/rpc_misc.h
Makefile.in
include/smb.h

Jean Francois
0001-01-01 00:00:00 +00:00
Matthew Chapman
c518cef78d Incorrect length (number of unicode characters rather than buffer size)
passed to ascii_to_unibuf in make_buffer2 was breaking User Manager.
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
Luke Leighton
2e58ed7424 SAM database "set user info".
----------------------------

- removed DOM_RID4

- removed SAMR_UNKNOWN_32

- added SAMR_SET_USERINFO (opcode 0x32)

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

- fixed pwdb_gethexpwd() it was failing on XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

- added mod_sam21pwd_entry()

- preparing to call mod_sam21pwd_entry()

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

- split code out in chgpasswd.c to decode 516 byte password buffers.
0001-01-01 00:00:00 +00:00
Luke Leighton
f84dede27e removed 2 unnecessary args from make_uni_hdr. 0001-01-01 00:00:00 +00:00
Matthew Chapman
73730f6004 Another UNICODE issue - this time BUFFER2 was being transmitted incorrectly. 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
Luke Leighton
ec1b7000fd added jeremy's new c++-like code for parsing of security descriptors. 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
73db80f341 the UNICODE issue... 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
9084b7e33d UNICODE byte ordering issue: typecast to uint16* replaced with SSVAL() 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
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
Luke Leighton
78a86c6496 added rid and sid_name_use to DOMAIN_GRP_MEMBER, for use in group member
query.

domain groups now work, hurrah!  only thing is that the description is
one character long, don't know why (which is wierd in itself).
0001-01-01 00:00:00 +00:00
Luke Leighton
9337049dfc adding group member code, made a start. found that the group members'
rid is needed not the name (see DOMAIN_GRP_MEMBER) decided to go home.
0001-01-01 00:00:00 +00:00
Luke Leighton
5d5d7e4de7 weekend work. user / group database API.
- split sam_passwd and smb_passwd into separate higher-order function tables

- renamed struct smb_passwd's "smb_user" to "unix_user".  added "nt_user"
plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd
password databases to fill in the blank entries that are not obtained
from whatever password database API instance is being used.

NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST
be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c
for the only example outside of the password database APIs i could find.

- added query_useraliases code to rpcclient.

- dealt with some nasty interdependencies involving non-smbd programs
and the password database API.  this is still not satisfactorily
resolved completelely, but it's the best i can do for now.

- #ifdef'd out some password database options so that people don't
mistakenly set them unless they recompile to _use_ those options.

lots of debugging done, it's still not finished.  the unix/NT uid/gid
and user-rid/group-rid issues are better, but not perfect.  the "BUILTIN"
domain is still missing: users cannot be added to "BUILTIN" groups yet,
as we only have an "alias" db API and a "group" db API but not "builtin-alias"
db API...
0001-01-01 00:00:00 +00:00
Luke Leighton
68342a29a8 LsaLookupNames client call (first used as lookupnames command in rpcclient). 0001-01-01 00:00:00 +00:00
Luke Leighton
e76f593b35 unix instance of group database API 0001-01-01 00:00:00 +00:00