1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

6623 Commits

Author SHA1 Message Date
Andrew Bartlett
dbee612f71 Change the passdb interface to use allocated strings.
These strings are allocated using talloc(), either using its own memory context
stored on the SAM_ACCOUNT or one supplied by the caller.

The pdb_init_sam() and pdb_free_sam() function have been modifed so that a call
to pdb_free_sam() will either clean up (remove hashes from memory) and destroy
the TALLOC_CTX or just clean up depending on who supplied it.

The pdb_init_sam and pdb_free_sam functions now also return an NTSTATUS, and I
have modified the 3 places that actually checked these returns.

The only nasty thing about this patch is the small measure needed to maintin
interface compatability - strings set to NULL are actually set to "".

This is becouse there are too many places in Samba that do strlen() on these
strings without checking if they are NULL pointers.

A supp patch will follow to set all strings to "" in pdb_default_sam().

Andrew Bartlett
(This used to be commit 144345b41d)
2002-01-15 01:02:13 +00:00
Andrew Bartlett
22e7da0a3d rerun autoconf
(This used to be commit d6bd9f1005)
2002-01-14 22:11:44 +00:00
Andrew Bartlett
6894c42b91 I like --enable-developer, but I find it rather usless when all it gets me is a
screen-full of kerberos warnings.

This is almost as good, and I can actually see the Samba warnings.

Andrew Bartlett
(This used to be commit 35a6275e18)
2002-01-14 22:11:01 +00:00
Andrew Bartlett
d76478f0a7 Initialise cli variables and try not to do a cli_shutdown() of uninitialsed
memory.

The winbind connection caching code isn't exactly a plesent beast, and there is
more work that needs to be done to nail this properly.

Andrew Bartlett
(This used to be commit dd40ce54b7)
2002-01-14 22:08:47 +00:00
Andrew Bartlett
dd0f0f043f Fix a segfault in auth/auth_domain.c error cases.
This occured when the attempt to contact the PDC failed.  The connection code
has already shut down the connection, and 'free'ed the cli or has never
initialised it in the first place.

Andrew Bartlett
(This used to be commit 37ce763043)
2002-01-14 21:52:25 +00:00
Jeremy Allison
9e007457e4 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.
(This used to be commit 5b2b9c25af)
2002-01-14 19:34:28 +00:00
Martin Pool
3353223b47 FIXME We should turn the global list off when using Insure++,
otherwise all the memory will be seen as still reachable.
(This used to be commit 682e7cd394)
2002-01-14 06:51:34 +00:00
Martin Pool
6059f40763 Move local variable to avoid warning when compiled without GSSAPI.
(This used to be commit 312c6d906e)
2002-01-14 06:34:53 +00:00
Martin Pool
1b6c848c10 PSTRING_SANCTIFY:
If you define this, pstring and fstring become distinguished types, so
that it's harder to accidentally overflow them by for example passing
an fstring on the lhs of pstrcpy.

The types are defined as one-element union arrays so that with
"fstring f" the name "f" will be a pointer and with a big hammer you
can cast it to (char *).  So code that tries to just use it directly
will get a loud warning, but hopefully nothing worse.

To pass them to non-pstring-aware functions, use PSTR and check that
the function takes a const.  They should almost never be modified
except by special calls.  In those unusual cases, use PSTR_MUTABLE.

This is off by default so as not to produce too many warnings.  As the
code is vetted it can become the default.
(This used to be commit ca233bc8b3)
2002-01-14 06:15:07 +00:00
Tim Potter
cb4658d419 Removed fprintf(stderr, ...); calls which should not be present in library
functions.
(This used to be commit e69a22290e)
2002-01-14 02:22:31 +00:00
Andrew Bartlett
f7a657721a A couple of coding syle updates to follow the re-indent.
(This used to be commit 7417d6f931)
2002-01-13 12:37:01 +00:00
Andrew Bartlett
fef35c5ce0 Re-indent these two functions to make it actually possible to understand their
contents...

Andrew Bartlett
(This used to be commit e20d69d518)
2002-01-13 12:33:42 +00:00
Andrew Tridgell
2f4a6d60ef don't try to allocate zero bytes
(This used to be commit d09616da68)
2002-01-13 11:46:04 +00:00
Andrew Bartlett
0d1ecbbb73 I'm doing some things towards the NamedPipes game with lckl and he has asked me
to move this from being a static to matching its mate in lib/util_sock.c.

In any case, this should discorage anybody from using the 'wrong' version of
this function.  (ie the one from TNG, which needs a bit more error checking
depending on use).

