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

78 Commits

Author SHA1 Message Date
Luke Leighton
cc8df5ce49 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 \.
(This used to be commit 70b2c1ecbb)
1999-11-16 21:14:53 +00:00
Luke Leighton
089b57b5b4 added server-side samr enum domains. fixed some parsing issues, server-side.
(This used to be commit 60b0840106)
1999-11-15 23:46:27 +00:00
Luke Leighton
7011570610 free up memory allocated by enum dom groups / aliases
(This used to be commit edb49e754b)
1999-11-02 23:32:16 +00:00
Luke Leighton
d0fd259514 more reshuffling of enum groups code. more higher order functions.
(This used to be commit 497d423172)
1999-10-29 17:37:27 +00:00
Luke Leighton
8e1f542ddf 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.
(This used to be commit 19490d8b4f)
1999-10-25 16:22:08 +00:00
Luke Leighton
45b794bdde the dynamic memory alloc blood-fest goes on...
(This used to be commit 134b20e2a7)
1999-10-21 19:02:57 +00:00
Luke Leighton
6f9105c853 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).
(This used to be commit 8976eca2db)
1999-10-21 16:53:50 +00:00
Luke Leighton
58f8159566 matthew chapman identified 4 previously unknown samr functions.
(This used to be commit 001b53866c)
1999-08-31 13:19:55 +00:00
Luke Leighton
736c507722 debugged enumgroups -g option
(This used to be commit 1cde47ba6a)
1999-08-30 17:15:59 +00:00
Jean-François Micouleau
4e5bf481fb last part of RPC api change.
and of rpcclient eventlog funtion

	Jean Francois
(This used to be commit 7fc8659e83)
1999-05-03 22:04:02 +00:00
Matthew Chapman
2bc0641b88 Added new define NT_STATUS_MORE_ENTRIES = 0x105.
(This used to be commit 52b4fd5b55)
1999-04-23 14:48:22 +00:00
Luke Leighton
6ce4aaad2b added SamrQueryDomainInfo call info level 0x3 for kix32.exe support
(This used to be commit ac070dfd39)
1999-03-29 17:24:46 +00:00
Luke Leighton
068e77c861 "User Manager" - create user + change password now work.
next problem: user group adding not supported so an "access denied"
message is reported instead of "ok" when a new user is created.
(This used to be commit f5f61bd477)
1999-03-25 21:32:04 +00:00
Luke Leighton
3b07eff9ea fixed issues with "Welcome to SAMBA Domain" for when admin user/pass is
used to add workstation to domain.  unix account db not modified: only
SAM password db is used.
(This used to be commit 129a9a4d4b)
1999-03-25 20:56:28 +00:00
Luke Leighton
fa01e8764c added SAMR_USER_INFO_24 info level to samr_set_userinfo. this is used
by "Welcome to SAMBA Domain".
(This used to be commit 4aed18b5e1)
1999-03-25 15:14:30 +00:00
Luke Leighton
43a460075a SAM database "set user info".
----------------------------

- removed DOM_RID4

- removed SAMR_UNKNOWN_32

- added SAMR_SET_USERINFO (opcode 0x32)

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

- fixed pwdb_gethexpwd() it was failing on XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

- added mod_sam21pwd_entry()

- preparing to call mod_sam21pwd_entry()

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

- split code out in chgpasswd.c to decode 516 byte password buffers.
(This used to be commit 2e58ed7424)
1999-03-25 13:54:31 +00:00
Luke Leighton
cd7c530f56 removed 2 unnecessary args from make_uni_hdr.
(This used to be commit f84dede27e)
1999-03-24 17:26:08 +00:00
Luke Leighton
6b9cb3a254 dynamic memory allocation in samr enum dom users. works with 849 entries now.
(This used to be commit 103557e26b)
1999-03-23 20:43:44 +00:00
Matthew Chapman
05f772b431 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.
(This used to be commit 7d03e6e219)
1999-02-24 01:52:30 +00:00
Matthew Chapman
2737f26ad6 Always null-terminate strings.
Also some string length and sizeof(pointer) corrections.
(This used to be commit ce24191939)
1999-02-15 05:33:30 +00:00
Matthew Chapman
fd96929ec1 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).
(This used to be commit a1d39af1ce)
1999-02-12 00:16:09 +00:00
Luke Leighton
4cb18cd734 groups and aliases being "manually" added which do not necessarily have
representation in the underlying database: removed this code.

