1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00
Commit Graph

367 Commits

Author SHA1 Message Date
Jeremy Allison
3af16ade17 Fix from Michael Steffens <michael_steffens@hp.com> to make signal
processing work correctly in winbindd. This is a really good patch
that gives full select semantics to the Samba modified select.
Jeremy.
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
Gerald Carter
69a9c005c2 merge from 2.2 0001-01-01 00:00:00 +00:00
Tim Potter
3c887d9021 Since we have dynamic initialisation in the group mapping code, make
init_group_mapping() a static function and don't call it from any client
programs.

Not sure whether I've made a bigger mess here or not...
0001-01-01 00:00:00 +00:00
Andrew Bartlett
554842e0a5 Fix up a security issue with the way we handle domain groups retuned on the
info3.  These are RIDs, and it only makes sense to combine them with the domain
SID returned with them.  This is important for trusted domains, where that sid
might be other than the one we currently reterive from the secrets.tdb.

Also remove the become_root()/unbecome_root() wrapper from around both
remaining TDB users:  Both are now initialised at smbd startup.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
7d05175494 Ensure (C) message is output on startup.
Jeremy.
0001-01-01 00:00:00 +00:00
Martin Pool
e38e7a2bdc Roll back PSTR insertion.
Just leave the fstrcpy/pstrcpy bugfix, and conversion to pstr_sprintf
rather than manual calculation of length.
0001-01-01 00:00:00 +00:00
Martin Pool
5a403da4a7 Convert to the new pstring interface. This diff is a pretty good
example of the scope of change the new pstrings would entail:
basically inserting PSTR() or FSTR() everywhere you need to coerce one
to a char*.

It's also a good example of the kind of bug we might catch: on about
line 540, we were doing a pstrcpy into an fstring, which might
overflow.  It's not a problem in this particular case, but it is in
general.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5b2b9c25af Removed MAXSTATUS which was set incorrectly - thus causing tdb traversal
of the connections db on smbd startup. This should fix the Solaris large
load bug.... (fingers crossed).
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
80c2aefbe7 Many thanks to Alexander Bokovoy <a.bokovoy@sam-solutions.net>.
This work was sponsored by Optifacio Software Services, Inc.

Andrew Bartlett

(various e-mails announcements merged into some form of commit message below:)

This patch which adds basics of universal groups support
into Samba 3. Currently, only Winbind with RPC calls supports this, ADS
support requires additional (possibly huge) work on KRB5 PAC. However,
basic infrastructure is here.

This patch adds:

1. Storing of universal groups for particular user logged into Samba
software (smbd/ two winbind-pam methods) into netlogon_unigrp.tdb as array
of uint32 supplemental group rids keyed as DOMAIN_SID/USER_RID in tdb.

2. Fetching of unversal groups for given user rid and domain sid from
netlogon_unigrp.tdb.

Since this is used in both smbd and winbindd, main code is in
source/lib/netlogon_uingrp.c. Dependencies are added to AUTH_OBJ as
UNIGRP_OBJ and WINBINDD_OBJ as UNIGRP_OBJ.

This patch has had a few versions, the final version in particular:

Many thanks to Andrew Bartlett for critics and comments, and partly
rewritten code.

New:
- updated fetching code to changed byte order macros
- moved functions to proper namespace
- optimized memory usage by reusing caller's memory context
- enhanced code to more follow Samba coding rules

Todo:
- proper universal group expiration after timeout
0001-01-01 00:00:00 +00:00
Martin Pool
bcb443c5c4 Add two more memory-debug smbcontrol messages: these ones should
prompt dmalloc to log information about what happening, so you can see
in flight why smbd is getting bloated.
0001-01-01 00:00:00 +00:00
Martin Pool
391cbb6901 Better explanation message for dmalloc.
Also more insertion of parenthesis to handle struct members called
'free'.

