1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-01 16:23:49 +03:00
Commit Graph

53 Commits

Author SHA1 Message Date
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
d2ee75326a Remove pstring from printing/*.c except for the
tdb_unpack requirement (I'll be making that an
allocating interface later).
Jeremy.
2007-11-21 13:56:36 -08:00
Jeremy Allison
963fc76852 Remove most of the remaining globals out of lib/util_sock.c.
I have a plan for dealing with the remaining..... Watch
this space.
Jeremy.
2007-11-03 23:20:10 -07:00
Jeremy Allison
95d01279a5 I can't get away without a 'length' arg. :-).
Jeremy.
2007-11-03 18:41:26 -07:00
Jeremy Allison
e848506c85 Stop get_peer_addr() and client_addr() from using global
statics. Part of my library cleanups.
Jeremy.
2007-11-03 18:15:45 -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
baf1f52e34 Add const to the get_peer_addr() and get_socket_addr()
calls. Use the IPv6 varient for get_peer_addr().
Jeremy.
2007-10-11 15:36:13 -07: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
6d093043ed r21958: Fix Coverity ID 343 (dead code) 2007-10-10 12:18:52 -05:00
Gerald Carter
e859e1fdcd r21861: Pull the comment and location from CUPS if we don't have one
when fetching a printer from ntprinters.tdb.

Slightly modified from original version submitted on
samba-technical ml by Andy Polyakov <appro@fy.chalmers.se>
2007-10-10 12:18:39 -05:00
Herb Lewis
e9df051f52 r20245: merge 20244 from samba_3_0_24
get rid of more nested extern declarations warnings
2007-10-10 12:16:36 -05:00
Herb Lewis
e710a7d39a r20131: get rid of a few no previous prototype warnings 2007-10-10 12:16:26 -05:00
Jelmer Vernooij
3f665f4ec4 r17816: Merge my cupsprot branch. It is now possible to (optionally) specify :port in
the "cups server" smb.conf parameter.
2007-10-10 11:38:51 -05:00
Jeremy Allison
1d710d06a2 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.
2007-10-10 11:10:59 -05:00
Gerald Carter
939c3cb5d7 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)
2007-10-10 11:04:48 -05:00
Gerald Carter
3eee00e0d0 r5359: BUG 2333: use the lpq command to pass in the correct printer name for cups_queue_get(). See comments in code for details 2007-10-10 10:55:39 -05:00
Gerald Carter
0ac3c4c5a2 r5012: fix segfault caused by using a ipp_t * after calling cupsDoRequest() 2007-10-10 10:55:11 -05:00
Gerald Carter
15fd4a05ec r4907: remove unreached code 2007-10-10 10:55:07 -05:00
Gerald Carter
f65598b3b0 r4902: please note that cupsDoRequest() deletes the request* so don't call ippDelete(request) *ever* 2007-10-10 10:55:07 -05:00
Jeremy Allison
2afe2a16c9 r4881: Varient of Lar's patch for #2270. Jerry promises to test :-).
Jeremy.
2007-10-10 10:55:06 -05:00
Gerald Carter
1cad525093 r4539: patch from Rob -- adding real printcap name cache function to speed up printcap reloads 2007-10-10 10:53:46 -05:00
Jeremy Allison
620f2e608f 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.
2007-10-10 10:53:32 -05:00
Gerald Carter
26bbad62b9 r4030: patch from Rob -- don't force the cups printer-make-and-model tag as the comment for autoloaded printers 2007-10-10 10:53:29 -05:00
Gerald Carter
de7af09e72 r3067: patch based on volker's initial work in trunk that fixes the queu update problem when using the background daemon 2007-10-10 10:53:00 -05:00
Volker Lendecke
148dc71ea5 r979: Implement the 'cups server' option. This makes it possible to have virtual
smbd's connect to different cups daemons.

Volker
2007-10-10 10:51:52 -05:00
Gerald Carter
2f323b0991 r242: adding 'cups options' parameter to allow raw printing without changing /etc/cups/cupsd.conf -- documentation to follow 2007-10-10 10:51:15 -05:00
Gerald Carter
5979f4d645 allow users to delete jobs with cups printing backend
The changes the name of the job passed off to cups
from "Test Page" to "smbprn.00000033 Test Page" so that
we can get the smb jobid back from lpq.  Working on bug
770.
-
Gerald Carter
71333299a6 patch from Matthias Hilbig for bug 467; use the dns name (or IP) as the originating client name when using CUPS -
Andrew Tridgell
b3e024ce1d a small include file rearrangement that doesn't affect normal
compilation, but that allows Samba3 to take advantage of pre-compiled
headers in gcc if available.
-
Andrew Bartlett
c1cfc296c2 Cleanups: (merge from HEAD)
- use safe_strcpy() instead of pstrcpy() for malloc()ed strings

 - CUPS: a failure in an attempt to automaticly add a printer is not level 0 stuff.

 - Fix up a possible Realloc() failure segfault

Andrew Bartlett
-
Gerald Carter
d4168c327b CUPS patch to log client name -
Gerald Carter
8d0bde4315 CUPS-PRINTER_CLASS patch from Michael Sweet -
Gerald Carter
0fb724b321 *lots of small merges form HEAD
*sync up configure.in
*don't build torture tools in make all
*make sure to remove torture tools as part of make clean
-
Tim Potter
d3998307ad Merge a bunch of trivial changes from HEAD. The difference remaining
should actual functional differences between HEAD and 3.0.

 - Mostly reformatting
 - Removal of unecessary #include "smb.h"
 - Merge of dyn_DRIVERFILE removal
 - Silly bug fix for python code
-
Gerald Carter
65e7b5273b sync'ing up for 3.0alpha20 release -
Andrew Tridgell
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 -
John Terpstra
208c62c5a7 Fix ability to compile with CUPS support. -
Jeremy Allison
9148bb9eaa Tidyups when I was doing the big merge...
Jeremy.
-
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. -
Andrew Tridgell
9d53473f30 updated copyright for Michael Sweet -
Tim Potter
2dbb41a7b8 Fixed detection of CUPS. We need to check for the presence of the cups
header files as well as libcups.
-
Jeremy Allison
61141c371a Merged John's fix.
Jeremy.
-
Simo Sorce
7f33c01688 Change all realloc() statements to Realloc() (ecxept for tdb.c)
changed some code to exploit the fact that Realloc(NULL, size) == malloc(size)
fixed some possible mem leaks, or seg faults.

thanks to andreas moroder (mallocs not checked in client/client.c, client/smbumount.c)
-
Jeremy Allison
9444fc554b Same fix for resume as for pause.
Jeremy.i
-
Jeremy Allison
592ef3d8ea Fix for CUPS pause/restart code.
Jeremy.
-
Jeremy Allison
e90ad081ad Fix for cups compile.
Jeremy.
-
Jeremy Allison
34244c2a8d iFix from "Shahms E. King" <shahms@shahms.com> to get cups user name
right.
Jeremy.
-
Andrew Tridgell
debb471267 The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
-
Jeremy Allison
c0345bbaed Added Michael Sweet's CUPS patch to call directly into the CUPS backend.
Parameterises the printing functions so other backends can be plugged
directly in (this is a good thing :-).
Jeremy.
-