1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

603 Commits

Author SHA1 Message Date
Volker Lendecke
9ff4001245 Remove "conn" from pipes_struct
For spoolss, we need the client's IP address
(This used to be commit 64a4dfaa82)
2008-06-24 10:31:36 +02:00
Volker Lendecke
320fadd8fc Remove the reference to current_user_info from share_access.c
This required to pass around the domain a bit
(This used to be commit 17b0db20d2)
2008-05-25 11:43:57 +02:00
Volker Lendecke
1409ed60e2 Fix a memleak in construct_printer_info_7()
Also fix a "ignoring asprintf result" warning
(This used to be commit 64d21f3963)
2008-05-06 15:08:30 +02:00
Jeremy Allison
189eb93b73 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.
(This used to be commit 3fc1ab210b)
2008-04-24 14:04:47 -07:00
Volker Lendecke
b9cc055062 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.
(This used to be commit c56e1c08ce)
2008-04-20 14:08:16 +02:00
Volker Lendecke
0c17878e21 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.
(This used to be commit 7331c4c278)
2008-04-20 14:08:16 +02:00
Jeremy Allison
40d16fa275 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.
(This used to be commit 92d9f20852)
2008-04-04 11:14:09 -07:00
Marc VanHeyningen
e06aa46b9f Coverity fixes
(This used to be commit 3fc85d2259)
2008-03-17 20:52:25 +01:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec)
2007-12-15 22:09:36 +01:00
Jeremy Allison
6dd89174ec Fix return values for invalid printers. Found by kblin
spoolss test.
Jeremy.
(This used to be commit bb8c044d42)
2007-12-10 12:11:45 -08:00
Jeremy Allison
d2cf97aeba Remove the explicit TALLOC_CTX * from cli_struct.
Make us very explicit about how long a talloc ctx
should last.
Jeremy.
(This used to be commit ba9e2be2b5)
2007-11-29 13:24:54 -08:00
Jeremy Allison
0bc4ff7b28 Remove pstring from srv_spoolss_nt.c. All gone from rpc_server/*.c
Jeremy.
(This used to be commit b5a2a1e3f8)
2007-11-27 19:05:08 -08:00
Jeremy Allison
93bfb6ca54 Fix old cut-and-paste bug where the wrong field was being written to.
Jerry please check.
Jeremy.
(This used to be commit 6a556fd73a)
2007-11-27 17:50:39 -08:00
Jeremy Allison
2cda3e7844 Whitespace cleanup.
Jeremy.
(This used to be commit 3052172d2b)
2007-11-27 17:48:59 -08:00
Volker Lendecke
1011b32678 Remove some statics
(This used to be commit 1fab16ffb8)
2007-11-27 14:18:47 +01:00
Jeremy Allison
d40e47db4b Remove more fstring/pstring bad useage. Go talloc !
Jeremy.
(This used to be commit 2a0173743d)
2007-11-08 17:25:45 -08:00
Jeremy Allison
f88b7a076b 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.
(This used to be commit 98e154c312)
2007-10-24 14:16:54 -07:00
Jeremy Allison
30191d1a57 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.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Jeremy Allison
8e54530b52 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.
(This used to be commit 3f6bd0e1ec)
2007-10-10 18:25:16 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Volker Lendecke
0ebab65706 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...."
(This used to be commit 0141e64ad4)
2007-10-10 12:31:12 -05:00
Michael Adam
c97fe37ea3 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
(This used to be commit 9a28be220d)
2007-10-10 12:30:58 -05:00
Volker Lendecke
929e1d9920 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
(This used to be commit 6585ea2cb7)
2007-10-10 12:30:24 -05:00
Volker Lendecke
22b30d2a37 r24316: Fix an uninitialized read
Jerry, please check this!

Thanks,

Volker
(This used to be commit db1b89072c)
2007-10-10 12:29:27 -05:00
Andrew Tridgell
153cfb9c83 r23801: The FSF has moved around a lot. This fixes their Mass Ave address.
(This used to be commit 87c91e4362)
2007-10-10 12:28:27 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
65f7a9d084 r23758: Fix Coverity id 385
(This used to be commit 4d9f627cc8)
2007-10-10 12:23:53 -05:00
Volker Lendecke
ac3f08ddbe 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
(This used to be commit eaefd00563)
2007-10-10 12:22:17 -05:00
Volker Lendecke
4d5f58c2b9 r23015: Make message_(de)register static to messages.c
(This used to be commit a8082a3c7c)
2007-10-10 12:22:15 -05:00
Volker Lendecke
e95942ed84 r22954: More messaging_register
(This used to be commit 9b8df24107)
2007-10-10 12:22:11 -05:00
Volker Lendecke
8c3f8e5697 r22911: Pass a messaging_context to message_send_all
(This used to be commit cc92ce665d)
2007-10-10 12:22:07 -05:00
Volker Lendecke
fb99bbe675 r22895: Convert some more calls from message_send_buf to messaging_send_buf
(This used to be commit c8b9827340)
2007-10-10 12:22:05 -05:00
Volker Lendecke
4aa44f7475 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
(This used to be commit e43e94cda1)
2007-10-10 12:21:55 -05:00
Volker Lendecke
e6383f4762 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
(This used to be commit 0ad4b1226c)
2007-10-10 12:21:52 -05:00
Jeremy Allison
879081236d r22593: Finish doing the same for raw TALLOC.
Jeremy.
(This used to be commit aef3c262b7)
2007-10-10 12:19:50 -05:00
Jeremy Allison
79de0ad946 r22588: Make all uses of TALLOC_MEMDUP consistent.
Jeremy.
(This used to be commit 8ad13718af)
2007-10-10 12:19:48 -05:00
Jeremy Allison
1e362c0e7f r22587: Ensure TALLOC_ZERO_ARRAY is consistent.
Jeremy.
(This used to be commit c3df5d08dd)
2007-10-10 12:19:47 -05:00
Jeremy Allison
12ba88574b r22542: Move over to using the _strict varients of the talloc
calls. No functional changes. Looks bigger than it is :-).
Jeremy.
(This used to be commit f6fa3080fe)
2007-10-10 12:19:44 -05:00
Jeremy Allison
7f8d89bc54 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.
(This used to be commit 0c8949ff5d)
2007-10-10 12:19:07 -05:00
Stefan Metzmacher
bc2b6436d0 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
(This used to be commit 3a28443079)
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
56ba447668 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
(This used to be commit fa322f0cc9)
2007-10-10 12:18:59 -05:00
Jeremy Allison
8c5846acf2 r21569: Fix bug reported by Martin Zielinski <mz@seh.de>
where return value was incorrectly initialized.
Jeremy.
(This used to be commit 8d45f1f3b5)
2007-10-10 12:18:14 -05:00
Jeremy Allison
3ad849db21 r21164: Fix from Martin Zielinski <mz@seh.de> for EnumprinterdataEX
on Vista.
Jeremy.
(This used to be commit b16707a861)
2007-10-10 12:17:45 -05:00
Jeremy Allison
d4135a3bdb r21129: Fix from Martin Zielinski <mz@seh.de> - ensure
the hand marshalled container size is a multiple
of 4 bytes for RPC alignment.
Jeremy.
(This used to be commit 0e9ad2b29f)
2007-10-10 12:17:41 -05:00
Jeremy Allison
0150bd394b r21099: Protect ourselves from null pointer deref. This isn't
the correct fix for the Vista bug, but it needed as
protection against invalid RPC. Thanks to Martin Zielinski <mz@seh.de>
for pointing this out.
Jeremy.
(This used to be commit fbab8e4ba9)
2007-10-10 12:17:37 -05:00
Volker Lendecke
caf8c6a76b r21064: The core of this patch is
void message_register(int msg_type,
                      void (*fn)(int msg_type, struct process_id pid,
-                                void *buf, size_t len))
+                                void *buf, size_t len,
+                                void *private_data),
+                     void *private_data)
 {
        struct dispatch_fns *dfn;

So this adds a (so far unused) private pointer that is passed from
message_register to the message handler. A prerequisite to implement a tiny
samba4-API compatible wrapper around our messaging system. That itself is
necessary for the Samba4 notify system.

Yes, I know, I could import the whole Samba4 messaging system, but I want to
do it step by step and I think getting notify in is more important in this
step.

Volker
(This used to be commit c8ae60ed65)
2007-10-10 12:17:32 -05:00
Volker Lendecke
9d8d4f24b1 r19156: Make enumprinters use the share iterators.
Volker
(This used to be commit 9b1759617c)
2007-10-10 12:15:18 -05:00
Volker Lendecke
e918cf3abf r19154: Trivial logic simplification: Get rid of two indentation levels. Survives the
consistency checks just checked into Samba4.

Volker
(This used to be commit c48bb4b37b)
2007-10-10 12:15:17 -05:00
Volker Lendecke
7ced2e983d r19028: Implement getprinterinfo level 6 (only the status) and get rid of snum in the
getprinter calls. Survives the RPC-SAMBA3-SPOOLSS test which I will activate
when the Samba4 build farm has picked it up.

Volker
(This used to be commit d7248b6cfa)
2007-10-10 12:15:03 -05:00
Jeremy Allison
fec9850644 r18898: Fix for bug #4100 from Udo Eberhardt <udo.eberhardt@thesycon.de>.
Ensure we initialize values for smb_io_notify_info_data_strings to
fix crash.
Jeremy.
(This used to be commit ceefb8dd3c)
2007-10-10 12:14:44 -05:00
Jelmer Vernooij
4db7642caa r18745: Use the Samba4 data structures for security descriptors and security descriptor
buffers.

Make security access masks simply a uint32 rather than a structure
with a uint32 in it.
(This used to be commit b41c52b9db)
2007-10-10 12:00:54 -05:00
Jelmer Vernooij
4e7d11449a r18654: Rename "struct uuid" => "struct GUID" for consistency.
(This used to be commit 5de76767e8)
2007-10-10 11:52:19 -05:00
Gerald Carter
5e1146ab58 r18404: * swap from POLICY_HND to the struct policy_handle from ndr/misc.h
* move OUR_HANDLE macro to include/rpc_misc.h
(This used to be commit 2b37079af2)
2007-10-10 11:51:22 -05:00
Jelmer Vernooij
995205fc60 r18188: merge 3.0-libndr branch
(This used to be commit 1115745cae)
2007-10-10 11:43:56 -05:00
Gerald Carter
22c9a3151e r17386: fix inverted logic pointed out by Volker. When deleting a printer return access denied if the printer still exists after the delete_printer_hook() is called
(This used to be commit c05e2bdc0c)
2007-10-10 11:38:30 -05:00
Volker Lendecke
430fa0eba0 r17348: Some C++ warnings
(This used to be commit ae6b9b34e5)
2007-10-10 11:38:27 -05:00
Jeremy Allison
29a4d666ba r17245: Second part of fix for #3962. Don't do a double
free in the infolevel2 case. Free both queue and
NT_PRINTER_INFO_LEVEL in the same place.
Jeremy.
(This used to be commit 6ac3a4ce78)
2007-10-10 11:38:21 -05:00
Jeremy Allison
9d4fa2b27b r17244: There were several error paths where NT_PRINTER_INFO_LEVEL
wasn't being freed - also one enum jobs case where the
NT_PRINTER_INFO_LEVEL and queue weren't being freed.
Strange that Coverity or Klokwork didn't pick these up.
Hopefully will fix #3962.
Jeremy.
(This used to be commit bb26412387)
2007-10-10 11:38:21 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Gerald Carter
1a850a4f37 r15975: Only call the printer publishing calls if 'security = ads'
(prevent a segv)
(This used to be commit a2ef525d9e)
2007-10-10 11:17:15 -05:00
Jeremy Allison
1f3fe6a504 r15334: Fix warning. This table and function not used anymore. Jerry please
check.
Jeremy.
(This used to be commit 9f676603aa)
2007-10-10 11:16:36 -05:00
Gerald Carter
d4a51cc500 r15309: normalize printing keys when deleting
(This used to be commit 037f9f831e)
2007-10-10 11:16:34 -05:00
Jeremy Allison
2178bcaa39 r14788: Fix coverity bug #276. null deref.
Jeremy.
(This used to be commit 0217f7d7bf)
2007-10-10 11:15:48 -05:00
Jeremy Allison
00fb5e431d r14786: Fix coverity #275. null deref.
Jeremy.
(This used to be commit 363d31c9ec)
2007-10-10 11:15:48 -05:00
Gerald Carter
f4a5c016e3 r14482: Fixes for spoolss code (after coverity fixes) when the
client sends a NULL RPC_BUFFER*
(This used to be commit 69f816e9f8)
2007-10-10 11:15:33 -05:00
Jeremy Allison
e6676a9a69 r14387: Try and fix the coverity issues (#53, #54) with negative
sink by ensuring all uses of rpcstr_push are consistent
with a size_t dest size arg.
Jeremy.
(This used to be commit f65d7afe19)
2007-10-10 11:15:27 -05:00
Jeremy Allison
d1684fa82e r14353: Fix coverity bugs #61 and #62. Remember to divide by
the size of the data table. Clean up the struct a little.
Jeremy.
(This used to be commit 338538410d)
2007-10-10 11:15:26 -05:00
Jeremy Allison
d72bb5627c r14303: Fix coverity #223. In a loop we were forgetting to free
resources on error exit path.
Jeremy.
(This used to be commit f71aa3ab8f)
2007-10-10 11:15:24 -05:00
Jeremy Allison
ad838bf65e r14301: Fix coverity #224. In a loop we were forgetting to free
resources on error exit path.
Jeremy.
(This used to be commit f1a5e5aefe)
2007-10-10 11:15:24 -05:00
Jeremy Allison
860015db1f r14299: Fix coverity #225. In a loop we were forgetting to free
resources on error exit path.
Jeremy.
(This used to be commit 1c0b4ed0ac)
2007-10-10 11:15:24 -05:00
Jeremy Allison
19879eba83 r14289: Fix coverity #101, resource leak on error code path.
Jeremy.
(This used to be commit d9e1d6fed0)
2007-10-10 11:15:23 -05:00
Jeremy Allison
acc651a31b r14286: Similar clarifiction fix for coverity #102.
Jeremy.
(This used to be commit f458596b0e)
2007-10-10 11:15:23 -05:00
Jeremy Allison
e4600491cf r14284: Fix coverity bug #103. Make code clearer - probably
not a real issue but this code is easier to read.
Jeremy.
(This used to be commit 6621acc68f)
2007-10-10 11:15:23 -05:00
Jeremy Allison
bb0d6f0459 r14268: Fix coverity error #204. Resource leak on error path.
Jeremy.
(This used to be commit 5f74e56b86)
2007-10-10 11:15:22 -05:00
Jeremy Allison
88dda37184 r14266: Fix coverity #205. Resource leak on error path.
Jeremy.
(This used to be commit 23d69758bb)
2007-10-10 11:15:21 -05:00
Jeremy Allison
65eb331afc r14264: Fix coverity #207. Resource leak on error path.
Jeremy.
(This used to be commit 0429b6e8c3)
2007-10-10 11:15:21 -05:00
Jeremy Allison
05b4d0b38e r14250: Fix coverity bug #107. Resource leak on error path.
Jeremy.
(This used to be commit ca96c7be77)
2007-10-10 11:15:20 -05:00
Volker Lendecke
71bf1be099 r14233: Fix Coverity bug # 206
(This used to be commit 0dc3030bce)
2007-10-10 11:15:18 -05:00
Jeremy Allison
5a1c225c18 r14178: Clarify code for Coverity #49. Ensure we know we
can't have an uninitialized *returned val.
Jeremy.
(This used to be commit e83515afd2)
2007-10-10 11:15:15 -05:00
Jeremy Allison
f7bf439030 r13994: Belt and braces - ensure RPC_BUFFER is valid.
Jeremy.
(This used to be commit d993797191)
2007-10-10 11:11:03 -05:00
Jeremy Allison
894358a8f3 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
(This used to be commit 1d710d06a2)
2007-10-10 11:10:59 -05:00
Gerald Carter
129fd6c5c6 r13878: move PORT_DATA_1 to use static sized UNICODE strings as per MSDN
(This used to be commit c803e1b2af)
2007-10-10 11:10:57 -05:00
Gerald Carter
5df58c38f3 r13829: From the "It's not pretty but it works" category
* Finish prototype of the "add port command" implementation
  Format is "addportcommand portname deviceURI"

* DeviceURI is either
  - socket://hostname:port/
  - lpr://hostname/queue
  depending on what the client sent in the request
(This used to be commit 6d74de7a67)
2007-10-10 11:10:56 -05:00
Gerald Carter
889ff32b5e r13824: * add api table for Xcv TCPMON and LOCALMON calls starting
with the "MonitorUI" call
* Fix some parsing errors

This gets us to the Add Port Wizard dialog.
(This used to be commit a444aa7f00)
2007-10-10 11:10:56 -05:00
Gerald Carter
2a7847ea37 r13821: replacing some strings with macros
(This used to be commit a34ab5c827)
2007-10-10 11:10:56 -05:00
Gerald Carter
354c24d525 r13820: * Start fleshing out the XcvDataPort() server implementation
* Add support for the "Local Port" monitor as well through this API
(This used to be commit ba9cdd88a0)
2007-10-10 11:10:55 -05:00
Gerald Carter
e33b728c7b r13815: "Into the blind world let us now descend,"
Began the poet, his face as pale as death.
"I will go first, and you will follow me."
---

Adding XcvDataPort() to the spoolss code for remotely
add ports.  The design is to allow an intuitive means
of creating a new CUPS print queue from the Windows 2000/XP
APW without hacks like specifying the deviceURI in the
location field of the printer properties dialog.

Also set 'default devmode = yes' as the new default
since it causes no harm and only is executed when you
have a NULL devmode anyways.
(This used to be commit 123e478ce5)
2007-10-10 11:10:55 -05:00
Gerald Carter
b2ae6e08da r13547: add earlier checks to deny deleting a printer driver. The previous
code relied upon file permissions alone.  Now we check that
the user is a printer administrator and that the share has not been
marked read only for that user.
(This used to be commit 117d9fd9e1)
2007-10-10 11:10:12 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Jeremy Allison
d14af63e6a r13293: Rather a big patch I'm afraid, but this should fix bug #3347
by saving the UNIX token used to set a delete on close flag,
and using it when doing the delete. libsmbsharemodes.so still
needs updating to cope with this change.
Samba4 torture tests to follow.
Jeremy.
(This used to be commit 23f16cbc2e)
2007-10-10 11:06:21 -05:00
Jeremy Allison
d1f91f7c72 r12043: It's amazing the warnings you find when compiling on a 64-bit
box with gcc4 and -O6...
Fix a bunch of C99 dereferencing type-punned pointer will break
strict-aliasing rules errors. Also added prs_int32 (not uint32...)
as it's needed in one place. Find places where prs_uint32 was being
used to marshall/unmarshall a time_t (a big no no on 64-bits).
More warning fixes to come.
Thanks to Volker for nudging me to compile like this.
Jeremy.
(This used to be commit c65b752604)
2007-10-10 11:05:42 -05:00
Gerald Carter
f2ecd4fed0 r11860: BUG 3156: don't use find_service() when explicitly looking for a printer as the username map might get in the way
(This used to be commit 46bf28c81c)
2007-10-10 11:05:31 -05:00
Gerald Carter
cd310c19ce r11240: * fix invalid read reported by valgrind in the
spoolss backchannel connection by rewriting
  spoolss_connect_to_client().  Ensure that we
  save the cli_state* in the rpc_pipe_client struct.

* fix typo in debug message in cli_start_connection"
(This used to be commit 18400f9662)
2007-10-10 11:05:09 -05:00
Gerald Carter
6fc9098dcc r11235: fix segfault in addprinter due to mixing talloc() and malloc()'d memory
(This used to be commit f6f78877b4)
2007-10-10 11:05:08 -05:00
Gerald Carter
6f72169c7c r11135: should fix seg fault in addprinter code reported by Marcin. Allocate memory in convert_printer_info() if necessary
(This used to be commit 7ada5da8e9)
2007-10-10 11:05:02 -05:00
Gerald Carter
54abd2aa66 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
(This used to be commit 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Günther Deschner
513e81458f r9945: fix typos.
Guenther
(This used to be commit 12029e9022)
2007-10-10 11:03:28 -05:00
Gerald Carter
c53e760ea5 r9752: figured out why talloc_steal() is a bad idea for SEC_DESC*
Add a comment so someone else doesn't get bitten by this as well.
(This used to be commit 050364ef34)
2007-10-10 11:03:25 -05:00
Gerald Carter
44707ad2e0 r9739: conver the reg_objects (REGSUBKEY_CTR & REGVAL_CTR) to use
the new talloc() features:

 Note that the REGSUB_CTR and REGVAL_CTR objects *must* be talloc()'d
 since the methods use the object pointer as the talloc context for
 internal private data.

 There is no longer a regXXX_ctr_intit() and regXXX_ctr_destroy()
 pair of functions.  Simply TALLOC_ZERO_P() and TALLOC_FREE() the
 object.

Also had to convert the printer_info_2->NT_PRINTER_DATA field
to be talloc()'d as well.  This is just a stop on the road to
cleaning up the printer memory management.
(This used to be commit ef721333ab)
2007-10-10 11:03:25 -05:00
Gerald Carter
d04c1efd0f r9264: fix valgrind invalid write error in enumprinterdata()
(This used to be commit bfebbc86fc)
2007-10-10 11:00:29 -05:00
Günther Deschner
fdc2ab72f7 r9021: Fix smbd-crash bug in openprinter (found by samba4 smbtorture
RPC-SPOOLSS).

Guenther
(This used to be commit 06bfe789d5)
2007-10-10 11:00:23 -05:00
Gerald Carter
57939971b4 r8916: should fix the valgrind invalid read of size 1 onthe
GetPrinterData("OSVersion") abartlet saw when browsing from
Vista client.
(This used to be commit b527b86ae8)
2007-10-10 11:00:20 -05:00
Jeremy Allison
ae64b2f2aa r8617: Be very explicit if addprinterex is called that the "addprinter command"
must be defined in smb.conf.
Jeremy.
(This used to be commit 86f8368c99)
2007-10-10 11:00:13 -05:00
Gerald Carter
6fe5451543 r8501: * disable printer handle object cache (was mostly used
for NT4 clients enumerating printer data on slow CPUs)
* fix pinter and secdesc record upgrade to normalize the key
  (rev'd printer tdb version)
* fixed problem that was normalizing the printername name field

in general, this should fix the issues upgrading print servers
from 3.0.14a to 3.0.20
(This used to be commit d07179de2f)
2007-10-10 11:00:06 -05:00
Gerald Carter
f2ff8bed26 r8326: factor out the delete printer code to a delete_printer_hook() for reuse
(This used to be commit 0689851a90)
2007-10-10 10:58:20 -05:00
Gerald Carter
e574081ad9 r8324: * initial cut at creating printers via the registry API
Need to add delete_key support
(This used to be commit 9a27f7181a)
2007-10-10 10:58:19 -05:00
Gerald Carter
18609ce1af r8322: * get RegSetValue() working for printer subkey values
(not immediate values below the <printer name> key yet.
(This used to be commit a872ea5f0e)
2007-10-10 10:58:19 -05:00
Gerald Carter
c296f858ef r8066: * had to modify the printer data storage slightly in ntprinters.tdb
when packing values.  It is a compatible change though and will
  not require a tdb version upgrade
* Can successfully create new printer subkeys via winreg that
  are immediately available via spoolss calls.  Still cannot delete
  keys yet though.  That comes next.
(This used to be commit 00bce2b3bb)
2007-10-10 10:58:10 -05:00
Gerald Carter
270b90e25f r7995: * privileges are local except when they're *not*
printmig.exe assumes that the LUID of the SeBackupPrivlege
  on the target server matches the LUID of the privilege
  on the local client.  Even though an LUID is never guaranteed
  to be the same across reboots.  How *awful*!  My cat could
  write better code! (more on my cat later....)

* Set the privelege LUID in the global PRIVS[] array

* Rename RegCreateKey() to RegCreateKeyEx() to better match MSDN

* Rename the unknown field in RegCreateKeyEx() to disposition
  (guess according to MSDN)

* Add the capability to define REG_TDB_ONLY for using the reg_db.c
  functions and stress the RegXXX() rpc functions.
(This used to be commit 0d6352da48)
2007-10-10 10:58:07 -05:00
Jeremy Allison
19ca97a70f r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us
from using C++ reserved keywords in our code.
Jeremy
(This used to be commit 9506b8e145)
2007-10-10 10:58:00 -05:00
Gerald Carter
f2f115c2a2 r7614: convert move_driver_to_download_area() to return WERROR in order to provide better error messages to clients when a AddPrinterDriver[Ex]() call fails
(This used to be commit c98e17446a)
2007-10-10 10:57:16 -05:00
Gerald Carter
f24d88cf9d r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1
(This used to be commit 9727d05241)
2007-10-10 10:57:02 -05:00
Gerald Carter
f0c650a382 r6942: * merging the registry changes back to the 3.0 tree
* removing the testprns tool
(This used to be commit 81ffb0dbbb)
2007-10-10 10:56:57 -05:00
Jeremy Allison
fe0ce8dd8e r6890: Refactor printing interface to take offset into job. Fixes bug
where large print jobs can have out-of-order offsets. Bug found
by Arcady Chernyak <Arcady.Chernyak@efi.com>
Jeremy.
(This used to be commit 482f7e0e37)
2007-10-10 10:56:56 -05:00
Gerald Carter
4f3c2d4424 r6679: BUG 2684: abartlett's patch for check the per service hosts allow/deny on printers when connecting via MS-RPC
(This used to be commit 80da9ca386)
2007-10-10 10:56:51 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Gerald Carter
5d1cb8e79e r6014: rather large change set....
pulling back all recent rpc changes from trunk into
3.0.  I've tested a compile and so don't think I've missed
any files.  But if so, just mail me and I'll clean backup
in a couple of hours.

Changes include \winreg, \eventlog, \svcctl, and
general parse_misc.c updates.

I am planning on bracketing the event code with an
#ifdef ENABLE_EVENTLOG until I finish merging Marcin's
changes (very soon).
(This used to be commit 4e0ac63c36)
2007-10-10 10:56:15 -05:00
Gerald Carter
d177f1bc8f r5806: * fix a couple more segvs in spoolss
* comment out unused variable after jra's change to revert the 56bit des
  smb signing changes
(This used to be commit 13ed08cd2a)
2007-10-10 10:56:02 -05:00
Gerald Carter
61dfab9f70 r5805: merging spoolss parsing changes from trunk and cleaning up resulting segvs
(This used to be commit 25121547ca)
2007-10-10 10:56:01 -05:00
Gerald Carter
5ba59da467 r5605: only display the publish check box on printer if
we are a member of an AD domain

clean up some hardcoded constands with the REG_XXX constant.
(This used to be commit a1d0be740d)
2007-10-10 10:55:50 -05:00
Gerald Carter
372440f207 r4856: after testing a simple add printer script, i realized that you still have to be root to send the message to all smbds that the config file has been updated
(This used to be commit 6409de1a1e)
2007-10-10 10:54:00 -05:00
Gerald Carter
10861a6160 r4825: Printing changes
----------------

* bracket the add/delete/set printer scripts with checks for se_print_op
* slight change to the add/set printer script semantics.  smbd no longer
  relies on output from the script (on stdout) to re-read smb.conf
* remove SIGHUP from set/add/delete printin script code and now just
  use MSG_SMB_CONF_UPDATED

* bracket the add/delete/set share scripts with checks for se_print_op
  (this includes setting share ACLs)
(This used to be commit 8ab8113d2e)
2007-10-10 10:53:56 -05:00
Gerald Carter
46e5effea9 r4805: Last planned change to the privileges infrastructure:
* rewrote the tdb layout of privilege records in account_pol.tdb
  (allow for 128 bits instead of 32 bit flags)
* migrated to using SE_PRIV structure instead of the PRIVILEGE_SET
  structure.  The latter is now used for parsing routines mainly.

Still need to incorporate some client support into 'net' so
for setting privileges.  And make use of the SeAddUserPrivilege
right.
(This used to be commit 41dc7f7573)
2007-10-10 10:53:55 -05:00
Gerald Carter
2c33c41b0c r4740: allow SE_PRINT_OPERATORS to have printer admin access
(This used to be commit 85731706c9)
2007-10-10 10:53:53 -05:00
Jeremy Allison
00eede9a6b r4184: Removed unused extern.
Jeremy.
(This used to be commit 72e39041e9)
2007-10-10 10:53:36 -05:00
Gerald Carter
3c45a093c4 r4134: check the setprinter(3) based on the access permissions on the handle and avoid the call to print_access_chaeck()
(This used to be commit 426634df9c)
2007-10-10 10:53:35 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Gerald Carter
3bd3be97dc r4083: consolidate printer searches to use find_service rather than for loops
(This used to be commit 12440744ba)
2007-10-10 10:53:31 -05:00
Gerald Carter
4e18fa46d5 r3069: add 'force printername' service parameter for people that want to enforce printername == sharename for spoolss printing
(This used to be commit d47b8a0b4f)
2007-10-10 10:53:00 -05:00
Gerald Carter
f2aca08c65 r3066: BUG 1519: fix segfault caused by double free of a printer
(This used to be commit 3760464193)
2007-10-10 10:53:00 -05:00
Gerald Carter
0af8284de1 r3065: BUG 1519 (more): apparently the server_name notify request is used to fill in the title bar of the port monitor window and unless we get it right, you cannot open the printer properties from the port monitor window
(This used to be commit fc691572c9)
2007-10-10 10:53:00 -05:00
Gerald Carter
c53e6401eb r3049: fixing some calls in the printing code to stanard_sub_basic(); fix standard_sub_snum() to use the current user's gid; add some (snum == -1) checks to standard_sub_advanced()
(This used to be commit 8c3fd1908d)
2007-10-10 10:52:59 -05:00
Gerald Carter
7df1ed060b r2955: fixing a segfault uncovered by the changes for BUG 1519
(This used to be commit 1664395257)
2007-10-10 10:52:57 -05:00
Gerald Carter
a169b950c7 r2918: BUG 1907: fix getprinterdriverdir_1(). have to make sure we don't add unnecessary double slashes to the servername
(This used to be commit 859599dbca)
2007-10-10 10:52:56 -05:00
Günther Deschner
2d016a67b8 r2821: Adding "Windows x64" as architecture string and driverdir "x64" for the
64bit AMD platform.

(This used to be "Windows AMD64" and "AMD64" in one of the release
candidates of SP2 for Windows XP. AMD64 is obviously still supported but
not documented.)

Guenther
(This used to be commit cc5892f041)
2007-10-10 10:52:53 -05:00
Gerald Carter
31441aaa13 r2768: BUG 1519: save the hostname used in the open_printer_ex() for later reuse when filling in the spolss replies (also gets rid of get_called_name()
(This used to be commit 57db8ca91f)
2007-10-10 10:52:52 -05:00
Gerald Carter
5a8effaaae r2569: Patch from Rob Foehl <rwf@loonybin.net>:
- fix typo in libads/ldap_printer.c:39, ads_find_printer_on_server()
  (originally libads-typo.patch)
- fix leak in printing/nt_printing.c, is_printer_published()
  (originally is_printer_published-leak.patch)
- fix double print_backend_init() calls, now only called from main()
- restructuring in printing/nt_printing.c
  - replaced (un)publish_it() with ads-specific functions
  - moved common code to nt_printer_publish()
  - improved error handling in several places
- added check_published_printers() in printing/nt_printing.c, to verify
  that each published printer is actually in the directory at startup
- changed calling semantics of mod_a_printer, dump_a_printer, and
  update_driver_init to be more consistent with the rest of the api and
  reduce some copying
(This used to be commit 50a5a3dbd0)
2007-10-10 10:52:46 -05:00
Gerald Carter
278f9467f2 r2133: Several fixes:
* BUG 1627: fix for NIS compiles on HPUX 11.00, AIX 4.3 and 5.1
  patch from Olaf Flebbe <o.flebbe@science-computing.de>.
  Will need to watch this one in the build farm.

* Fix bug found by rwf@loonybin.net where the PRINT_ATTRIBUTE_PUBLISHED
  was getting reset by attempts to sanitize the defined attributes
  (PRINTER_ATTRIBUTE_SAMBA)

* Resolve name conflict on DEC OSF-5.1 (inspired by patch from
  Adharsh Praveen <rprav@india.hp.com>)

* Work around parsing error in the print change notify code
  (not that the alignment bug is still there but reording the
   entries in the array works around it).

* remove duplicate declaration of getprintprocdir from rpcclient.
(This used to be commit 7474c6a446)
2007-10-10 10:52:32 -05:00
Jeremy Allison
b894c95f8d r1974: Just use a simple linked list for this.
Jeremy.
(This used to be commit 77bddd40b0)
2007-10-10 10:52:26 -05:00
Gerald Carter
1842fde7d1 r1885: tighten the cache consistency with the ntprinters.tdb entry an the in memory cache associated with open printer handles; also make sure that register_messages_flags() doesn't overwrite the originally registers flags
(This used to be commit 540daf71d8)
2007-10-10 10:52:23 -05:00
Günther Deschner
60727acc3b r1692: first commit :)
* add IA64 to the architecture table of printer-drivers

* add new "net"-subcommands:

  net rpc printer migrate {drivers|printers|forms|security|settings|all}
        [printer]
  net rpc share migrate {shares|files|all} [share]

  this is the first part of the migration suite. this will will (once
  feature-complete) allow to do 1:1 server-cloning in the best possible way by
  making heavy use of samba's rpc_client-functions. all migration-steps
  are implemented as rpc/smb-client-calls; net communicates via rpc/smb
  with two servers at the same time (a remote, source server and a
  destination server that currently defaults to the local smbd). this
  allows e. g. printer-driver migration including driverfiles, recursive
  mirroring of file-shares including file-acls, etc. almost any migration
  step can be called with a migrate-subcommand to provide more flexibility
  during a migration process (at the cost of quite some redundancy :) ).

  "net rpc printer migrate settings" is still in a bad condition (many
  open questions that hopefully can be adressed soon).

  "net rpc share migrate security" as an isolated call to just migrate
  share-ACLs will be added later.

  Before playing with it, make sure to use a test-server. Migration is a
  serious business and this tool-set can perfectly overwrite your
  existing file/print-shares.

* along with the migration functions had to make I the following
  changes:

        - implement setprinter level 3 client-side

        - implement net_add_share level 502 client-side

        - allow security descriptor to be set in setprinterdata level 2
          serverside

guenther
(This used to be commit 8f1716a29b)
2007-10-10 10:52:19 -05:00
Jeremy Allison
de22eab16d r1501: One more check for option != 0.
Jeremy.
(This used to be commit a6d0452a2d)
2007-10-10 10:52:13 -05:00
Gerald Carter
aca7386989 r1484: BUG 1520: work around bug in xp sp2 rc2 where the client sends a fnpcn() request without previously sending a ffpcn(). Return what win2k sp4 does
(This used to be commit 3f73d19807)
2007-10-10 10:52:12 -05:00
Jeremy Allison
cf1c4ae9a6 r1241: Fix incorrect type in printer publishing (struct uuid, not UUID_FLAT).
Jeremy.
(This used to be commit a535a05975)
2007-10-10 10:52:02 -05:00
Gerald Carter
087868c499 r1230: (merges from HP PSA) fixing a couple of caching bugs in the printing code. (a) make sure to clear jobs_changed list when deleting a job and, (b) invalidate the printer handle cache when we get a notification that something has changed on that printer
(This used to be commit e3d4fea780)
2007-10-10 10:52:01 -05:00
Gerald Carter
7959cba656 r925: add changes frpm trunk (r841 and r842) -- enable background queue update process and allow printers to have different sharenames from printernames
(This used to be commit 066b9c4276)
2007-10-10 10:51:49 -05:00
Gerald Carter
8ad3d8c9b0 r196: merging struct uuid from trunk
(This used to be commit 911a28361b)
2007-10-10 10:51:13 -05:00
Gerald Carter
dbb38cc6b5 merging print change notify fix from HP appliance. Also might address some one the issues in BUG 1007
(This used to be commit 17ecea4152)
2004-03-16 17:06:11 +00:00
Jeremy Allison
2f2e5b0191 Fix up name canonicalization (needed for krb5 keytab support later).
Remove source_env handler (no longer used in any codepath).
Jeremy.
(This used to be commit 3a3e336030)
2004-01-30 18:38:48 +00:00
Jeremy Allison
f589164ed9 Patch from Stefan Metzmacher <metze@metzemix.de> to fix signing problems
when reverse connecting back to a client for printer notify.
Jeremy.
(This used to be commit 06aa434c3f)
2003-10-21 21:19:00 +00:00