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

1632 Commits

Author SHA1 Message Date
cvs2svn Import User
74d3be0218 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to be commit f0d009c3e9) 2003-03-18 07:09:24 +00:00
Martin Pool
a084f06fe3 Split "clobber" function and variables into its own file before it
grows too much larger.
(This used to be commit 4bbddbfc6a)
2003-03-18 07:09:23 +00:00
Martin Pool
556fea4e1e Update comment: Valgrind 1.9.4 seems to always respect client
requests, without needing --client-perms=yes.
(This used to be commit 412a8780c3)
2003-03-18 05:30:15 +00:00
Martin Pool
eb83748940 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.
(This used to be commit 5653a42ae6)
2003-03-18 05:00:02 +00:00
Jeremy Allison
d332200c25 Merge in the developer string options from HEAD. We need to ensure 3.0
is as stable as possible in the string department and some pain now
will help later :-).
Jeremy.
(This used to be commit 86e3eddac6)
2003-03-18 01:48:11 +00:00
Andrew Bartlett
a8eaea53ed Merge from HEAD - make winbindd locking sane again:
Original message:


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
(This used to be commit b5283c00a9)
2003-03-17 23:06:12 +00:00
Andrew Bartlett
ad0d6509a7 Merge from HEAD:
- Make ReadDirName return a const char*.

 - Consequential changes from that

 - mark our fstring/pstring assumptions in function prototypes

Andrew Bartlett
(This used to be commit 10b53d7c6f)
2003-03-17 22:56:13 +00:00
Andrew Bartlett
45d3e78547 Mege from HEAD - doxygen.
(This used to be commit 04a5cbc896)
2003-03-17 22:42:56 +00:00
Andrew Bartlett
467f1028f4 Merge from (earlier) HEAD - doxygen.
I'm not merging the current HEAD string stuff quite yet.
(This used to be commit 9b8d12e081)
2003-03-17 22:42:01 +00:00
Andrew Bartlett
400bb4bfab - Make ReadDirName return a const char*.
- Consequential changes from that

 - mark our fstring/pstring assumptions in function prototypes

Andrew Bartlett
(This used to be commit fe2bc64bc4)
2003-03-16 13:21:12 +00:00
Andrew Bartlett
f1d333ea35 Remove an unused function and fix the build.
Andrew Bartlett
(This used to be commit 67a0319d26)
2003-03-15 08:03:11 +00:00
Andrew Bartlett
3b5bc93e9d 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
(This used to be commit 31f4827acc)
2003-03-15 07:14:55 +00:00
Gerald Carter
7ae555c43c fix WinXP & Win2K3 remote_arch and check pointer in ntlmssp code before dereferencing
(This used to be commit 2487480228)
2003-03-14 23:11:19 +00:00
Gerald Carter
128e7edaaf fix WinXP & Win2K3 remote_arch and check pointer in ntlmssp code before dereferencing
(This used to be commit 7bc5fc729f)
2003-03-14 23:06:06 +00:00
Gerald Carter
fd56ede2b6 adding some initiaial code to sert %a to Win2K3 (using Native LanMan string from .NET RC2)
(This used to be commit e074cab810)
2003-03-12 15:41:39 +00:00
Gerald Carter
c992f66d73 adding some initiaial code to sert %a to Win2K3 (using Native LanMan string from .NET RC2)
(This used to be commit 4c823e61d1)
2003-03-12 15:40:43 +00:00
Andrew Bartlett
f4a8417d6f Add const
(This used to be commit 147a0c8b13)
2003-03-12 11:00:02 +00:00
Andrew Bartlett
3b580ff000 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
(This used to be commit 0620320002)
2003-03-11 11:28:59 +00:00
Martin Pool
2e01ef5957 Remove valgrind_strlen function, hopefully no longer needed with
recent Valgrind relases and clashing with -DVALGRIND.
(This used to be commit 98479f1315)
2003-03-11 07:25:48 +00:00
Martin Pool
de6b39d898 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.
(This used to be commit 8d915e266c)
2003-03-10 01:10:45 +00:00
Andrew Bartlett
8ccff3e995 This is C, not C++
(This used to be commit 25d210b90b)
2003-03-08 23:39:44 +00:00
Andrew Bartlett
01289b14a7 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
(This used to be commit afe5a3832f)
2003-03-08 10:22:50 +00:00
Jeremy Allison
e9f51a6e38 Patch from Michael Steffens. In his own words :
-------------------------------------------------------------------------
I think there are basically two problem:

  1. Windows clients do not always send ACEs for SMB_ACL_USER_OBJ, SMB_ACL_GROUP_OBJ,
     and SMB_ACL_OTHER.
     The function ensure_canon_entry_valid() is prepared for that, but tries
     to "guess" values from group or other permissions, respectively, otherwise
     falling back to minimum r-- for the owner. Even if the owner had full
     permissions before setting ACL. This is the problem with W2k clients.

  2. Function set_nt_acl() always chowns *before* attempting to set POSIX ACLs.
     This is ok in a take-ownership situation, but must fail if the file is
     to be given away. This is the problem with XP clients, trying to transfer
     ownership of the original file to the temp file.

