1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

1954 Commits

Author SHA1 Message Date
Andrew Tridgell
18104c5679 r2633: fixed some function types in the (unused) print backend
(This used to be commit e9803058ecc0b0f849aee48a077bff4e2c8feaa5)
2007-10-10 12:59:14 -05:00
Andrew Tridgell
797d80879c 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.
(This used to be commit fec3288ad6ce58e8273e3f16e88037db49ecf046)
2007-10-10 12:59:14 -05:00
Andrew Tridgell
48c97988ca r2631: the strchr family of functions should not return const strings.
(This used to be commit 2a7e5f07086ef4aebbb2be35acbf9c7c39b13c75)
2007-10-10 12:59:14 -05:00
Andrew Tridgell
a2f3527d96 r2630: I missed a couple of places in the gensec talloc conversion
(This used to be commit 7124949140141513193f41bb8491aa6a283efed7)
2007-10-10 12:59:14 -05:00
Andrew Tridgell
c5f4378361 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.
(This used to be commit f12ee2f241aab1549bc1d9ca4c35a35a1ca0d09d)
2007-10-10 12:59:14 -05:00
Andrew Tridgell
223e78990a r2628: got rid of some warnings and converted a few more places to use hierarchical memory allocation
(This used to be commit 26da45a8019a2d6c9ff2ac2a6739c7d0b42b00de)
2007-10-10 12:59:14 -05:00
Andrew Tridgell
d79c7d41da 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.
(This used to be commit 76d0b8206ce64d6ff4a192979c43dddbec726d6e)
2007-10-10 12:59:13 -05:00
Andrew Tridgell
998e8022b6 r2626: the symbol gai_error is defined in /usr/include, so don't use that name in our code
(This used to be commit 458f85328850905db8e9808d02898c69b5f9b872)
2007-10-10 12:59:13 -05:00
Andrew Tridgell
bdfc5db41d r2625: use talloc_p, not talloc when possible (when allocating a structure in particular), as it gives us type checking.
(This used to be commit dabc7ddd9f940db414d1c3c7bf3cebcd108fbf6f)
2007-10-10 12:59:13 -05:00
Andrew Tridgell
daa66ec96c 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
(This used to be commit e95e5c591fcf9c3b7fde7fbdcc1837e22195e0a8)
2007-10-10 12:59:13 -05:00
Andrew Tridgell
368802bc86 r2623: don't do pointer arithmetic on void*, as it doesn't work with non-GNU compilers
(This used to be commit c2be7b696ccb338df06a5212ed1f7b78e4c116c2)
2007-10-10 12:59:13 -05:00
Andrew Tridgell
5abd7f8f5f 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.
(This used to be commit 4cb11fb77acf74ab53bf5782a114151965c558f0)
2007-10-10 12:59:13 -05:00
Andrew Tridgell
30381686c4 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
(This used to be commit e73b4ae4e500d3b7ee57e160e0f8b63c99b2542a)
2007-10-10 12:59:12 -05:00
Andrew Tridgell
045543b661 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().
(This used to be commit 3f7741f178b359f81cc98ef18cd69bf976123e9f)
2007-10-10 12:59:12 -05:00
Andrew Tridgell
20fb9ab6cd r2617: add connect testing to the rpc test suite
(This used to be commit 01a759b62775b447eeb2ad447b12d104caa9bfb4)
2007-10-10 12:59:12 -05:00
Andrew Tridgell
69d170e723 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.
(This used to be commit 28a647f681e2166c01f7ac59b16305676d5caa71)
2007-10-10 12:59:12 -05:00
Andrew Tridgell
e3e3e4577b r2615: fixed a bug in the server side support for CONNECT level security
(This used to be commit fee98137ad6358195b80c97cd6cc8f82ac53f870)
2007-10-10 12:59:12 -05:00
Andrew Tridgell
642ba4bfee 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).
(This used to be commit f4660857bc708db7f5aa7487bf7ab04bffe68928)
2007-10-10 12:59:12 -05:00
Andrew Tridgell
4fa2904290 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.
(This used to be commit ed87b7fcbd9fedc155528ce6dd8ab5d5fce637b2)
2007-10-10 12:59:12 -05:00
Andrew Bartlett
cf938f14a2 r2612: Ensure ntlm_auth always logs to stderr.
Add missing break;

