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

419 Commits

Author SHA1 Message Date
Luke Leighton
6a437cfb33 UNICODE issues. 0001-01-01 00:00:00 +00:00
Luke Leighton
73db80f341 the UNICODE issue... 0001-01-01 00:00:00 +00:00
Luke Leighton
c5109ff782 use jeremy's versions of the UNICODE routines. 0001-01-01 00:00:00 +00:00
Luke Leighton
3072044134 Having Well-known Domain Groups ("Domain Admins/Guests/Users") returned
under SID_NAME_ENUM 0x5 instead of 0x2 (Well-known group instead of
Domain Group) was making it impossible to view these groups from USRMGR.EXE.
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
f7dfa55a2e cache unix groups so that two-level getgrent calls don't occur. 0001-01-01 00:00:00 +00:00
Matthew Chapman
e1e3875057 Added init_nt_time function which initialises an NTTIME to -1. 0001-01-01 00:00:00 +00:00
Gerald Carter
cabc7e739c fixed an uninitialized variable in lookupsmbgrpgid() and
lookupsmbpwuid that was causing a SEGFAULT in smbd.
0001-01-01 00:00:00 +00:00
Luke Leighton
090512e187 adding start of remote lookup for domain member role. 0001-01-01 00:00:00 +00:00
Christopher R. Hertel
782474f41e A while back, Andrew and I talked about making the debug parsing code a
better "fit" with other Samba code.  This is a small first step toward
doing what (I think) we agreed to do.

I've moved the key function from ubiqx/debugparse.c into lib/debug.c.  I
have also moved the enum from ubiqx/debugparse.h into the debug section in
smb.h.

The next thing to do is to get debug2html added into the Makefile.in so
that it is always produced when compiling the suite.

Chris -)-----
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
2cce78aa00 trying to track down issues in get_home_dir(). 0001-01-01 00:00:00 +00:00
Luke Leighton
ca10eb4490 oops, util_pwdb.c appears to be included in PASSDB_OBJ not LIB_OBJ. 0001-01-01 00:00:00 +00:00
Luke Leighton
501617307f need to initialise global_myworkgroup 0001-01-01 00:00:00 +00:00
Jeremy Allison
b993081db1 Adding George's Mac extension code.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
5e2844d5ed fixed warnings (and potential errors) due to integer overflow when
creating locking masks
0001-01-01 00:00:00 +00:00
Luke Leighton
657f46edfb first attempt at making unix setuid/setgid code that is independent of
cnums and snums.
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
Andrew Tridgell
783d4b3477 oops - lock test was the wrong way around 0001-01-01 00:00:00 +00:00
Andrew Tridgell
f7ad78e369 fixed pidfile handling to check for a lock on the file, so we can be
sure it is a samba process that is running.
0001-01-01 00:00:00 +00:00
Luke Leighton
eacc5e581a - 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)
0001-01-01 00:00:00 +00:00
Luke Leighton
ef58e48bc9 moved get_unixgroups it will be needed by the unix instance of the group
DB API
0001-01-01 00:00:00 +00:00
Luke Leighton
81be1e6076 jean-f spotted bug in test for existence of MACHINE.SID and SAM_NAME.SID. 0001-01-01 00:00:00 +00:00
Luke Leighton
a74b6dcc76 removed check on name of domain having to be right, etc etc. 0001-01-01 00:00:00 +00:00
Luke Leighton
779a7aa30d issues spotted by andrej: %s\\%s not %s\%s 0001-01-01 00:00:00 +00:00
Luke Leighton
1c478ca172 string_to_sid was using next_token() this is bad as it stops you from
being able to use next_token() outside of string_to_sid calls.
use strchr instead
0001-01-01 00:00:00 +00:00
Luke Leighton
bfb75e58ce fixing smbpasswd to link to smbd to obtain domain sid 0001-01-01 00:00:00 +00:00
Luke Leighton
3e1eb4f26b 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
f5cedb8c96 fix to domain_namemap (domain, ntname wrong way round oops)
stupid compile errors with file_rename() call just created.
0001-01-01 00:00:00 +00:00
Luke Leighton
51c1c31768 adding some samr parsing calls (group / alias adding / deleting)
added code that moves MACHINE.SID to DOMAIN_NAME.SID if it exists.
0001-01-01 00:00:00 +00:00
Luke Leighton
474f94f419 attempting to fix "domain user map" up, but it's a bit complicated.
i may simply go for a response in the NetSamLogon returning the
unix username, forcing the NT user to appear to be a unix user,
however even that is fraught with implications.