You can now get useful dmalloc output, as long as it is compatible
with your C library.  On RH7.1 it looks like you have to rebuild
dmalloc to allow free(0) by default, because something in libcrypt
does that. (sigh)
0001-01-01 00:00:00 +00:00
Martin Pool
b29775d442 Add UNUSED(paramname) macro to be used in parameter lists, to quieten
gcc warnings about unused parameters.
0001-01-01 00:00:00 +00:00
Jeremy Allison
274b04d4a6 Fixed up atomic update code.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
12f5515f55 I've decided to move the auth code around a bit more...
The auth_authsupplied_info typedef is now just a plain struct - auth_context,
but it has been modified to contain the function pointers to the rest
of the auth subsystem's components.

(Who needs non-static functions anyway?)

In working all this mess out, I fixed a number of memory leaks and moved the
entire auth subsystem over to talloc().

Note that the TALLOC_CTX attached to the auth_context can be rather long-lived,
it is provided for things that are intended to live as long.  (The
global_negprot_auth_context lasts the whole life of the smbd).

I've also adjusted a few things in auth_domain.c, mainly passing the domain as
a paramater to a few functions instead of looking up lp_workgroup().  I'm
hopign to make this entire thing a bit more trusted domains (as PDC) freindly
in the near future.

Other than that, I moved a bit of the code around, hence the rather messy diff.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Martin Pool
830a126a44 smbd should register to receive MSG_REQ_POOL_USAGE. Response should
be information about memory usage, but this is not done yet.
0001-01-01 00:00:00 +00:00
Jeremy Allison
fffae94dd5 When running interactive we want to set our own process group for
signal management.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9343b613d3 Fixup -i interactive modes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0bea6cf79a Removed global debugf. Replaced with lp_set_logfile(name).
Fixed winbindd to finally stop leaving log. file droppings :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
bc28a8eebd added a tdb to store the account policy informations.
You can change them with either usermanager->policies->account
or from a command prompt on NT/W2K: net accounts /domain

we can add a rpc accounts to the net command. As the net_rpc.c is still
empty, I did not start. How should I add command to it ? Should I take the
rpcclient/cmd_xxx functions and call them from there ?

alse changed the SAM_UNK_INFO_3 parser, it's an NTTIME. This one is more
for jeremy ;-)

        J.F.
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
Tim Potter
8fc772c9e5 Removed TimeInit() call from every client program (except for one place
in smbd/process.c where the timezone is reinitialised.  Was replaced with
check for a static is_initialised boolean.
0001-01-01 00:00:00 +00:00
Martin Pool
79ec88f0da Store some path names in global variables initialized to configure
default, rather than in preprocessor macros.
0001-01-01 00:00:00 +00:00
Simo Sorce
1ffacd2068 lets try the new mangling code
all the calls go through a compatibility interface will
change that soon
a new mangle.tdb file will be set in the lock directory
it contains a static mapping longname<->manglename
0001-01-01 00:00:00 +00:00
Jeremy Allison
8d23a7441b Merge the become_XXX -> change_to_XXX fixes from 2.2.2 to HEAD.
Ensure make_conection() can only be called as root.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
04479db879 got rid of start_background_queue()
THIS WAS A DISASTER!

it created hundreds of processes on the build farm machines, which we
can't kill.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
8ef9dff307 very simple asynchronous "lpq" thread patch
To speed up operations with the lpq command, it's now run in a separate
asynchronous process.

Opening the Printers folder on NT is now fast ;-) I think even faster than
with a ** server

Jeremy, you should look at that patch to include it in 2.2.3

	J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
1c221994f1 switched over to a new method of handling uppercase/lowercase mappings
for unicode strings. The new method relies on 3 files that are mmap'd
at startup to provide the mapping tables. The upcase.dat and
lowcase.dat tables should be the same on all systems. The valid.dat
table says what characters are valid in 8.3 names, and differs between
systems. I'm committing the japanese valid.dat here, in future we need
some way of automatically installing and choosing a appropriate table.

This commit also adds my mini tdb based gettext replacement in
intl/lang_tdb.c. I have not enabled this yet and have not removed the
old gettext code as the new code is still being looked at by Monyo.

Right now the code assumes that the upcase.dat, lowcase.dat and
valid.dat files are installed in the Samba lib directory. That is not
a good choice, but I'll leave them there until we work out the new
install directory structure for Samba 3.0.

