1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-07 01:58:28 +03:00

1546 Commits

Author SHA1 Message Date
Gerald Carter
0dc6115694 fix CIDR hosts allow/deny notation -
Jelmer Vernooij
b49436d020 Use SAFE_FREE() instead of plain free() - pointed out by metze -
Jelmer Vernooij
bf439d733d Output backtrace to logfile in smb_panic(), as suggested by mbp
(only on systems that support it, of course)
-
Jelmer Vernooij
37ee8aecf4 We need to 'preprocess' in popt_common_samba as well -
Jelmer Vernooij
d5f9b0275c Revoke some of the popt patch from metze I applied earlier today. It added
some double options and broke some parameters.
-
Jelmer Vernooij
cf3d31b980 Add modules support to charset -
Jelmer Vernooij
2ddfed298d Patch from metze to generalise POPT_COMMON_SAMBA, with some minor changes -
Andrew Bartlett
dcdc75ebd8 NTLM Authentication:
- Add a 'privileged' mode to Winbindd.  This is achieved by means of a directory
  under lockdir, that the admin can change the group access for.

- This mode is now required to access with 'CRAP' authentication feature.
- This *will* break the current SQUID helper, so I've fixed up our ntlm_auth
  replacement:
 - Update our NTLMSSP code to cope with 'datagram' mode, where we don't get a
   challenge.
 - Use this to make our ntlm_auth utility suitable for use in current Squid 2.5
   servers.
 - Tested - works for Win2k clients, but not Win9X at present.  NTLMSSP updates
   are needed.
 - Now uses fgets(), not x_fgets() to cope with Squid environment (I think
   somthing to do with non-blocking stdin).

- Add much more robust connection code to wb_common.c - it will not connect to
  a server of a different protocol version, and it will automatically try and
  reconnect to the 'privileged' pipe if possible.
  - This could help with 'privileged' idmap operations etc in future.

- Add a generic HEX encode routine to util_str.c,
- fix a small line of dodgy C in StrnCpy_fn()

- Correctly pull our 'session key' out of the info3 from th the DC.  This is
  used in both the auth code, and in for export over the winbind pipe to
  ntlm_auth.

- Given the user's challenge/response and access to the privileged pipe,
  allow external access to the 'session key'.  To be used for MSCHAPv2
  integration.

Andrew Bartlett
-
Jelmer Vernooij
eeeeb37fc6 Use True, not TRUE -
Jelmer Vernooij
b18d02891b Don't crash when initialising tdb fails -
Jelmer Vernooij
5a88d78f67 Add -U, -N, -i, -A, -W to popt. -
Jelmer Vernooij
e149e70717 - Use FUNCTION_MACRO, not __FUNCTION__.
- Add some const
-
Andrew Bartlett
fb680f610c Valgrind found a few memory leaks!
Andrew Bartlett
-
Andrew Bartlett
a7eba37aad Small clenaup patches:
- safe_string.h - don't assume that __FUNCTION__ is available
 - process.c - use new workaround from safe_string.h for the same
 - util.c - Show how many bytes we smb_panic()ed trying to smb_xmalloc()
 - gencache.c - Keep valgrind quiet by always null terminating.
 - clistr.c - Add copyright
 - srvstr.h - move srvstr_push into a .c file again, as a real function.
 - srvstr.c - revive, with 'safe' checked srvstr_push
 - loadparm.c - set a default for the display charset.

Andrew Bartlett
-
Jelmer Vernooij
ca066502a2 Patch from Samuel Thibault to convert messages from unix to dos charset. Works
on 2000.
sending messages to 9x needs to be fixed, but that didn't work anyway
-
Jeremy Allison
dee1326a1d lib/messages.c: Check return from chainlock before modifying message queue.
Apply the job returned limit across all requests for job queues.
Jeremy.
-
Tim Potter
45929d1269 Cleanup bogus initialisation in SID_NAME_USE enum.
Added new sid type = 9 for "computer" from MSDN.
-
Jim McDonough
1960a650c1 use strnlen to prevent coredumps -
Jelmer Vernooij
af7bfee0c6 Put in the new modules system. It's now used by passdb and rpc. I will
put a doc about it in dev-doc later today.
-
Martin Pool
f7f692b2db Step one of optimizations for StrCaseCmp:
First of all, do a char-by-char walk through both buffers until we get
to a non-ascii character, or a difference between the strings.  This
prefix can be directly compared without needing to call into iconv.
This should be much faster for strings that are either all ascii, or
differ near the start.
-
Martin Pool
4bbddbfc6a Split "clobber" function and variables into its own file before it
grows too much larger.
-
Martin Pool
412a8780c3 Update comment: Valgrind 1.9.4 seems to always respect client
requests, without needing --client-perms=yes.
-
Martin Pool
5653a42ae6 global_globber_region_function/line ought to be recorded before
clobbering the region, just in case clobbering causes us to crash
immediately.  (That might happen if we just shot ourselves in the
stack and strcpy was not inlined.)

Also, in DEVELOPER mode and when Valgrind is available, mark the
clobbered region as uninitialized.  This is an even stronger
protection than clobbering with 0xf1.
-
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
-