The problem with NT4 clients (no ACEs are transferred to the temp file, thus
are lost after moving the temp file to the original name) is a client problem.
It simply doesn't attempt to.

I have played around with that using posic_acls.c from 3.0 merged into 2.2.
As a result I can now present two patches, one for each branch. They
basically modify:

  1. Interpret missing SMB_ACL_USER_OBJ, SMB_ACL_GROUP_OBJ, or SMB_ACL_OTHER
     as "preserve current value" instead of attempting to build one ourself.
     The original code is still in, but only as fallback in case current values
     can't be retrieved.

  2. Rearrange set_nt_acl() such that chown is only done before setting
     ACLs if there is either no change of owning user, or change of owning
     user is towards the current user. Otherwise chown is done after setting
     ACLs.

It now seems to produce reasonable results. (Well, as far as it can. If
NT4 doesn't even try to transfer ACEs, only deliberate use of named default
ACEs and/or "force group" or the crystal ball can help :)
-------------------------------------------------------------------------
Jeremy.
(This used to be commit 1d3b8c528b)
2003-03-07 19:37:31 +00:00
Simo Sorce
8a751c019c Some progress towards gums and tdbsam2
genparser works fine, and it is a marvelous tool to store objects in tdb :)
(This used to be commit 4c6d461a85)
2003-03-07 18:26:24 +00:00
Jeremy Allison
f434f039e6 dlsym takes a const char *.
Jeremy.
(This used to be commit ff3827a62b)
2003-03-03 19:53:04 +00:00
Jeremy Allison
8ce11aee91 dlysym takes a const char *.
Jeremy.
(This used to be commit 54e5413a92)
2003-03-03 19:52:27 +00:00
Martin Pool
e443560789 Doxygen janitor: add note that strequal is in fact case-insensitive.
(This used to be commit a4b9c5c257)
2003-02-28 05:34:19 +00:00
Martin Pool
481b4e6d6c Doxygen janitor
(This used to be commit 9af0717315)
2003-02-28 04:21:55 +00:00
Martin Pool
f5f59e866e Doxygen janitor: fix parameter names, grammar, tag names.
(This used to be commit 42d9ec28cd)
2003-02-28 04:17:30 +00:00
Martin Pool
921e569ed5 Add a comment about the meaning of samba's internal character set and
how this interacts with it.
(This used to be commit eb876ee9cf)
2003-02-28 03:51:25 +00:00
Gerald Carter
0d30cdf66c 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.
(This used to be commit c7712fa054)
2003-02-27 21:22:36 +00:00
Gerald Carter
97e7d2ffae 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.
(This used to be commit 96570699d1)
2003-02-27 21:21:02 +00:00
Martin Pool
ff5d95f0ef Doxygen merge from head
(This used to be commit 38fa289896)
2003-02-27 05:57:21 +00:00
Martin Pool
5c82d3f00a Doxygen janitor
(This used to be commit 67bf36c69d)
2003-02-27 05:53:25 +00:00
Martin Pool
03ae31248e Merge 1.100 patch from HEAD:
init_valid_table: Fix a memory leak that would lose the
dynamically-created valid table every time the configuration was
reloaded.
(This used to be commit 3ff4845bc4)
2003-02-27 05:20:23 +00:00
Jelmer Vernooij
d21b15ff57 - Rename 'modules = ' to 'preload modules = '
- Add smb_probe_module()
- Add init_modules()
- Call these functions
(This used to be commit f8f2165322)
2003-02-27 01:54:41 +00:00
Martin Pool
f7bb698298 init_valid_table: Fix a memory leak that would lose the
dynamically-created valid table every time the configuration was
reloaded.
(This used to be commit e42b237d98)
2003-02-26 06:19:16 +00:00
Jeremy Allison
11c3fdbc51 Merge from head. Move off-by-one buggy malloc()/safe_strcpy() combination to strdup() instead.
Jeremy.
(This used to be commit 6521601bf8)
2003-02-24 19:22:54 +00:00
Andrew Bartlett
426cd68f74 Move off-by-one buggy malloc()/safe_strcpy() combination to strdup() instead.
Andrew Bartlett
(This used to be commit c26881633d)
2003-02-24 11:23:15 +00:00
Martin Pool
1a2035a8f5 Merge documentation from HEAD
(This used to be commit 3761f8ebe3)
2003-02-24 04:49:10 +00:00
Martin Pool
5b5453e6c7 Merge documentation from 3_0.
(This used to be commit 5002555a97)
2003-02-24 04:42:24 +00:00
Andrew Bartlett
266ec4aac0 Merge doxygen, signed/unsigned, const and other small fixes from HEAD to 3.0.
Andrew Bartlett
(This used to be commit 9ef0d40c3f)
2003-02-24 03:09:08 +00:00
Andrew Bartlett
d1221c9b6c Merge from HEAD client-side authentication changes:
- new kerberos code, allowing the account to change it's own password
   without special SD settings required
 - NTLMSSP client code, now seperated from cliconnect.c
 - NTLMv2 client code
 - SMB signing fixes

