1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-14 01:57:53 +03:00

1523 Commits

Author SHA1 Message Date
Andrew Bartlett
fe2bc64bc4 - Make ReadDirName return a const char*.
- Consequential changes from that

 - mark our fstring/pstring assumptions in function prototypes

Andrew Bartlett
-
Andrew Bartlett
67a0319d26 Remove an unused function and fix the build.
Andrew Bartlett
-
Andrew Bartlett
31f4827acc String handling parinoia fixes.
This patch enables the compile-time checking of strings assable by means of
sizeof().  (Original code had the configure check reversed).

This is extended to all safe_strcpy() users, push_string and pull_string,
as well as the cli and srv derivitives.  There is an attempt to cap strings
at the end of the cli buffer, and clobber_region() of the speified length
(when not -1 :-).

Becouse of the way they are declared, the 'overmalloc a string' users of
safe_strcpy() have been changed to use overmalloc_safe_strcpy() (which skips
some of the checks).

This whole ball of mud worked fine, until I pulled out my 'fix' for our
statcache.  When jeremy fixes that, we should be able to get back to testing
this stuff.

This patch also includes a 'marker' of the last caller to clobber_region (ie,
the function that called pstrcpy() that called clobber_region) to assist in
debugging problems that may have smashed the stack.  This is printed at
smb_panic() time.  (Original idea and patch by metze).

It also removes some unsused functions, and #if 0's some others that are
unused but probably should be used in the near future.

For now, this patch gives us some confidence on one class of trivial parsing
error in our code.

Andrew Bartlett
-
Gerald Carter
2487480228 fix WinXP & Win2K3 remote_arch and check pointer in ntlmssp code before dereferencing -
Gerald Carter
4c823e61d1 adding some initiaial code to sert %a to Win2K3 (using Native LanMan string from .NET RC2) -
Andrew Bartlett
147a0c8b13 Add const -
Andrew Bartlett
0620320002 This patch attemptes to clean up winbindd's mutex locking.
The current locking scheme in winbind is a complete mess - indeed, the
next step should be to push the locking into cli_full_connection(), but
I'll leave it for now.

This patch works on the noted behaviour that 2 parts of the connection
process need protection - and independent protection.  Tim Potter did
some work on this a little while back, verifying the second case.

The two cases are:
 - between connect() and first session setup
 - during the auth2 phase of the netlogon pipe setup.

I've removed the counter on the lock, as I fail to see what it gains us.

This patch also adds 'anonymous fallback' to our winbindd -> DC connection.

If the authenticated connection fails (wbinfo -A specifed) - say that
account isn't trusted by a trusted DC - then we try an anonymous.

Both tpot and mbp like the patch.

Andrew Bartlett
-
Martin Pool
98479f1315 Remove valgrind_strlen function, hopefully no longer needed with
recent Valgrind relases and clashing with -DVALGRIND.
-
Martin Pool
8d915e266c Clobber strings with 0xf1f1f1f1 before writing to them to check buffer
lengths are correct.  Attempts to pstrcpy into an fstring or allocated
string should fail in developer builds.

This builds on abartlet's earlier overflow probe for safe_strcpy, but
by clobbering the whole string with a nonzero value is more likely to
find overflows on the stack.

This is only used in -DDEVELOPER mode.

Reviewed by abartlet, tpot.
-
Andrew Bartlett
25d210b90b This is C, not C++ -
Andrew Bartlett
afe5a3832f Make sure that the 'remote' machine name can only be set once. For some weird
reason, during a Win2003 installation, when you select 'domain join' it sends
one machine name in the name exchange, and litraly 'machinename' during the
NTLMSSP login.

Also fix up winbindd's logfile handling, so that it matches smbd and nmbd.

(This helps me, by seperating the logs by pid).

Andrew Bartlett
-
Simo Sorce
4c6d461a85 Some progress towards gums and tdbsam2
genparser works fine, and it is a marvelous tool to store objects in tdb :)
-
Jeremy Allison
ff3827a62b dlsym takes a const char *.
Jeremy.
-
Martin Pool
a4b9c5c257 Doxygen janitor: add note that strequal is in fact case-insensitive. -
Martin Pool
9af0717315 Doxygen janitor -
Martin Pool
42d9ec28cd Doxygen janitor: fix parameter names, grammar, tag names. -
Martin Pool
eb876ee9cf Add a comment about the meaning of samba's internal character set and
how this interacts with it.
-
Gerald Carter
96570699d1 additional fix for CR 601
* distinguish WinXP from Win2k
  * add a 1/3 of a second delay in OpenPrinter
    in order to trigger a LAN/WAN optimization in
    2k clients.
