1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-28 17:47:29 +03:00

509 Commits

Author SHA1 Message Date
Jeremy Allison
1f38b9963c Fix coverity CID: 594. Resource leak on error path.
Jeremy.
2008-08-14 11:22:47 +02:00
Volker Lendecke
9abc9dc4dc Refactoring: Change calling conventions for cli_rpc_pipe_open_noauth
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS
2008-07-20 17:37:11 +02:00
Jeremy Allison
fc2178b047 Canonicalize servername in the printer functions to remove leading '\\' characters. Ensure we always return consistent names.
Jeremy.
2008-07-02 16:11:59 -07:00
Volker Lendecke
9fe09398b7 Fix a file descriptor leak in add_port_hook
This was probably cut&paste from add_printer_hook which further down has the
unconditional close(fd). In add_port_hook() we're not interested in the output
of 'addport command', so don't create the out fd.
(cherry picked from commit 0c5ca2127ac6e3c71e369242376d27429c3aee5e)
2008-06-28 16:10:50 +02:00
Volker Lendecke
8e7effd58f Fix valgrind errors in _spoolss_addprinterdriver
Jerry, this was dropped as part of your SVN r15309 (037f9f83). Can you please
check?

Thanks,

Volker
(cherry picked from commit 5aa2411f0b3720b790439359a2dadb23008e936e)
2008-06-26 16:55:48 +02:00
Volker Lendecke
fd43059b3d Change print_access_check to take auth_serversupplied_info instead of current_user
Reason: This is the main user of p->current_user which I would like to remove
2008-06-26 13:13:23 +02:00
Volker Lendecke
64a4dfaa82 Remove "conn" from pipes_struct
For spoolss, we need the client's IP address
2008-06-24 10:31:36 +02:00
Volker Lendecke
17b0db20d2 Remove the reference to current_user_info from share_access.c
This required to pass around the domain a bit
2008-05-25 11:43:57 +02:00
Volker Lendecke
64d21f3963 Fix a memleak in construct_printer_info_7()
Also fix a "ignoring asprintf result" warning
2008-05-06 15:08:30 +02:00
Jeremy Allison
3fc1ab210b The first of Martin Zielinski <mz@seh.de> Vista printing patches.
Jerry will test and should get into 3.2 final (and the next 3.0.x
release).
Jeremy.
2008-04-24 14:04:47 -07:00
Volker Lendecke
c56e1c08ce Introduce rpc_pipe_np_smb_conn()
This abstracts away all references to rpc_pipe_client->cli, the only reference
is now in cli_pipe.c.
2008-04-20 14:08:16 +02:00
Volker Lendecke
7331c4c278 Remove a redundant reference to rpc_pipe_state->cli from srv_spoolss
This assignment is done in cli_rpc_pipe_open called from
cli_rpc_pipe_open_noauth already.
2008-04-20 14:08:16 +02:00
Jeremy Allison
92d9f20852 Fix bug #5372. With a large CUPS installation with a remote server, contacting
the server when searching for a name for the location and comment fields can
take so much time the client times out. When searching for a name we don't
use these fields anyway, so add a function get_a_printer_search() which
doesn't contact the CUPS server.
Jeremy.
2008-04-04 11:14:09 -07:00
Marc VanHeyningen
3fc85d2259 Coverity fixes 2008-03-17 20:52:25 +01:00
Volker Lendecke
bb35e794ec Replace sid_string_static by sid_string_dbg in DEBUGs 2007-12-15 22:09:36 +01:00
Jeremy Allison
bb8c044d42 Fix return values for invalid printers. Found by kblin
spoolss test.
Jeremy.
2007-12-10 12:11:45 -08:00
Jeremy Allison
ba9e2be2b5 Remove the explicit TALLOC_CTX * from cli_struct.
Make us very explicit about how long a talloc ctx
should last.
Jeremy.
2007-11-29 13:24:54 -08:00
Jeremy Allison
b5a2a1e3f8 Remove pstring from srv_spoolss_nt.c. All gone from rpc_server/*.c
Jeremy.
2007-11-27 19:05:08 -08:00
Jeremy Allison
6a556fd73a Fix old cut-and-paste bug where the wrong field was being written to.
Jerry please check.
Jeremy.
2007-11-27 17:50:39 -08:00
Jeremy Allison
3052172d2b Whitespace cleanup.
Jeremy.
2007-11-27 17:48:59 -08:00
Volker Lendecke
1fab16ffb8 Remove some statics 2007-11-27 14:18:47 +01:00
Jeremy Allison
2a0173743d Remove more fstring/pstring bad useage. Go talloc !
Jeremy.
2007-11-08 17:25:45 -08:00
Jeremy Allison
98e154c312 This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
2007-10-24 14:16:54 -07:00
Jeremy Allison
f35a266b3c RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
2007-10-18 17:40:25 -07:00
Jeremy Allison
3f6bd0e1ec Add start of IPv6 implementation. Currently most of this is avoiding
IPv6 in winbindd, but moves most of the socket functions that were
wrongly in lib/util.c into lib/util_sock.c and provides generic
IPv4/6 independent versions of most things. Still lots of work
to do, but now I can see how I'll fix the access check code.
Nasty part that remains is the name resolution code which is
used to returning arrays of in_addr structs.
Jeremy.
2007-10-10 18:25:16 -07:00
Gerald (Jerry) Carter
5c6c8e1fe9 [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. 2007-10-10 15:34:30 -05:00
Volker Lendecke
0141e64ad4 r25534: Apply some const
Why? It moves these structs from the data into the text segment, so they
will never been copy-on-write copied. Not much, but as in German you say
"Kleinvieh macht auch Mist...."
2007-10-10 12:31:12 -05:00
Michael Adam
9a28be220d r25294: Tidy up callers of unistr2_to_ascii() to pass sizeof(target_area) to
the maxeln parameter instead of sizeof(target_area) - 1 (or even
sizeof(fstring) - 1 in some places.

I hope these were really all there were.

Michael
2007-10-10 12:30:58 -05:00
Volker Lendecke
6585ea2cb7 r24809: Consolidate the use of temporary talloc contexts.
This adds the two functions talloc_stackframe() and talloc_tos().

 * When a new talloc stackframe is allocated with talloc_stackframe(), then
 * the TALLOC_CTX returned with talloc_tos() is reset to that new
 * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse
 * happens: The previous talloc_tos() is restored.
 *
 * This API is designed to be robust in the sense that if someone forgets to
 * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and
 * resets the talloc_tos().

The original motivation for this patch was to get rid of the
sid_string_static & friends buffers. Explicitly passing talloc context
everywhere clutters code too much for my taste, so an implicit
talloc_tos() is introduced here. Many of these static buffers are
replaced by a single static pointer.

The intended use would thus be that low-level functions can rather
freely push stuff to talloc_tos, the upper layers clean up by freeing
the stackframe. The more of these stackframes are used and correctly
freed the more exact the memory cleanup happens.

This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and
lp_talloc_ctx (did I forget any?)

So, never do a

tmp_ctx = talloc_init("foo");

anymore, instead, use

tmp_ctx = talloc_stackframe()

:-)

Volker
2007-10-10 12:30:24 -05:00
Volker Lendecke
db1b89072c r24316: Fix an uninitialized read
Jerry, please check this!

Thanks,

Volker
2007-10-10 12:29:27 -05:00
Andrew Tridgell
87c91e4362 r23801: The FSF has moved around a lot. This fixes their Mass Ave address. 2007-10-10 12:28:27 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Volker Lendecke
4d9f627cc8 r23758: Fix Coverity id 385 2007-10-10 12:23:53 -05:00
Volker Lendecke
eaefd00563 r23055: Rewrite messages.c to use auto-generated marshalling in the tdb. I'm
doing this because for the clustering the marshalling is needed in more
than one place, so I wanted a decent routine to marshall a message_rec
struct which was not there before.

Tridge, this seems about the same speed as it used to be before, the
librpc/ndr overhead in my tests was under the noise.

Volker
2007-10-10 12:22:17 -05:00
Volker Lendecke
a8082a3c7c r23015: Make message_(de)register static to messages.c 2007-10-10 12:22:15 -05:00
Volker Lendecke
9b8df24107 r22954: More messaging_register 2007-10-10 12:22:11 -05:00
Volker Lendecke
cc92ce665d r22911: Pass a messaging_context to message_send_all 2007-10-10 12:22:07 -05:00
Volker Lendecke
c8b9827340 r22895: Convert some more calls from message_send_buf to messaging_send_buf 2007-10-10 12:22:05 -05:00
Volker Lendecke
e43e94cda1 r22761: This introduces lib/conn_tdb.c with two main functions: connections_traverse
and connections_forall. This centralizes all the routines that did individual
tdb_open("connections.tdb") and direct tdb_traverse.

Volker
2007-10-10 12:21:55 -05:00
Volker Lendecke
0ad4b1226c r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch.
This changes "struct process_id" to "struct server_id", keeping both is
just too much hassle. No functional change (I hope ;-))

Volker
2007-10-10 12:21:52 -05:00
Jeremy Allison
aef3c262b7 r22593: Finish doing the same for raw TALLOC.
Jeremy.
2007-10-10 12:19:50 -05:00
Jeremy Allison
8ad13718af r22588: Make all uses of TALLOC_MEMDUP consistent.
Jeremy.
2007-10-10 12:19:48 -05:00
Jeremy Allison
c3df5d08dd r22587: Ensure TALLOC_ZERO_ARRAY is consistent.
Jeremy.
2007-10-10 12:19:47 -05:00
Jeremy Allison
f6fa3080fe r22542: Move over to using the _strict varients of the talloc
calls. No functional changes. Looks bigger than it is :-).
Jeremy.
2007-10-10 12:19:44 -05:00
Jeremy Allison
0c8949ff5d r22062: Fix the parsing of info level 3. Flags is not a flags
field, but an offset. Fixed 64-bit display of ACLs on
printers.
Jeremy.
2007-10-10 12:19:07 -05:00
Stefan Metzmacher
3a28443079 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
fa322f0cc9 r22001: change prototype of dump_data(), so that it takes unsigned char * now,
which matches what samba4 has.

also fix all the callers to prevent compiler warnings

metze
2007-10-10 12:18:59 -05:00
Jeremy Allison
8d45f1f3b5 r21569: Fix bug reported by Martin Zielinski <mz@seh.de>
where return value was incorrectly initialized.
Jeremy.
2007-10-10 12:18:14 -05:00
Jeremy Allison
b16707a861 r21164: Fix from Martin Zielinski <mz@seh.de> for EnumprinterdataEX
on Vista.
Jeremy.
2007-10-10 12:17:45 -05:00
Jeremy Allison
0e9ad2b29f r21129: Fix from Martin Zielinski <mz@seh.de> - ensure
the hand marshalled container size is a multiple
of 4 bytes for RPC alignment.
Jeremy.
2007-10-10 12:17:41 -05:00