1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-05 20:58:40 +03:00

2103 Commits

Author SHA1 Message Date
Andrew Tridgell
fec3288ad6 r2632: a new approach to handling const errors. We have had huge numbers of
const warnings for a long time, and no real way to approach a
solution. Some of them are unavoidable due to the way the C standard
works (for example, any function that provides strchr() like
functionality _must_ produce a const warning)

I will be converting a bunch of places that currently produce const
warnings to use the discard_const_p(). Some of these will be
unavoidable const problems, some of them will be ones we will fix up
over time. At least this change means we will no longer be swamped
with const warnings, and we will easily be able to see when new
problems emerge.
2007-10-10 12:59:14 -05:00
Andrew Tridgell
2a7e5f0708 r2631: the strchr family of functions should not return const strings. 2007-10-10 12:59:14 -05:00
Andrew Tridgell
7124949140 r2630: I missed a couple of places in the gensec talloc conversion 2007-10-10 12:59:14 -05:00
Andrew Tridgell
f12ee2f241 r2629: convert gensec to the new talloc model
by making our gensec structures a talloc child of the open connection
we can be sure that it will be destroyed when the connection is
dropped.
2007-10-10 12:59:14 -05:00
Andrew Tridgell
26da45a801 r2628: got rid of some warnings and converted a few more places to use hierarchical memory allocation 2007-10-10 12:59:14 -05:00
Andrew Tridgell
76d0b8206c r2627: use the new talloc capabilities in a bunch more places in the rpc
server code. This fixes a number of memory leaks I found when testing
with valgrind and smbtorture, as the cascading effect of a
talloc_free() ensures that anything derived from the top level object
is destroyed on disconnect.
2007-10-10 12:59:13 -05:00
Andrew Tridgell
458f853288 r2626: the symbol gai_error is defined in /usr/include, so don't use that name in our code 2007-10-10 12:59:13 -05:00
Andrew Tridgell
dabc7ddd9f r2625: use talloc_p, not talloc when possible (when allocating a structure in particular), as it gives us type checking. 2007-10-10 12:59:13 -05:00
Andrew Tridgell
e95e5c591f r2624: - save some system calls by only trying read/write operations that select has indicated are possible
- when a socket is dead, don't try to do anything more on it
2007-10-10 12:59:13 -05:00
Andrew Tridgell
c2be7b696c r2623: don't do pointer arithmetic on void*, as it doesn't work with non-GNU compilers 2007-10-10 12:59:13 -05:00
Andrew Tridgell
4cb11fb77a r2622: to implement the SOCKET_FLAG_BLOCK option in the socket library we
need to add MSG_WAITALL to the recv() flags. This is needed by the
current server code or sometimes it will fail with a receive error.
2007-10-10 12:59:13 -05:00
Andrew Tridgell
e73b4ae4e5 r2621: - now that the client code is non-blocking, we no longer need
write_data and read_data, which are inherently blocking operations

- got rid of some old NBT keepalive routines that are not needed
2007-10-10 12:59:12 -05:00
Andrew Tridgell
3f7741f178 r2618: before we had refererence counts in talloc I added a hack in the
server side request structure to prevent a structing being freed in
some circumstances. This change replaces this with the much more
robust mechanism of talloc_increase_ref_count().
2007-10-10 12:59:12 -05:00
Andrew Tridgell
01a759b627 r2617: add connect testing to the rpc test suite 2007-10-10 12:59:12 -05:00
Andrew Tridgell
28a647f681 r2616: the cascading nature of talloc_free() can lead to some surprises. In
this case the bug was that server_terminate_connection() destroys the
server context, which in turn cascades down to destroy all current
request contexts, so we musn't then try to destroy the request
structure a second time.
2007-10-10 12:59:12 -05:00
Andrew Tridgell
fee98137ad r2615: fixed a bug in the server side support for CONNECT level security 2007-10-10 12:59:12 -05:00
Andrew Tridgell
f4660857bc r2614: support CONNECT level DCE/RPC security in both client and
server. CONNECT security uses NTLMSSP, but does not do any signing or
sealing (or equivalently, its like signing, but with a zero filled
checksum).
2007-10-10 12:59:12 -05:00
Andrew Tridgell
ed87b7fcbd r2613: use a talloc destructor to ensure that file descriptors are not leaked
on abnormal termination of a connection. As long as the top level
connection structure is freed then that should cascade down to the
file structure, and call this destructor which will close the open file descriptor.

