1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00

7562 Commits

Author SHA1 Message Date
Andrew Bartlett
07a21fcd23 This is the 'winbind default domain' patch from Alexander Bokovoy
<a.bokovoy@sam-solutions.net>.

The idea is the domain\username is rather harsh for unix systems - people don't
expect to have to FTP, SSH and (in particular) e-mail with a username like
that.

This 'corrects' that - but is not without its own problems.

As you can see from the changes to files like username.c and wb_client.c (smbd's
winbind client code) a lot of assumptions are made in a lot of places about
lp_winbind_seperator determining a users's status as a domain or local user.

The main change I will shortly be making is to investigate and kill off
winbind_initgroups() - as far as I know it was a workaround for an old bug in
winbind itself (and a bug in RH 5.2) and should no longer be relevent.

I am also going to move to using the 'winbind uid' and 'winbind gid' paramaters
to determine a user/groups's 'local' status, rather than the presence of the
seperator.

As such, this functionality is recommended for servers providing unix services,
but is currently less than optimal for windows clients.

(TODO: remove all references to lp_winbind_seperator() and
lp_winbind_use_default_domain() from smbd)

Andrew Bartlett
-
Jeremy Allison
85da18e46e Tidyup & code refactoring from Martin.Sheppard@csiro.au.
Jeremy.
-
Jeremy Allison
eb99e7f29c Ensure we log tdb open fails. Patch from Alexander Bokovoy <a.bokovoy@sam-solutions.net>
Jeremy.
-
Jeremy Allison
9a969069f1 Added prs_mem_clear(). Clear memory on buffer reallocation. That way
we're not returning what the client gave us.
Jeremy.
-
Jeremy Allison
6deb4caca5 Always clear malloced memory for parse structs.
Jeremy.
-
Andrew Bartlett
1d86c7f942 A nice *big* change to the fundemental way we do things.
Samba (ab)uses the returns from getpwnam() a lot - in particular it keeps
them around for a long time - often past the next call...

This adds a getpwnam_alloc and a getpwuid_alloc to the collection.

These function as expected, returning a malloced structure that can be
free()ed with passwd_free(&passwd).

This patch also cuts down on the number of calls to getpwnam - mostly by
taking advantage of the fact that the passdb interface is already
case-insensiteve.

With this patch most of the recursive cases have been removed (that I know
of) and the problems are reduced further by not using the sys_ interface
in the new code.  This means that pointers to the cache won't be affected.
(This is a tempoary HACK, I intend to kill the password cache entirly).

The only change I'm a little worried about is the change to
rpc_server/srv_samr_nt.c for private groups.  In this case we are getting
groups from the new group mapping DB.  Do we still need to check for private
groups?  I've toned down the check to a case sensitve match with the new code,
but we might be able to kill it entirly.

I've also added a make_modifyable_passwd() function, that copies a passwd
struct into the form that the old sys_getpw* code provided.  As far as I can
tell this is only actually used in the pass_check.c crazies, where I moved
the final 'special case' for shadow passwords (out of _Get_Pwnam()).

The matching case for getpwent() is dealt with already, in lib/util_getent.c

Also included in here is a small change to register the [homes] share at vuid
creation rather than just in one varient of the session setup.  (This picks
up the SPNEGO cases).  The home directory is now stored on the vuid, and I
am hoping this might provide a saner way to do %H substitions.

TODO:  Kill off remaining Get_Pwnam_Modify calls (they are not needed), change
the remaining sys_getpwnam() callers to use getpwnam_alloc() and move
Get_Pwnam to return an allocated struct.

Andrew Bartlett
-
Andrew Bartlett
d123d79060 Move the bang (!) command back to the bottom of the list, allowing smbclient
to function again.

Add comment to warn anybody that wants to 'Alphabetize' the list to read crh's
existing comment on the issue.