-
Martin Pool
67bf36c69d Doxygen janitor -
Jelmer Vernooij
f8f2165322 - Rename 'modules = ' to 'preload modules = '
- Add smb_probe_module()
- Add init_modules()
- Call these functions
-
Martin Pool
e42b237d98 init_valid_table: Fix a memory leak that would lose the
dynamically-created valid table every time the configuration was
reloaded.
-
Andrew Bartlett
c26881633d Move off-by-one buggy malloc()/safe_strcpy() combination to strdup() instead.
Andrew Bartlett
-
Martin Pool
5002555a97 Merge documentation from 3_0. -
Andrew Bartlett
ffaa608be0 Add const -
Andrew Bartlett
e908fd164d Fix 2 off-by-one bugs in the use of malloc()ed strings and safe_strcpy().
safe_strcpy() isn't particularly safe (this has been noted before) as it does
not take the size of the buffer, but instead the size of the buffer *minus 1*

The locking.c fix was causing segfaults on machines running with
--enable-developer, and was tracked down thanks to the fact that vance's build
farm machine runs with such an option, and smbtorture's DIR1 test hits this
bug very well.

(The --enable-developer code writes to the last byte of the string, to check
for incorrect use of safe_strcpy()).

Andrew Bartlett
-
Simo Sorce
70fce680c0 move genparser to use talloc contexts instead of [m|c|re]alloc() and free()s -
Andrew Bartlett
2943c69578 More signed/unsigned fixes (yes, I run with funny compiler options) and
make x_fwrite() match fwrite() in returning a size_t.

Andrew Bartlett
-
Martin Pool
3679975629 Doxygen janitor -
Jelmer Vernooij
7f59703550 Make init_module() and thus smb_load_module() return an int.
modules/developer.c: init_module() should return an int
-
Andrew Bartlett
50bced1e26 Move to a in-memory ccache for winbind, and replace setenv() properly.
(According to the manpages, you cannot put a stack variable into putenv()).

Yes, this leaks memory.

Andrew Bartlett
-
Jim McDonough
8c69212eeb base64_decode() with heimdal libs, so I've renamed it base64_decode_inplace(). -
Jeremy Allison
e7c4616c45 Ensure we use getgrnam() unless BROKEN_GETGRNAM is defined. I now need
to set this for Tru64.
Jeremy.
-
Martin Pool
e22465749d Remove obsolete comment. -
Martin Pool
82414706e6 Doxygen janitor and some doc typo fixes. -
Martin Pool
fa38e7956c Doxygen janitor. No other changes. -
Martin Pool
90e1d8bdfa Add comment explaining the -DDEVELOPER safe_strcpy overflow hack. -
Andrew Bartlett
3588ebb35b This is a very nice way to detect pstrcpy() into a malloc()ed string, but
it really is a developer hack...

Andrew Bartlett
-
Andrew Bartlett
9be21976f7 This patch fixes one of my longest-standing pet hates with Samba :-).
When we look see if a user is in a list, and we try to 'expand' an @group, we
should lookup the user's own list of groups, rather than looking for all the
members of a group.

I'm sure this will fix some nasty performance issues, particularly on large
domains etc.  In particular, this avoids contacting winbind at all, if the
group is not a winbind group.

(This caused a deadlock on my winbind-on-PDC setup).

The groups list always includes the user's primary group, as per the
getgrouplist manpage, and my recent changes to our implementation.

Andrew Bartlett
-
Andrew Bartlett
4560594a67 Set the length back to zero when we free the data_blob. -
Andrew Bartlett
0cd4b339b7 Try to make our getgrouplist replacement better match the 'real' implemenations.
In particular, make sure we include the primary gid in the list.

Andrew Bartlett
-
Jelmer Vernooij
28653989cf Remove obsolete file lib/netatalk.c - We have a VFS module now -
Tim Potter
026b988b13 Simplify some return values in gencache functions:
-	return ret == 0 ? True : False;
+	return ret == 0;

and

-	return tdb_close(cache) ? False : True;
+	return tdb_close(cache) != -1;
-
Martin Pool
2b5664823e Add FIXME about checking exit code for popen'd commands.
Fix typo.
-
Andrew Tridgell
3cf539421f pull_ucs2_talloc() should pull to a char**, not a void** -
Andrew Bartlett
7e56014b28 One more fix for the difference between FILE and X_FILE. -
Andrew Bartlett
6a028507f0 Ensure we don't get problems between FILE and X_FILE buffers - always use the
x_ varient of the command.

Andrew Bartlett
-
Jeremy Allison
babbbd9c65 Samba janitor: adding mbp's umask patch :-).
Jeremy.
-
Andrew Tridgell
b4c210ccb0 make sure we don't run over the end of 'name' in unix_convert()
Thanks to Andrew Bartlett for spotting this.
-
Andrew Bartlett
8f495e8634 Bitmap offsets and counts are always positive. -
Andrew Bartlett
34b2e558a4 Always escape ldap filter strings. Escaping code was from pam_ldap, but I'm to
blame for the realloc() stuff.

Plus a couple of minor updates to libads.

Andrew Bartlett
-