might just have to go the whole hog and do this tuple thing,
"unix_name + nt_name" always associated together...


issue with api_net_sam_logon, getsam21pwent() being called twice,
the second time overwriting static buffer data (argh) so had to
make a copy.

noticed a nested "become_root()"/"unbecome_root()" which will have
to be tracked down...
0001-01-01 00:00:00 +00:00
Luke Leighton
e4930f5f48 - 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
b1d1c1337c "retired" two modules to preserve their cvs history.
added their replacements, added sam password database API modules
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
Jeremy Allison
6acb4b68f6 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
53b49b44e1 sorting out difference between aliases and groups in the cases where
unix groups are not explicitly mapped.

i.e as a PDC or BDC you can have domain groups, as a member of a domain
you cannot.

as a member of a domain, unmapped unix groups are assumed to be aliases,
and as a PDC or BDC, unmapped unix groups are assumed to be unix groups.

there is _one_ other check needed with aliases to be added: unmapped unix
groups that have the same name as an NT group on the PDC (for which i will
need to write an LsaLookupNames call) should be assumed to be domain groups
on the PDC.
0001-01-01 00:00:00 +00:00
Luke Leighton
16ac5c89b7 unused variable removed 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
Andrew Tridgell
e93491953a replace ' with _ as well 0001-01-01 00:00:00 +00:00
Andrew Tridgell
a3357ab493 changed string_sub() to replace " ; and ` in the inserted string with _
use all_string_sub() if you don't want this.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
42d2509c9f global change from samba.anu.edu.au to samba.org 0001-01-01 00:00:00 +00:00
Jeremy Allison
7a6f25ac4a Fixed problem with HAVE_NETGROUP being used on platforms
that cannot support it.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
18ff93a9ab 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
0d21e1e609 - 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
4c2b5a0098 Makefile.in configure configure.in include/config.h.in: Changes for DGUX and UNIXWARE.
groupdb/aliasdb.c groupdb/aliasfile.c groupdb/groupfile.c: Don't use snprinf, use slprintf.
include/includes.h: Fix YP problem.
include/smb.h: Fix ZERO_STRUCTP.
lib/util_sock.c: Added strerror() in debugs.
passdb/ldap.c: Don't use snprinf, use slprintf.
rpc_client/cli_lsarpc.c rpc_client/cli_pipe.c rpc_parse/parse_sec.c rpc_server/srv_pipe.c: Don't use snprinf, use slprintf.
script/installman.sh: DGUX changes.
smbd/open.c smbd/oplock.c: Fixed gcc warnings.
web/swat.c: Changes USER to SWAT_USER.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b62f008974 include/smb.h: Re-added zero pointer protection to ZERO_STRUCTP.
lib/util_sock.c: Added strerror() calls to getpeername failures (which seem to be giving IRIX trouble at the moment).
rpc_parse/parse_sec.c: Changed use of ZERO_STRUCTPN to ZERO_STRUCTP which again does zero pointer protection.
smbd/quotas.c: Fixed typo.
Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
06abdfd68e security descriptors.
kanji const char* warnings.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9d05d80f81 include/kanji.h include/proto.h lib/kanji.c: Added const parameters in string wrappers.
printing/printing.c: Added OSF1 fix.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
49bf197103 extracted the password change code from smbpasswd and used it in swat
instead of opening pipes and other horrible stuff.
0001-01-01 00:00:00 +00:00