Andrew Bartlett
(This used to be commit e6a3a01f79)
2002-01-13 11:13:54 +00:00
Andrew Bartlett
e895b9004e 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
(This used to be commit 80c2aefbe7)
2002-01-12 23:57:10 +00:00
Simo Sorce
b79fa88b4d updates from 2.2
(This used to be commit 398b4ff0d4)
2002-01-12 23:12:13 +00:00
Jeremy Allison
c9d350a736 Added PRINTER_INFO_4/PRINTER_INFO_5, we're seeing level 5 requested on the wire... so.
Jeremy.
(This used to be commit b63b762978)
2002-01-12 02:37:54 +00:00
Andrew Bartlett
973c0b3257 Thanks to vance for spotting the missing Makefile.in commit.
This should make things a little happier...

Andrew Bartlett
(This used to be commit 6ce467a65f)
2002-01-12 02:06:17 +00:00
Andrew Bartlett
e3e3144417 Move all the pdb_get...() and pdb_set...() functions to a new file.
This brings passdb.c down to a much more manageable ~1100 lines and makes it a
little easier to comprehend whats going on here.

Andrew Bartlett
(This used to be commit 28d5ab269c)
2002-01-12 01:55:09 +00:00
Jeremy Allison
68245b54cd Added the O_NOFOLLOW flag if follow symlinks is set off.
Jeremy.
(This used to be commit 4f1f5f28b5)
2002-01-12 00:50:01 +00:00
Jeremy Allison
1d40138232 Round and round we go....
Jeremy.
(This used to be commit 2603ab3c68)
2002-01-11 23:33:12 +00:00
Jeremy Allison
b741f6b04c Latest attempt at changeid.
Jeremy.
(This used to be commit 24ee18c77e)
2002-01-11 21:52:46 +00:00
Jeremy Allison
d6823366b8 Same fix as went into 2.2 (I'm waiting for jerry to finish some code).
Jeremy.
(This used to be commit 01ff6ce496)
2002-01-11 19:10:25 +00:00
Andrew Tridgell
27655be3c1 fixed a crash bug in domain auth caused by an uninitialised nt_status
(This used to be commit 0b0b937b58)
2002-01-11 13:14:28 +00:00
Andrew Tridgell
a78fd04681 fixed a crash in merge_aces()
when we free curr_ace_outer we need to not try to use it again :)
(This used to be commit 1c5e19a418)
2002-01-11 11:26:31 +00:00
Andrew Tridgell
13059beb24 force the time difference in cache comparisons to be unsigned to cope
with the local machine time changing
(This used to be commit 116c0a0e3b)
2002-01-11 10:05:34 +00:00
Andrew Tridgell
35623dac54 make the winbind sequence number code more robust
when switching from rpc to ADS this now should make sense
(This used to be commit ec73d26c7f)
2002-01-11 10:02:28 +00:00
Andrew Tridgell
034a855d73 cope with direct IP addresses in resolve_name()
(This used to be commit 73a59170e6)
2002-01-11 09:48:27 +00:00
Samba Release Account
e2584de054 preparing for release of 3.0-alpha13
(This used to be commit 4f4f898348)
2002-01-11 08:48:49 +00:00
Andrew Bartlett
b322fc3b26 Make this error match Win2k.
(This used to be commit 490d3aaf20)
2002-01-11 07:48:55 +00:00
Andrew Bartlett
7f8ae6e35c The DC is meant to be sent the *unmapped* username...
Andrew Bartlett
(This used to be commit d7fca1806a)
2002-01-11 06:22:42 +00:00
Tim Potter
da84e2a756 Always query the PDC for the list of trusted domains rather than interating
the list received at startup or we get an out of date list.  I thought
there might be some sequence number that is incremented when a trusted
domain is added or removed - perhaps there is but I just haven't found it
yet.

 - Renamed get_domain_info() to init_domain_list()

 - Made an accessor function to return the list of trusted domains rather
   than using a global so we don't have to remember to put a magic init
   function

 - The getent state can not keep a pointer to a winbind_domain structure as
   it may be freed if init_domain_list() is called again so we keep the
   domain name instead
(This used to be commit 37216c649a)
2002-01-11 05:33:45 +00:00
Andrew Bartlett
5047a66d39 Back out the crazy notion that the NTLMSSP flags actually mean anything...
Replace this with some flags that *we* define.  We can do a mapping later
if we actually get some more reliable info about what passwords are actually
valid.

Andrew Bartlett
(This used to be commit 7f7a42c3e4)
2002-01-11 05:29:09 +00:00
Tim Potter
348f178428 Correct4ed comment.
(This used to be commit 78814664ef)
2002-01-11 05:14:52 +00:00
Andrew Bartlett
4acb3125cd Fix up 'net ads join' to delete and rejoin if the account already exists.
This fixes up a problem where a machine would join (or downgrade by trust
password change) to NT4 membership and not be able to regain full ADS
membership until a 'net ads leave'.