simo - please look at the isvalid_w() function and think about using
it in your new mangling code. That should be the final step to
correctly passing the chargen test code from monyo.
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
Andrew Bartlett
beff1d2bea Add the ability to display Samba's build options with smbd -b and as a level 4
DEBUG().  Also included are details like build date/time, location and
compiler.

This should get most of the options we set, except those that don't affect
smbd, like WITH_PAM_SMBPASSWD or WITH_WINBINDD.

This work due to Vance Lankhaar <vlankhaar@hotmail.com>

Some work needs to be done to make it only rebuild when needed (ie smbd being
rebuilt) but its in pretty good shape already.

Also fix up some printf() -> d_printf().

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e8bd42edc0 printf() -> d_printf() 0001-01-01 00:00:00 +00:00
Andrew Tridgell
f49518e497 added a hook to reopen all tdb's after the server fork
this prevents the fd seek pointer problem
0001-01-01 00:00:00 +00:00
Andrew Tridgell
1af8bf34f1 replaced stdio in many parts of samba with a XFILE. XFILE is a cut-down
replacemnt of stdio that doesn't suffer from the 8-bit filedescriptor
limit that we hit with nasty consequences on some systems

I would eventually prefer us to have a configure test to see if we need
to replace stdio, but for now this code needs to be tested widely so
I'm enabling it by default.
0001-01-01 00:00:00 +00:00
Tim Potter
08e05f1b3c Added dummy handlers for SAM_SYNC and SAM_REPL messages. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
b068ad3005 A few changes:
drop paramaters:
 status
 utmp hostname

change session code to always record each vuid current on the server.  The sessionid struct is no longer packed, as I couldn't get that to work ;-)

change smbstatus to show this info and less of the connections.tdb info (its not actualy that accurate).

I'll get swat doing some of this shortly.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
23b6772a24 Try to set the socket options early for some OSs (like Sol 8) where they
can't be set after the listen().

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
f591ca9f25 Fixes from Jens-Uwe.Walther@force.de to make the -l option behave
consistently.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d472ee3a69 added winbind_exclude_domain() so smbd can tell the winbind client
code not to do lookups for a particular domain. This allows winbind to
operate on a Samba PDC
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
Andrew Tridgell
e2ecff419f fixed usage of socklen_t and also tidied up SIG_ATOMIC_T, using a typedef instead of a define 0001-01-01 00:00:00 +00:00
Andrew Tridgell
55109a7525 - make the regresison test mode code build in by default. This should
allow us to have test targets without special configure options
- fixed make proto so that it actually does something
0001-01-01 00:00:00 +00:00
Andrew Tridgell
7e8e6ae9a8 added the ability to test smbd safely as an ordinary user. The way it works is
that libsmb/ creates a local tcp socket then launches smbd as a subprocess
attached to that socket. smbd thinks it is being launched from inetd.

to use it do the following:

- compile with -DSMB_REGRESSION_TEST
- run like this (also works with smbtorture etc)
    export SMBD_TEST=1
    export LIBSMB_PROG=bin/smbd
    smbclient //server/share -Uuser%pass

obviously you need to setup a smb.conf etc. Using --prefix to configure
is useful.

The aim of all this stuff is to add a decent set of regression tests
to the build farm, so we know if smbd actually runs correctly on all the
platforms, not just builds. We can run smbtorture, masktest, locktest etc,
plus a bunch of smbclient scripts and any new tests we write.

This doesn't help much with nmbd (at least not yet) but its a good start.
0001-01-01 00:00:00 +00:00
Jeremy Allison
cf5015f159 Added tdb_change_int_atomic() to allow atomic updates of a tdb int value.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
15584d30cd Patch from ackley@cs.unm.edu to clear server_fd/client_fd in root daemon to stop
%I getpeername() failure.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f52a5014ee merge from 2.2 0001-01-01 00:00:00 +00:00
Jeremy Allison
036b1a8b09 Added set/get SD's on shares. Check before tcon.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
94747b4639 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
7154deb026 first pass of the new group mapping code
J.F.
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