Andrew Bartlett
(This used to be commit 837680ca51)
2003-02-24 02:55:00 +00:00
Andrew Bartlett
e72ecdc862 Merge of server-side authentication changes to 3.0:
- user_ok() and user_in_group() now take a list of groups, instead of
   looking for the user in the members of all groups.

 - The 'server_info' returned from the authentication is now kept around
  - in future we won't copy the sesion key, username etc, we will just
    referece them directly.

 - rhosts upgraded to use the SAM if possible, otherwise fake up based on
   getpwnam().

 - auth_util code to deal with groups upgraded to deal with non-winbind domain
   members again.

Andrew Bartlett
(This used to be commit 74b5436c75)
2003-02-24 02:35:54 +00:00
Andrew Bartlett
ded88da1ea Add const
(This used to be commit ffaa608be0)
2003-02-24 02:11:32 +00:00
Andrew Bartlett
e68684aa65 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
(This used to be commit e908fd164d)
2003-02-24 01:13:31 +00:00
Martin Pool
0fc93128b8 Add comment about Samba character sets, from explanation by abartlet.
(This used to be commit 822f6c2f38)
2003-02-24 01:10:15 +00:00
Simo Sorce
bfc5f0ba8e move genparser to use talloc contexts instead of [m|c|re]alloc() and free()s
(This used to be commit 70fce680c0)
2003-02-23 17:40:43 +00:00
Andrew Bartlett
7e110f782a More signed/unsigned fixes (yes, I run with funny compiler options) and
make x_fwrite() match fwrite() in returning a size_t.

Andrew Bartlett
(This used to be commit 2943c69578)
2003-02-22 12:22:06 +00:00
Martin Pool
1fc2976e14 Doxygen janitor
(This used to be commit 3679975629)
2003-02-21 03:05:55 +00:00