Andrew Bartlett
(This used to be commit ab8ff85f03)
2002-01-11 04:50:45 +00:00
Tim Potter
9ee8213f9a Some memory leak fixes.
(This used to be commit da4db0373b)
2002-01-11 03:49:51 +00:00
Andrew Tridgell
3fb5e2867c make sure resolve_name() only returns valid IP addresses
this is actually a workaround for old broken nmbd daemons, especially
from Samba 2.0
(This used to be commit 12021a8de6)
2002-01-11 00:23:29 +00:00
Tim Potter
85e06cebc0 Since AB has been changing the winbind interface it's time to add the "mock
swedish" test to client calls.  This is putting a length field at the
start of a request so we can disconnect clients talking with an out of date
libnss_winbind.so rather than deadlock them.

Misc cleanups:

 - made some int values uint32
 - moved WINBIND_INTERFACE_VERSION to start of cmd list
(This used to be commit a4af65b9b9)
2002-01-10 23:45:29 +00:00
Herb Lewis
969d1dd468 added structure members referred to by recent changes in vfs-wrap.c
(This used to be commit c5e14d73df)
2002-01-10 19:40:40 +00:00
Herb Lewis
e87d94d46d merge tpots name changes into IRIX part of code. When you change the name
of a define you need to grep for the old name and change ALL places.
(This used to be commit 09e3276fb7)
2002-01-10 18:49:37 +00:00
Andrew Bartlett
7d6dd0b3a0 Return the winbind separator over the socket, so programs don't have to parse
smb.conf to get it right.

While wb_client needs its lp_load() for samba dependency reasons, it now uses
the new method both to example and test the new code.

Also add an interface version function, and return the winbind's samba version
string.

In preperation for default domains, its now up to winbindd to reject plaintext
auths that don't have a seperator, but NTLM (CRAP) auths now have two feilds,
hence need parsing.

Andrew Bartlett
(This used to be commit 2bd2a092ee)
2002-01-10 11:28:14 +00:00
Andrew Bartlett
cf00e41421 This changes the winbind protcol a bit:
It adds a 'ping' request, just to check winbind is in fact alive

It also changes winbindd_pam_auth_crap to take usernames and domain seperatly.

(backward incompatible change, needs merge to 2.2, but this is not yet released
code, so no workarounds)

Finally, it adds some debugs and fixes a few memory leaks (uses talloc to do
it).

Andrew Bartlett
(This used to be commit 6df29bfe33)
2002-01-10 10:23:54 +00:00
Martin Pool
692215e485 Quieten warning about uninitialized variable.
(This used to be commit 63ea2bb0ad)
2002-01-10 06:32:01 +00:00
Tim Potter
610f530aee A big tidyup while thinking about getting trusted domains being re-read
when they are added or removed on the PDC.

 - renamed GETPWNAM_FROM_{UID,USER} constants and functions to GETPW{NAM,UID}

 - renamed GETGRNAM_FROM_{GID,GROUP} constants and functions to GETGR{NAM,GID}

 - use SIGUSR2 in winbindd for debugging/logging instead of SIGUSR1 in
   preparation for moving to smbcontrol type messages (not sure whether to
   ditch this altogether or not)

 - tidy debugging messages in top level winbind user and group routines

 - convert talloc_init() to talloc_init_named()

 - make enumerations of the domain list use the same local variable names
(This used to be commit eeb8af9c1a)
2002-01-10 06:20:03 +00:00
Tim Potter
cd1ad031a6 Spelling fix.
(This used to be commit 85d3ffb270)
2002-01-10 06:05:37 +00:00
Martin Pool
b8b7ab052a browse_fn: FIXME: If the remote machine returns non-ascii characters
in any of these fields, they can corrupt the output.  We
	   should remove them.
(This used to be commit 934aacdb39)
2002-01-10 03:53:06 +00:00
Jeremy Allison
a36c10bd1e First part of UNIX extensions (#ifdefed out) more to follow.
Jeremy.
(This used to be commit 02b18f2cca)
2002-01-10 02:41:15 +00:00
Jeremy Allison
fd56ebd54f Oh joy - the original code didn't do mapping of the perms onto the wire.
Make it up as we go along... :-).
Jeremy.
(This used to be commit 4289fe3499)
2002-01-10 02:18:08 +00:00
Jeremy Allison
f069a41c85 Ensure this is committed last.
Jeremy.
(This used to be commit 2591361fa8)
2002-01-10 01:49:22 +00:00
Jeremy Allison
09571aa76d We need to test for major/minor macros.
Jeremy.
(This used to be commit ee8c8add7f)
2002-01-10 01:49:09 +00:00