for example, with the nt->unix mapping system (don't know about the ldap
one) if you want "Domain Admins" to appear you _must_ put it in the
domaingroup.map file.

the previous code was adding builtin aliases and well-known groups even
if they weren't in the domain maps.  bad idea.
(This used to be commit 56469578a1)
1999-02-09 21:56:06 +00:00
Luke Leighton
748f296a76 removal of the use of unistrn2 function: replace it with unistr2_to_str
which is more appropriate.
(This used to be commit ac72fe1ab3)
1999-02-09 19:51:44 +00:00
Luke Leighton
9b5043cb2f 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.
(This used to be commit ad58cdfac6)
1999-01-29 21:22:08 +00:00
Luke Leighton
92aca8b1b7 error code cleanup
(This used to be commit 61c40982d6)
1999-01-28 21:10:38 +00:00
Matthew Chapman
837601c9df Fixed typo in srv_samr.c where samr_add_groupmem and samr_del_groupmem were
the wrong way around.
(This used to be commit 2b6f481885)
1999-01-15 05:02:41 +00:00
Luke Leighton
8308c000b2 adding srvsvc pipe.
(This used to be commit d06d636994)
1998-12-08 00:25:04 +00:00
Luke Leighton
312f4f3960 - 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.
(This used to be commit b8175702ef)
1998-12-07 17:23:48 +00:00
Luke Leighton
89c56492a8 - oops, i got "add alias member" and "delete alias member" swapped.
- samr_enum_dom_users, the first 4 bytes is some sort of garbage,
  nt5-beta2 clears them out to zeros whereas nt4 does not.
  fixed bug where we were assuming that the first 4 bytes of a
  response _had_ to be non-zero.

- cli_lsarpc.c: forgot to append the rid on the lsa_lookup_names()
  client call.

- added in "addaliasmem" and "addgroupmem" commands.  the addaliasmem
  command actually turned out to be a "delaliasmem" :-) :-)

- parse_lsa.c: moved assert array check to after the size of useable
  array space is set...
(This used to be commit 165b15a8ca)
1998-12-04 21:48:06 +00:00
Luke Leighton
cf0ea874b1 - renamed do_samr_xxx to samr_xxx
- renamed do_lsa_xxx to lsa_xxx

- added "enumgroups [-m]" command, enumerates groups, shows members.
- added cmd_sam_add_groupmem(), need to call these in rpcclient.c
- added cmd_sam_add_aliasmem(), need to call these in rpcclient.c

- modified "enumaliases [-m]" command

- improved "enumgroups" and "enumaliases" to display names not just RIDS/SIDs.

- renamed "samr_unknown_12" to "samr_lookup_rids".

- added the following client-side functions:

	get_samr_query_groupmem()
	get_samr_query_aliasmem()
	get_samr_query_groupinfo()
	samr_enum_dom_groups()
	samr_enum_dom_aliases()
	samr_add_aliasmem()
	samr_add_groupmem()

- improved display output (display.c)
(This used to be commit eacc5e581a)
1998-12-04 16:30:00 +00:00
Luke Leighton
32167eda0d added createalias command to rpcclient
(This used to be commit 4771d5451b)
1998-12-03 22:20:30 +00:00
Luke Leighton
b99dc808df create domain group command (creategroup) added to rpcclient.
renamed do_samr_xxxx to samr_xxxx.
(This used to be commit 1e5d81c154)
1998-12-03 20:50:33 +00:00
Luke Leighton
78df0fb8f1 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).
(This used to be commit 78a86c6496)
1998-12-02 22:05:56 +00:00
Luke Leighton
51534a4b97 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.
(This used to be commit 9337049dfc)
1998-12-02 01:13:02 +00:00
Luke Leighton
5dd26daad5 query_aliasmem code. it works (hurrah).
(This used to be commit f7f2516df4)
1998-12-01 22:18:48 +00:00
Luke Leighton
04e382fb16 rpc_samr.h parse_samr.c srv_samr.c :
samr_query_aliasmembers (cool!)