Andrew Bartlett
(This used to be commit cdb8261775a3100e1b95b485d91ba1f94c879905)
2007-10-10 12:59:11 -05:00
Andrew Bartlett
bfd924725e r2611: Try to make Samba4's ntlm_auth more consistant with Samba 3.0.
Andrew Bartlett
(This used to be commit 8f4dab5d44480b40fc14afc70172861c229ba77d)
2007-10-10 12:59:11 -05:00
Simo Sorce
567ed4e718 r2601: avoid free()ing unallocated memory by mistake
(This used to be commit e502b276ae5e4e22e31a522c4d9e346996d6e29f)
2007-10-10 12:59:11 -05:00
Tim Potter
df99e4bb37 r2597: A small program that takes SID strings on stdin and produces a marshalled
lsa_SidArray on stdout.
(This used to be commit d7d8a7ffc66cf6f78f11e8aed975d746c7a520a3)
2007-10-10 12:59:11 -05:00
Jelmer Vernooij
9dd6674a6c r2594: Remove call to Gtk+ 2.4 specific code
(This used to be commit fa29cecb12def7f5c74dbcd9a525a858323e6327)
2007-10-10 12:59:11 -05:00
Andrew Tridgell
82b61938ac r2593: don't crash if the server doesn't know that 0 count searches mean 1
(This used to be commit 640ced453092a5c5f3ffe7ee0fe4be804a4ced14)
2007-10-10 12:59:11 -05:00
Andrew Tridgell
1954070a7e r2592: this fixes one of the security memory leaks in the server
(This used to be commit efb2b88edddef94ecbaa9a871d457d0d7c177546)
2007-10-10 12:59:10 -05:00
Andrew Tridgell
4f2058175e r2591: fixed two errors in simple backend found with valgrind
(This used to be commit 1730882b9d2ecff1b65e5fc85961edb300a9ce17)
2007-10-10 12:59:10 -05:00
Andrew Tridgell
7358fb62b8 r2590: fixed one of the server security memory leaks. There are more :(
(This used to be commit 9e1eb58e4b332e4a300e8b546a5d39bd2f7cd7a6)
2007-10-10 12:59:10 -05:00
Andrew Tridgell
8e5acb6df0 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.
(This used to be commit 7b23624a0f50c29346e8b1c4057f1c21f3be6d5a)
2007-10-10 12:59:09 -05:00
Andrew Tridgell
3e54089bc1 r2588: connect/disconnect is common enough that I don't think a level 0 DEBUG
is warranted to warn that it has happened :)
(This used to be commit ee51eefe17576496dfd091ed7e7783caff574090)
2007-10-10 12:59:08 -05:00
Andrew Tridgell
f5db8edc97 r2587: fixed a couple of authentication memory leaks. There are more to be
fixed - I'll commit a little test suite soon.
(This used to be commit 5b967c1cbb9831f7f2c6c6187f9e8e6dcc284497)
2007-10-10 12:59:08 -05:00
Andrew Tridgell
a1ed65e8ed r2586: updated the nbench example in the README to reflect the new chaining syntax
(This used to be commit be20b3164cfe1d5c228072722cb6e5894fdacb23)
2007-10-10 12:59:07 -05:00
Andrew Tridgell
78d9f3f8a7 r2583: mkproto.pl now treats "int main" as a special case and avoids it.
(This used to be commit 01288e82bc39af66d5e47db19691c741555e999a)
2007-10-10 12:59:07 -05:00
Tim Potter
00e05a0b8b r2582: Merge checks for xattr and acl libraries from Samba3 so the {get,set}ntacl
programs can build on non-xattr machines.
(This used to be commit daad76207dbb4060c231a58c99970e837e1e858f)
2007-10-10 12:59:07 -05:00
Andrew Tridgell
fe45888e22 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.
(This used to be commit 058b2fd99e3957d7d2a9544fd27071f1122eab68)
2007-10-10 12:59:07 -05:00
Andrew Tridgell
5d4fc1284e r2580: fixed an uninitialised byte found by valgrind
(This used to be commit 0806378b0e34ba3d665a9db739539819f3f52054)
2007-10-10 12:59:07 -05:00
Andrew Tridgell
5c94fcab92 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.
(This used to be commit 663b7b75ddd838ce547425b07d7ce4d4606fb479)
2007-10-10 12:59:07 -05:00
Tim Potter
1cf7a3420e r2576: Some userspace tools for getting and setting ntacls via the 'security.ntacl'
extended attribute.
(This used to be commit 5b88226f9002711baac73e66d04ecf92b7765809)
2007-10-10 12:59:07 -05:00
Andrew Tridgell
cb0cd473a0 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.
(This used to be commit d92ad9f307fe16a3b253a0555b437f14c94b4dd7)
2007-10-10 12:59:06 -05:00
Andrew Tridgell
9c89a30113 r2572: fixed two places where status is not initialised in the nbench backend
(This used to be commit 4103392a597349890e0e7ea1c41d5b0ab3816853)
2007-10-10 12:59:06 -05:00
Andrew Tridgell
5401105ddf r2562: got rid of the "reference" backend that never happened - the code is
too stale to be of any use as a reference.
(This used to be commit 8d455a6f091d7aa528e86ae3b3712170b5fc6c2c)
2007-10-10 12:59:06 -05:00
Andrew Tridgell
a3cec511bb 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.
(This used to be commit f84c0af35cb54c8fdc4933afefc18fa4c062aae4)
2007-10-10 12:59:06 -05:00
Tim Potter
5821c39553 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.
(This used to be commit 3170f6ed84e0514bf18d2a346f153bf0231b245b)
2007-10-10 12:59:06 -05:00
Tim Potter
46cbe76a2c 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.
(This used to be commit e9eb231d6441774d1b5227962bbe94aa29e20995)
2007-10-10 12:59:06 -05:00
Andrew Tridgell
54d33d5674 r2556: fixed the -s one bug that jelmer pointed out
(This used to be commit 03c38477add0c5f78072700615b2c1513cbc7663)
2007-10-10 12:59:06 -05:00
Tim Potter
169627d7f5 r2555: Start of a rpcclient type program.
(This used to be commit c9d682731226b7ef222f588c43df5a1f62c21555)
2007-10-10 12:59:05 -05:00
Andrew Tridgell
9fbd16921a r2554: added a test for a bug that jelmer pointed out (handling of -s one)
(This used to be commit 74d7bc1948961a24837d966416db12be192382ff)
2007-10-10 12:59:05 -05:00
Andrew Tridgell
e4cd51e17e r2553: fixed ldbtest so it passes the ldap schema restrictions and thus can be used on the ldap backend
(This used to be commit 9f230425a0c926209887006ab1e3fec0998e7961)
2007-10-10 12:59:05 -05:00
Andrew Bartlett
9a9dcc7250 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).
(This used to be commit dfecb0150627b500cb026b8a4932fe87902ca392)
2007-10-10 12:59:05 -05:00
Andrew Bartlett
70c88af1f9 r2551: Add const.
Andrew Bartlett
(This used to be commit 066789a479ed7b36041e3455caac01e5c9244dc0)
2007-10-10 12:59:05 -05:00