In general I'd like to use this technique in any place in Samba4 where
we hold operating system resources that we need to make sure are
released on abnormal termination.
2007-10-10 12:59:12 -05:00
Andrew Bartlett
cdb8261775 r2612: Ensure ntlm_auth always logs to stderr.
Add missing break;

Andrew Bartlett
2007-10-10 12:59:11 -05:00
Andrew Bartlett
8f4dab5d44 r2611: Try to make Samba4's ntlm_auth more consistant with Samba 3.0.
Andrew Bartlett
2007-10-10 12:59:11 -05:00
Simo Sorce
e502b276ae r2601: avoid free()ing unallocated memory by mistake 2007-10-10 12:59:11 -05:00
Tim Potter
d7d8a7ffc6 r2597: A small program that takes SID strings on stdin and produces a marshalled
lsa_SidArray on stdout.
2007-10-10 12:59:11 -05:00
Jelmer Vernooij
fa29cecb12 r2594: Remove call to Gtk+ 2.4 specific code 2007-10-10 12:59:11 -05:00
Andrew Tridgell
640ced4530 r2593: don't crash if the server doesn't know that 0 count searches mean 1 2007-10-10 12:59:11 -05:00
Andrew Tridgell
efb2b88edd r2592: this fixes one of the security memory leaks in the server 2007-10-10 12:59:10 -05:00
Andrew Tridgell
1730882b9d r2591: fixed two errors in simple backend found with valgrind 2007-10-10 12:59:10 -05:00
Andrew Tridgell
9e1eb58e4b r2590: fixed one of the server security memory leaks. There are more :( 2007-10-10 12:59:10 -05:00
Andrew Tridgell
7b23624a0f r2589: a simple test to help find security related memory leaks. Run valgrind on smbd with
--show-leak=yes and --show-reachable=yes to track them down.
2007-10-10 12:59:09 -05:00
Andrew Tridgell
ee51eefe17 r2588: connect/disconnect is common enough that I don't think a level 0 DEBUG
is warranted to warn that it has happened :)
2007-10-10 12:59:08 -05:00
Andrew Tridgell
5b967c1cbb r2587: fixed a couple of authentication memory leaks. There are more to be
fixed - I'll commit a little test suite soon.
2007-10-10 12:59:08 -05:00
Andrew Tridgell
be20b3164c r2586: updated the nbench example in the README to reflect the new chaining syntax 2007-10-10 12:59:07 -05:00
Andrew Tridgell
01288e82bc r2583: mkproto.pl now treats "int main" as a special case and avoids it. 2007-10-10 12:59:07 -05:00
Tim Potter
daad76207d r2582: Merge checks for xattr and acl libraries from Samba3 so the {get,set}ntacl
programs can build on non-xattr machines.
2007-10-10 12:59:07 -05:00
Andrew Tridgell
058b2fd99e r2581: added "hosts allow" and "hosts deny" checking in smbd. I needed this
as my box keeps getting hit by viruses spreading on my companies
internal network, which screws up my debug log badly (sigh).

metze, I'm not sure if you think access.c should go in the socket
library or not. It is closely tied to the socket functions, but you
may prefer it separate.

The access.c code is a port from Samba3, but with some cleanups to
make it (slighly) less ugly.
2007-10-10 12:59:07 -05:00
Andrew Tridgell
0806378b0e r2580: fixed an uninitialised byte found by valgrind 2007-10-10 12:59:07 -05:00
Andrew Tridgell
663b7b75dd r2577: - I recently found out that charaters below 0x3F are guaranteed not to
occur as secondary bytes in any multi-byte character set. This
  allows for a very simple optimisation in strchr_m() and
  strrchr_m(). It might be a good idea to pick this up for Samba3.

- the horrible toktocliplist() is only used in clitar.c, so move it
  there, to prevent anyone else from being tempted to use it.