util_pwdb.c sids.c nmbd.c server.c smbpasswd.c swat.c :

	pwdb_initialise(BOOL is_server) now creates / reads DOMAIN_NAME.SID
	if is_server is True, and does LsaQueryInfoPolicy(levels 3 and 5)
	to obtain member and pdc sids.
(This used to be commit 3e1eb4f26b)
1998-12-01 19:10:44 +00:00
Luke Leighton
67638b8d2b adding some samr parsing calls (group / alias adding / deleting)
added code that moves MACHINE.SID to DOMAIN_NAME.SID if it exists.
(This used to be commit 51c1c31768)
1998-12-01 16:04:24 +00:00
Luke Leighton
31044dd8e6 - adding builtin[alias]db.
- lib/sids.c:

	generate_sam_sid() modified to take a domain name: it now
	generates "DOMAIN_NAME.SID".  reasons:

	1) if you run multiple samba servers on the same machine
	under different netbios names as members of a domain,
	they won't all use the same SID, which is a _big_ mistake
	but it would happen _by default_.

	2) we have (had) a problem with sid_to_string() and string_to_sid()
	which cause SIDs to be incorrectly read.  one of the major
	reasons for *NOT* making this change was so as not to disrupt
	existing users.  but as they will be anyway by this bug,
	we might as well go ahead.

- passdb/smbpass.c:

	wanted to change the meaning of the name in the smbpasswd
	file to an "nt" name not a "unix" name.  this is probably
	not a good idea: reverted this.

- output formatting / bug-fixing in rpcclient query_useraliases code.
(This used to be commit e4930f5f48)
1998-11-30 15:08:58 +00:00
Luke Leighton
30038de462 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...
(This used to be commit 5d5d7e4de7)
1998-11-29 20:03:33 +00:00
Luke Leighton
5ebcdbae9b yeehaah got users to be included in S-1-5-xxx-yyy-zzz's local groups.
now need search capability on S-1-5-20, which will need argh, a
"group database API" on S-1-5-20, and the ability to add BUILTIN\Admins
etc to "local group map" argh.
(This used to be commit a24f6eb00b)
1998-11-25 23:54:30 +00:00
Jeremy Allison
bfc38ff872 Makefile.in: Added maintainer mode fixes.
aclocal.m4: Added AC_LIBTESTFUNC.
configure.in: Fixed -lsecurity -lsec problems.
client.c: dos_ fixes.
groupdb/aliasunix.c: Dead code removal.
include/includes.h: Added default PRINTCAP_NAME.
lib/genrand.c: dos_ fixes.
lib/replace.c: Added strtoul.
lib/system.c: dos_ fixes.
lib/util.c: dos_ fixes.
lib/util_sid.c: Signed/unsigned fixes.
lib/util_str.c: removed bad const.
locking/locking_slow.c: dos_ fixes.
printing/printing.c: dos_ fixes.
rpc_server/srv_samr.c: Dead code removal.
rpc_server/srv_sid.c: global_myworkgroup defined with wrong size AGAIN !
smbd/dir.c: dos_ fixes.
smbd/open.c: dos_ fixes.
smbd/oplock.c: dos_ fixes.
smbd/reply.c smbd/server.c smbd/service.c smbd/uid.c: dos_ fixes.

Jeremy.
(This used to be commit 6acb4b68f6)
1998-11-25 21:17:20 +00:00
Luke Leighton
83e41392b6 uninitialised counter
(This used to be commit 403f53d696)
1998-11-23 23:44:09 +00:00
Luke Leighton
4cee58780c unix instance of group database API
(This used to be commit e76f593b35)
1998-11-23 21:51:05 +00:00
Jeremy Allison
768761820e Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.
Tidied up some of the mess (no other word for it). Still doesn't
compile cleanly. There are calls with incorrect parameters that
don't seem to be doing the right thing.

