1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

827 Commits

Author SHA1 Message Date
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...
-
Andrew Tridgell
21d779bf7d removed include of net/route.h because it prevents compilation under
SCO 3.2 (including it also requires lots of streams stuff, making it a
total mess).

If this causes problems on some other platform then please add a
comment stating what platform and why the include is needed so we can
work out how to test for it properly.
-
Luke Leighton
a24f6eb00b 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.
-
Luke Leighton
591c63e3e1 fixing group database issues -
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.
-
Luke Leighton
68342a29a8 LsaLookupNames client call (first used as lookupnames command in rpcclient). -
Luke Leighton
53339b6389 re-added includes for yp_prot.h and yp_clnt.h -
Luke Leighton
0fdac4b42f get rid of __wait boring warning, caused by rpc/clnt.h -
Luke Leighton
e76f593b35 unix instance of group database API -
Andrew Tridgell
a3357ab493 changed string_sub() to replace " ; and ` in the inserted string with _
use all_string_sub() if you don't want this.
-
Andrew Tridgell
bdcee2557b deleted some old DEBUG() code that wasn't used -
Jeremy Allison
34d8f4b1c4 acconfig.h configure configure.in include/config.h.in: Added -lsec and -lsecurity checks
in a more sane way.
rpc_client/cli_netlogon.c: Removed correct bits check to see if this works with an NT3.51 PDC.
rpc_parse/parse_samr.c: Fixed compile warnings.
Jeremy.
-
Jeremy Allison
b02d21a73d Fixed stupid blunder where I renamed getpwanam to getpwnam.
Jeremy.
-
Jeremy Allison
2d62dc26f4 Makefile.in: Added passing of CPPFLAGS into Makefile.
configure
configure.in
include/config.h.in: Fixes for AIX4.x. AIX *will not*
                     enable large file support of *any* description unless
                     either -D_LARGE_FILES or -D_LARGE_FILES_API are defined.
                     I chose "-D_LARGE_FILES" as this leads to cleaner code...

Also fixed bug where getpwnam was listed as getpw(a)nam in configure.in.
Jeremy.
-
Jeremy Allison
1ef6d3bd63 Sync up with 2.0 code.
Added HPUX autoconf changes.
Added "gross hack" printer code.
Jeremy.
-
Jeremy Allison
5ad77769be Changes to make the default prefix /usr/local/samba - as it was in 1.9.18p10.
acconfig.h configure configure.in include/config.h.in: Fixes to DEC OSF1.
libsmb/nmblib.c: Fixes to nmbd jumps in scope names.
Jeremy.
-
Jeremy Allison
30af39ae1e Added OSF1 changes to HEAD (-lsecurity etc.)
groupdb/groupdb.c: Fixed compile error caught by IRIX compiler.
utils/smbpasswd.c: Fixed SunOS optind, optarg problem.
Jeremy.
-
Jeremy Allison
7a6f25ac4a Fixed problem with HAVE_NETGROUP being used on platforms
that cannot support it.
Jeremy.
-
Jeremy Allison
92a7a86f0e Fixed NT modify timestamp issue.
If a client does a modify timestamp on an open file (which will
do no good at all on UNIX :-) then keep the modify request pending
in the files_struct and apply it at close instead.
Jeremy.
-
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.
-
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.
-
Jeremy Allison
c1a3346547 Moved PRINTCAP_NAME from smb.h to includes to allow it to
be tuned per system type.
Jeremy.
-
John Terpstra
5f7d9d4656 Updates to handle glob.h - was causing problems on SCO 5.0.4 -
Andrew Tridgell
d9d44d98ec change ROUNDUP to SMB_ROUNDUP to prevent conflicts with system macros -
Andrew Tridgell
8e8ab4df1f - new prototypes
- much as I hate doing it I've removed the "commit changes" button for
  users that don't have write access to smb.conf (Jeremy insisted)
-
Jeremy Allison
9ee8f39aed Removed acconfig.h configure configure.in include/config.h.in: Made smbwrapper not made
by default.
nmbd*: Changed all calls to namestr() to nmbd_namestr() to fix broken FreeBSD include
	   file problem...sigh.
Jeremy.
-
Jeremy Allison
26c3ff2bcb Change to beta1. -
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.
-
Andrew Tridgell
24b2bf1741 reverted includes change for FreeBSD as it breaks IRIX -
Luke Leighton
2908ccd14d oops - ZERO_STRUCTP() issues again... -
Luke Leighton
0be34ca140 ZERO_STRUCTP does not check argument for NULL.
ZERO_STRUCTPN _does_ check argument for NULL.
-
Andrew Tridgell
5be3c37f50 fixes for OSF1 compilation -
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.
-
Luke Leighton
9412edfd4c security descriptors -
Herb Lewis
48af29bcc9 Removed code that used printf/fprintf in password changin libraries.
Now passes strings instead.
-
Luke Leighton
06abdfd68e security descriptors.
kanji const char* warnings.
-
Herb Lewis
3c45a3503e .cvsignore: Removed old entries.
client/client.c:
include/client.h: Added some debug messages that the old client used to
		  generate. These are needed to make scripts such as
		  'findsmb' work - there may be other changes to keep
		  backwards output compatibility. Do we need a -old-client-compat
		  argument ?
libsmb/clientgen.c: Fixed crash bug where malloc'ed data wasn't being
		    cleared - corrupted malloc chains.
web/swat.c: John's changes to get rid of "ghost" table entries.
-
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.
-
Luke Leighton
7466c3113e jean-f. sent me some S-1-3-0,1,2,3 SIDs and names. S-1-3 doesn't exist.
security descriptor testing.  hey wow, you can get a SD then send it back!
-
Luke Leighton
cbac0f165d cleaning up conflicts between group code not yet committed and
changes from yesterday by me, jeremy and andrew.

jeremy, your ACB_PWNOTREQ mod would have caused a crash if the user
didn't exist (first check should be for smb_pass != NULL)
-
Luke Leighton
9814ac8a65 security descriptors and registry. -
Andrew Tridgell
49bf197103 extracted the password change code from smbpasswd and used it in swat
instead of opening pipes and other horrible stuff.
-
Andrew Tridgell
713864dd03 largely rewrote smbpasswd so that the code is understandable. This
should allow us to call a function in swat rather than piping to
smbpasswd.

while doing this I also fixed quite a few "const char *" versus "char *" issues
that cropped up while using const to track down bugs in the code. This
led to changes in several generic functions.

The smbpasswd changes should be correct but they have not been
extensively tested. At least if I have introduced bugs then we should
be able to fix them more easily than before.
-
Jeremy Allison
45131501f2 Moved some code (NTLMSSPcalc) out of smbdes and inline for paranioa
resons and my own piece of mind...
Jeremy.
-
Jeremy Allison
7d55bf3791 Added the security changes suggested by Andrew - become the
user that authenticated to swat permanently (if not root).
Jeremy.
-
Andrew Tridgell
52f47b8d2e changed is_root() to am_root() to prevent clash with variable names. -
Jeremy Allison
80e0f7e107 rpc_server/srv_netlog.c: Fixed crash bug with ACB_PWNOTREQ.
script/makeyodldocs.sh: Added code to make text docs for non-man page YODL docs.
web/cgi.c web/swat.c: SGI compiler warnings fixed.
Jeremy.
-
Luke Leighton
719382a557 security descriptor info, provided by jean-francois -
Luke Leighton
abdc9d790b clearing up security descriptor -
Luke Leighton
13a0ee851f changed syntax of registry commands so keys can start with HKLM or HKU.
sorted lookupsids command
-