Andrew Bartlett
-
Tim Potter
aca0edc819 Made a debug look nicer. -
Tim Potter
967c688580 Added some guards. -
Tim Potter
e675d34dbf Fixed typo. -
Herb Lewis
4ab2a77543 new config files for winbindd startup -
Andrew Tridgell
fb300e411b fixed a typo in the error map for WRONG_PASSWORD -
Andrew Tridgell
c3a83002cf don't use O_NONBLOCK in open(). This was added erroneously for kernel
oplocks and really shouldn't be used
-
Jeremy Allison
c1b97226db Separate out get_user_home_dir() from get_user_home_service_dir().
Jeremy.
-
Jeremy Allison
0fcca6c627 Merged in %S fixes and XX_NOT_CHANGED fixes from 2.2.
Jeremy.
-
Jeremy Allison
16fcbf3c1c Fixup error mapping so we have only one table containing errno -> dos error -> NT STATUS
maps. Fixes problem with disk full returning incorrect error.
Jeremy.
-
Jeremy Allison
64301bc5f7 Alphabetize.
Jeremy.
-
Jeremy Allison
794c3e2c76 Added CIFS UNIX extension code to client.
Jeremy.
-
Jeremy Allison
4e41780c21 Fix name register bug with non-existent wins server.
Jeremy.
-
Jeremy Allison
2f57257558 At leadt don't lose this - I need to re-sync trans2.c between 2.2.x and
HEAD soon.
Jeremy.
-
Martin Pool
cee0ec7274 Roll back PSTRING_SANCTIFY patch; just leave non-controversial type
and constness changes.
-
Tim Potter
1906903f06 Quieten some pointer cast warnings. -
Andrew Tridgell
7e876057d5 much better support for organisational units in ADS join -
Martin Pool
e38e7a2bdc Roll back PSTR insertion.
Just leave the fstrcpy/pstrcpy bugfix, and conversion to pstr_sprintf
rather than manual calculation of length.
-
Tim Potter
cfac669017 Merge of name_status_find() debugs. -
Jim McDonough
4fcaec53de Fix from 2.2. It didn't break on HEAD because it isn't being compiled. Herb? -
Jeremy Allison
adf24a90e8 Missing assign fix from Bernt Nilsson bkn@ida.liu.se.
Jeremy.
-
Andrew Bartlett
724109a33b For some reason I wasn't thinking about failure cases this morning...
Anyway, this makes it slightly sane, but we may decide to smb_panic() here
instead.

Andrew Bartlett
-
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.
-
Martin Pool
04e3082f7d Split pstring definitions into their own header. -
Martin Pool
20a03facb6 Integrate with PSTRING_SANCTIFY. -
Martin Pool
bf513668cb #ifdef variable that's not used without dmalloc -
Martin Pool
e0105974c0 Add constness to parameters -
Herb Lewis
d5cdbc7e4f adding wins commands to winbindd - will check in the rest of the changes
after further testing in 2.2 branch.
-
Martin Pool
a61abaec06 Add constness to parameters -
Martin Pool
8d106dc1f4 Add constness to filenames passed to functions. -
Andrew Bartlett
5b4079f748 Commit the auth associated changes I missed from the last commit.
Also set the default value of all the allocated strings to "" to avoid changing
the interface (becouse pdb_get...() would point to a null string, rather than a
null pointer and parts of samba rely on that).

Andrew Bartlett
-
Andrew Bartlett
144345b41d 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
-
Andrew Bartlett
d6bd9f1005 rerun autoconf -
Andrew Bartlett
35a6275e18 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
-
Andrew Bartlett
dd40ce54b7 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
-
Andrew Bartlett
37ce763043 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
-
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.
-
Martin Pool
682e7cd394 FIXME We should turn the global list off when using Insure++,
otherwise all the memory will be seen as still reachable.
-
Martin Pool
312c6d906e Move local variable to avoid warning when compiled without GSSAPI. -
Martin Pool
ca233bc8b3 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.
-
Tim Potter
e69a22290e Removed fprintf(stderr, ...); calls which should not be present in library
functions.
-
Andrew Bartlett
7417d6f931 A couple of coding syle updates to follow the re-indent. -
Andrew Bartlett
e20d69d518 Re-indent these two functions to make it actually possible to understand their
contents...

Andrew Bartlett
-
Andrew Tridgell
d09616da68 don't try to allocate zero bytes -