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

97 Commits

Author SHA1 Message Date
Jeremy Allison
cb5436bcc3 Add const to the get_peer_addr() and get_socket_addr()
calls. Use the IPv6 varient for get_peer_addr().
Jeremy.
(This used to be commit baf1f52e34)
2007-10-11 15:36:13 -07: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
7216604b5e r21958: Fix Coverity ID 343 (dead code)
(This used to be commit 6d093043ed)
2007-10-10 12:18:52 -05:00
Gerald Carter
b2bc94eeee 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>
(This used to be commit e859e1fdcd)
2007-10-10 12:18:39 -05:00
Herb Lewis
ef4c2088c5 r20245: merge 20244 from samba_3_0_24
get rid of more nested extern declarations warnings
(This used to be commit e9df051f52)
2007-10-10 12:16:36 -05:00
Herb Lewis
6914b29daa r20131: get rid of a few no previous prototype warnings
(This used to be commit e710a7d39a)
2007-10-10 12:16:26 -05:00
Jelmer Vernooij
17ed5d07f4 r17816: Merge my cupsprot branch. It is now possible to (optionally) specify :port in
the "cups server" smb.conf parameter.
(This used to be commit 3f665f4ec4)
2007-10-10 11:38:51 -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
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
Gerald Carter
f9a28748cf r5359: BUG 2333: use the lpq command to pass in the correct printer name for cups_queue_get(). See comments in code for details
(This used to be commit 3eee00e0d0)
2007-10-10 10:55:39 -05:00
Gerald Carter
f0df38a4e8 r5012: fix segfault caused by using a ipp_t * after calling cupsDoRequest()
(This used to be commit 0ac3c4c5a2)
2007-10-10 10:55:11 -05:00
Gerald Carter
4417bf44ad r4907: remove unreached code
(This used to be commit 15fd4a05ec)
2007-10-10 10:55:07 -05:00
Gerald Carter
fd2ad84d7b r4902: please note that cupsDoRequest() deletes the request* so don't call ippDelete(request) *ever*
(This used to be commit f65598b3b0)
2007-10-10 10:55:07 -05:00
Jeremy Allison
90c5c93ded r4881: Varient of Lar's patch for #2270. Jerry promises to test :-).
Jeremy.
(This used to be commit 2afe2a16c9)
2007-10-10 10:55:06 -05:00
Gerald Carter
d097ea4905 r4539: patch from Rob -- adding real printcap name cache function to speed up printcap reloads
(This used to be commit 1cad525093)
2007-10-10 10:53:46 -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
8fe6d35761 r4030: patch from Rob -- don't force the cups printer-make-and-model tag as the comment for autoloaded printers
(This used to be commit 26bbad62b9)
2007-10-10 10:53:29 -05:00
Gerald Carter
293136c04b r3067: patch based on volker's initial work in trunk that fixes the queu update problem when using the background daemon
(This used to be commit de7af09e72)
2007-10-10 10:53:00 -05:00
Volker Lendecke
e707189db3 r979: Implement the 'cups server' option. This makes it possible to have virtual
smbd's connect to different cups daemons.

Volker
(This used to be commit 148dc71ea5)
2007-10-10 10:51:52 -05:00
Gerald Carter
578a7d254f r242: adding 'cups options' parameter to allow raw printing without changing /etc/cups/cupsd.conf -- documentation to follow
(This used to be commit 2f323b0991)
2007-10-10 10:51:15 -05:00
Gerald Carter
055750f090 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.
(This used to be commit 5979f4d645)
2003-11-25 19:16:35 +00:00
Gerald Carter
c26aa9fd2d patch from Matthias Hilbig for bug 467; use the dns name (or IP) as the originating client name when using CUPS
(This used to be commit 71333299a6)
2003-11-24 18:37:19 +00:00
Andrew Tridgell
e1c468477c 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.
(This used to be commit b3e024ce1d)
2003-11-12 01:51:10 +00:00
Andrew Bartlett
8a20407442 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
(This used to be commit c1cfc296c2)
2003-02-10 11:47:21 +00:00
Gerald Carter
0adfd3d418 CUPS patch to log client name
(This used to be commit d4168c327b)
2003-02-05 06:37:27 +00:00
Gerald Carter
f473388887 CUPS-PRINTER_CLASS patch from Michael Sweet
(This used to be commit 8d0bde4315)
2003-01-28 01:58:38 +00:00
Gerald Carter
99cdb46208 *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
(This used to be commit 0fb724b321)
2003-01-15 18:57:41 +00:00
Tim Potter
f3e3a56ea9 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
(This used to be commit d3998307ad)
2002-11-29 02:58:59 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
John Terpstra
0b7f9e7a7c Fix ability to compile with CUPS support.
(This used to be commit 208c62c5a7)
2002-03-17 22:40:51 +00:00
Jeremy Allison
02eda2e251 Tidyups when I was doing the big merge...
Jeremy.
(This used to be commit 9148bb9eaa)
2001-11-17 03:19:17 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Andrew Tridgell
95739423d0 updated copyright for Michael Sweet
(This used to be commit 9d53473f30)
2001-09-02 22:39:03 +00:00
Tim Potter
d1f53e4044 Fixed detection of CUPS. We need to check for the presence of the cups
header files as well as libcups.
(This used to be commit 2dbb41a7b8)
2001-08-23 19:06:20 +00:00
Jeremy Allison
f0ce79331f Merged John's fix.
Jeremy.
(This used to be commit 61141c371a)
2001-08-09 18:20:43 +00:00
Simo Sorce
2f844bf447 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)
(This used to be commit 7f33c01688)
2001-08-08 16:54:16 +00:00
Jeremy Allison
cab11894ec Same fix for resume as for pause.
Jeremy.i
(This used to be commit 9444fc554b)
2001-07-23 20:47:55 +00:00
Jeremy Allison
c0d02ca380 Fix for CUPS pause/restart code.
Jeremy.
(This used to be commit 592ef3d8ea)
2001-07-23 20:40:16 +00:00
Jeremy Allison
6b53da146e Fix for cups compile.
Jeremy.
(This used to be commit e90ad081ad)
2001-07-23 19:50:36 +00:00
Jeremy Allison
e091298907 iFix from "Shahms E. King" <shahms@shahms.com> to get cups user name
right.
Jeremy.
(This used to be commit 34244c2a8d)
2001-07-17 00:39:07 +00:00
Andrew Tridgell
87fbb7092b 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.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Jeremy Allison
65d35749b7 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.
(This used to be commit c0345bbaed)
2001-03-16 05:55:30 +00:00
Jeremy Allison
fd46817f0b Excise snprintf -> slprintf.
srv_samr.c: duplicate gid fix.
srv_spoolss_nt.c: Merge of JF's work.
uid.c: Fix for returning names when a PDC.
Jeremy.
(This used to be commit d938ad6963)
2001-02-16 19:21:18 +00:00
Jeremy Allison
cf5b71994d file_lines_load/file_lines_pload can now optionally convert unix_to_dos()
on read.
Jeremy.
(This used to be commit 76b8dd376d)
2000-12-07 19:26:04 +00:00
Andrew Tridgell
f6cf850f16 printing/print_cups.c from 2.0.6
(This used to be commit 452776a5a7)
1999-12-17 01:46:15 +00:00