1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

470 Commits

Author SHA1 Message Date
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