This code still needs surgery :-(.

Jeremy.
(This used to be commit 18ff93a9ab)
1998-11-17 20:50:07 +00:00
Luke Leighton
5ae9b41235 make_uni_hdr() reverted accidentally with a -1 on username length
(This used to be commit 7da1b0bb51)
1998-11-17 18:01:43 +00:00
Luke Leighton
74d539f557 - group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.

- interactive debug detection

- re-added mem_man (andrew's memory management, detects memory corruption)

- american spellings of "initialise" replaced with english spelling of
  "initialise".

- started on "lookup_name()" and "lookup_sid()" functions.  proper ones.

- moved lots of functions around.  created some modules of commonly used
  code.  e.g the password file locking code, which is used in groupfile.c
  and aliasfile.c and smbpass.c

- moved RID_TYPE_MASK up another bit.  this is really unfortunate, but
  there is no other "fast" way to identify users from groups from aliases.
  i do not believe that this code saves us anything (the multipliers)
  and puts us at a disadvantage (reduces the useable rid space).
  the designers of NT aren't silly: if they can get away with a user-
  interface-speed LsaLookupNames / LsaLookupSids, then so can we.  i
  spoke with isaac at the cifs conference, the only time for example that
  they do a security context check is on file create.  certainly not on
  individual file reads / writes, which would drastically hit their
  performance and ours, too.

- renamed myworkgroup to global_sam_name, amongst other things, when used
  in the rpc code.  there is also a global_member_name, as we are always
  responsible for a SAM database, the scope of which is limited by the role
  of the machine (e.g if a member of a workgroup, your SAM is for _local_
  logins only, and its name is the name of your server.  you even still
  have a SID.  see LsaQueryInfoPolicy, levels 3 and 5).

- updated functionality of groupname.c to be able to cope with names
  like DOMAIN\group and SERVER\alias.  used this code to be able to
  do aliases as well as groups.  this code may actually be better
  off being used in username mapping, too.

- created a connect to serverlist function in clientgen.c and used it
  in password.c

- initialisation in server.c depends on the role of the server.  well,
  it does now.

- rpctorture.  smbtorture.  EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e609)
1998-11-17 16:19:04 +00:00
Luke Leighton
53abed10e7 grumble, grumble off-by-one unicode string fixes, gonna stuff my other
tree with cvs clashes when i cvs update on the group code grumble grumble
(This used to be commit f8b229d187)
1998-11-06 18:46:42 +00:00
Luke Leighton
528c3d3e68 amazing. the improvements to NT continue, evidence for which shows up
now as "RPC fault" if the UNIHDR structure lengths do not exactly
match up to the length of the data stream.

so, all versions of samba prior to this one have an off-by-one bug
in unicode string lengths.

all versions of NT prior to NT 5 beta 2 could possibly have buffer
problems when receiving badly formatted UNICODE strings.
(This used to be commit 161eb6f511)
1998-10-27 15:03:47 +00:00
Jeremy Allison
80f920181f server/srv_samr.c smbd/ipc.c: Changed global_myworkgroup back to fstring
(as it is everywhere else).
smbwrapper/smbsh.c: For IRIX n32 binaries, set _RLDN32_LIST not _RLD32_LIST.
                    Exec users preferred shell is SHELL environment variable is set.
tests/fcntl_lock.c: Added sys/types.h for systems that need this.
Jeremy.
(This used to be commit 50413d0d81)
1998-10-22 18:51:16 +00:00
Luke Leighton
cbd0b2ccf9 bug fix in lsa_trans_names.
well-known aliases S-1-5-20 is actually S-1-5-0x20 but sid_to_string does
decimal not hexadecimal oops.
(This used to be commit 4d830e2436)
1998-10-22 18:15:23 +00:00