2007-10-10 12:59:07 -05:00
Tim Potter
5b88226f90 r2576: Some userspace tools for getting and setting ntacls via the 'security.ntacl'
extended attribute.
2007-10-10 12:59:07 -05:00
Andrew Tridgell
d92ad9f307 r2573: - added a configure test for nanosecond time resolution in struct stat
(recently Linux systems support this, allowing us to support the
  full resolution in NTTIME)

- use nanosecond resolution in the posix backend if available

- moved the configure tests and list of object files for the posix
  backend into ntvfs/posix/ to keep them more neatlly separated.
2007-10-10 12:59:06 -05:00
Andrew Tridgell
4103392a59 r2572: fixed two places where status is not initialised in the nbench backend 2007-10-10 12:59:06 -05:00
Andrew Tridgell
8d455a6f09 r2562: got rid of the "reference" backend that never happened - the code is
too stale to be of any use as a reference.
2007-10-10 12:59:06 -05:00
Andrew Tridgell
f84c0af35c r2561: completely redid the ntvfs module chaining code, You can now do something like:
ntvfs handler = nbench posix

and the nbench pass-thru module will be called before the posix
module. The chaining logic is now much saner, and less racy, with each
level in the chain getting its own private pointer rather than relying
on save/restore logic in the pass-thru module.

The only pass-thru module we have at the moment is the nbench one
(which records all traffic in a nbench compatibe format), but I plan
on soon writing a "unixuid" pass-thru module that will implement the
setegid()/setgroups()/seteuid() logic for standard posix uid
handling. This separation of the posix backend from the uid handling
should simplify the code, and make development easier.

I also modified the nbench module so it can do multiple chaining, so
if you want to you can do:

   ntvfs module = nbench nbench posix

and it will save 2 copies of the log file in /tmp. This is really only
useful for testing at the moment until we have more than one pass-thru
module.
2007-10-10 12:59:06 -05:00
Tim Potter
3170f6ed84 r2560: Don't require structure fields that have the pidl value() property
to be set.  They can be if you want, but will be overwritten by the
pidl push code.
2007-10-10 12:59:06 -05:00
Tim Potter
e9eb231d64 r2559: Python ints can't hold the full range of uint32 values so store them
as Python longs.

Also allow shorter width integer types to be initialised from long values.
Their values are truncated if they are too long.
2007-10-10 12:59:06 -05:00
Andrew Tridgell
03c38477ad r2556: fixed the -s one bug that jelmer pointed out 2007-10-10 12:59:06 -05:00
Tim Potter
c9d6827312 r2555: Start of a rpcclient type program. 2007-10-10 12:59:05 -05:00
Andrew Tridgell
74d7bc1948 r2554: added a test for a bug that jelmer pointed out (handling of -s one) 2007-10-10 12:59:05 -05:00
Andrew Tridgell
9f230425a0 r2553: fixed ldbtest so it passes the ldap schema restrictions and thus can be used on the ldap backend 2007-10-10 12:59:05 -05:00
Andrew Bartlett
dfecb01506 r2552: Character set conversion and string handling updates.
The intial motivation for this commit was to merge in some of the
bugfixes present in Samba3's chrcnv and string handling code into
Samba4.  However, along the way I found a lot of unused functions, and
decided to do a bit more...

The strlen_m code now does not use a fixed buffer, but more work is
needed to finish off other functions in str_util.c.  These fixed
length buffers hav caused very nasty, hard to chase down bugs at some
sites.

The strupper_m() function has a strupper_talloc() to replace it (we
need to go around and fix more uses, but it's a start).  Use of these
new functions will avoid bugs where the upper or lowercase version of
a string is a different length.

I have removed the push_*_allocate functions, which are replaced by
calls to push_*_talloc.  Likewise, pstring and other 'fixed length'
wrappers are removed, where possible.

I have removed the first ('base pointer') argument, used by push_ucs2,
as the Samba4 way of doing things ensures that this is always on an
even boundary anyway.  (It was used in only one place, in any case).
2007-10-10 12:59:05 -05:00
Andrew Bartlett
066789a479 r2551: Add const.
Andrew Bartlett
2007-10-10 12:59:05 -05:00
Andrew Bartlett
a132082249 r2550: survive our own BASE-NEGNOWAIT torture test.
Andrew Bartlett
2007-10-10 12:59:05 -05:00