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

248 Commits

Author SHA1 Message Date
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
470ebf8a35 r25399: Excise uint - > uint32 (where appropriate) or unsigned int.
Jeremy.
(This used to be commit b4ee924000)
2007-10-10 12:31:02 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -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
14e25f10d6 r23168: Move the lp_max_connections() into service.c.
(This used to be commit 4afe37d431)
2007-10-10 12:22:51 -05:00
Volker Lendecke
f3c477c631 r23167: Remove an unused parameter
(This used to be commit 3452a870d5)
2007-10-10 12:22:51 -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
e95942ed84 r22954: More messaging_register
(This used to be commit 9b8df24107)
2007-10-10 12:22:11 -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
fad7dd8a60 r22868: Replace some message_send_pid calls with messaging_send_pid calls. More
tomorrow.
(This used to be commit 74fa57ca5d)
2007-10-10 12:22:04 -05:00
Volker Lendecke
7192160599 r22747: Fix some C++ warnings
(This used to be commit a66a04e9f1)
2007-10-10 12:21:54 -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
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
2d118cef3f r21988: make use of string_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand"

metze
(This used to be commit 2f52df7103)
2007-10-10 12:18:57 -05:00
Volker Lendecke
8dbeb4dbeb r21446: Karolins "printjob username"
(This used to be commit 19ee677925)
2007-10-10 12:18:04 -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
Herb Lewis
791f48f167 r20124: clean up nested extern declaration warnings
(This used to be commit ac3eb7813e)
2007-10-10 12:16:26 -05:00
Volker Lendecke
08e308fe2c r17590: Some C++ Warnings
(This used to be commit b7ec240880)
2007-10-10 11:38:41 -05:00
Jeremy Allison
a093a76dc1 r17293: After the results from the cluster tests in Germany,
fix the messaging code to call the efficient calls :

save_re_uid()
set_effective_uid(0);

messaging_op

restore_re_uid();

instead of using heavyweight become_root()/unbecome_root()
pairs around all messaging code. Fixup the messaging
code to ensure sec_init() is called (only once) so that non-root
processes still work when sending messages.

This is a lighter weight solution to become_root()/unbecome_root()
(which swaps all the supplemental groups) and should be more
efficient. I will migrate all server code over to using this
(a similar technique should be used in the passdb backend
where needed).

Jeremy.
(This used to be commit 4ace291278)
2007-10-10 11:38:24 -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
Jeremy Allison
e5f766aac8 r16648: Fix bug #3889 reported by jason@ncac.gwu.edu.
Jeremy.
(This used to be commit 2eefe9b6f5)
2007-10-10 11:19:06 -05:00
Jeremy Allison
57ba729fac r16626: Fix bug #3878. Reported by jason@ncac.gwu.edu.
Jeremy.
(This used to be commit 4c3019eb99)
2007-10-10 11:19:04 -05:00
Jeremy Allison
fc77e332e3 r16599: Make it clear to Klocwork we're not dereferencing. Issue #2026.
Jeremy.
(This used to be commit 9402bf0d4c)
2007-10-10 11:19:02 -05:00
Jeremy Allison
2e8b3ca0cb r16216: Add debug messages to make it possible to try and
debug why a job pause or resume command is not being
done.
Jeremy.
(This used to be commit e6aacb1426)
2007-10-10 11:17:26 -05:00
Volker Lendecke
e17302200c r15101: Little step towards getting Samba4 tdb into 3: tdb_lock_bystring does not
have the timeout argument in Samba4. Add a new routine
tdb_lock_bystring_with_timeout.

Volker
(This used to be commit b9c6e3f556)
2007-10-10 11:16:23 -05:00
Jeremy Allison
cc8ba23e8d r15025: Fix exit_server_cleanly call.
Jeremy.
(This used to be commit a64976b944)
2007-10-10 11:15:57 -05:00
James Peach
4fa5559800 r14898: This change is an attempt to improve the quality of the information that
is produced when a process exits abnormally.

First, we coalesce the core dumping code so that we greatly improve our
odds of being able to produce a core file, even in the case of a memory
fault. I've removed duplicates of dump_core() and split it in two to
reduce the amount of work needed to actually do the dump.

Second, we refactor the exit_server code path to always log an explanation
and a stack trace. My goal is to always produce enough log information
for us to be able to explain any server exit, though there is a risk
that this could produce too much log information on a flaky network.

Finally, smbcontrol has gained a smbd fault injection operation to test
the changes above. This is only enabled for developer builds.
(This used to be commit 56bc02d644)
2007-10-10 11:15:53 -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
Günther Deschner
cab298856a r13622: Allow to rename machine accounts in a Samba Domain. This still uses the
"rename user script" to do the rename of the posix machine account (this
might be changed later). Fixes #2331.

Guenther
(This used to be commit b2eac2e6eb)
2007-10-10 11:10:19 -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
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
2919634467 r10555: a few compile warnings from jason Mader
(This used to be commit 88998fa0b9)
2007-10-10 11:04:47 -05:00
Jeremy Allison
c762908074 r10371: Adding iPrint printing backend written by Joel J. Smith @ Novell.
Jeremy.
(This used to be commit 155dc2d52a)
2007-10-10 11:03:41 -05:00
Jeremy Allison
4ae6b9765f r9244: Fix bugs found by Coverity.
Jeremy.
(This used to be commit bf80edeea7)
2007-10-10 11:00:28 -05:00
Günther Deschner
0b98400cc0 r8686: Revert %LOGONSERVER%-substitution. The substition is done on the client,
not on the server.

We now preserve this windows variable (important for vampired setups)
and correctly substitute only the "%L"s in strings like:

        "%LOGONSERVER% %L %lOgOnSeRvEr% %L".

Guenther
(This used to be commit dccf777f42)
2007-10-10 11:00:15 -05:00
Gerald Carter
eb1123e500 r8506: BUG 2853: don't strip out characters like '$' from printer names
when substituting for the lpq command.
(This used to be commit 2f5de718a9)
2007-10-10 11:00:07 -05:00
Gerald Carter
18dc1009e6 r7829: fix unitialized printer status field that was breaking migration of print queues
(This used to be commit ada1d326ae)
2007-10-10 10:57:58 -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
fd237d9903 r6490: BUG 1998: patch from Olaf Imig <Olaf.Imig@bifab.de>; fix byte ordering bug when storing 16-bit RAP print job ids
(This used to be commit 2c66a4098a)
2007-10-10 10:56:42 -05:00
Gerald Carter
a49c567d4a r5993: compiler warning fix
(This used to be commit 4e8b868e6e)
2007-10-10 10:56:14 -05:00
Gerald Carter
9b38ced168 r5950: more compiler warning's from Jason Mader
(This used to be commit 27c6e85ad5)
2007-10-10 10:56:10 -05:00
Gerald Carter
cacc3e1888 r5807: fix segfault after compiler warning clean up (and cleanup another warning)
(This used to be commit 2dae527e21)
2007-10-10 10:56:02 -05:00
Volker Lendecke
5918d8a311 r5770: Get rid of some compiler warnings
(This used to be commit 96a0f7d60c)
2007-10-10 10:56:00 -05:00
Gerald Carter
ad4fe018c2 r5691: wrapping the pause/resume/purge printer commands in
{become,unbecome}_root() blocks.  We've already done
a print_access_check() to ensure the user is admin.
The means that non-root users can pause and manage printers.
I really don't see how this worked before without setuid
binaries on the server.

Also update print_queue_update() interface to allow an smbd
to update the print queue cache locally rather than going through
the bg lpq daemon.  This is needed for things like pjob_delete()
to ensure the cache is current for the specific client.
(This used to be commit f75369ec86)
2007-10-10 10:55:55 -05:00
Jeremy Allison
57e3af57fd r4662: Fix from "Jerome Borsboom" <j.borsboom@erasmusmc.nl> to fix
missing release reference for printer tdb.
Jeremy.
(This used to be commit 5942bb7737)
2007-10-10 10:53:50 -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
Gerald Carter
bc7142ce23 r4094: BUG 2107: fix memory bloating caused by large numbers of print_queue_updates() requests sent via messages.tdb
(This used to be commit 56b1110c71)
2007-10-10 10:53:34 -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
90bd2b4fd0 r4028: * prevent the background LPQ daemon from updating
the print queue cache just because multiple smbd
  processes sent a message that it was out of date.

* add some extra debug messages while trying to track down
  down jobs being left in the queue after printing has
  completed.
(This used to be commit a64505d52f)
2007-10-10 10:53:28 -05:00
Jeremy Allison
79f7373b33 r3867: Fix from david.hu@hp.com - make a copy of an incoming message
rather than indirecting into it as a struct (may not be on an
even byte boundary). Bug #2052.
Jeremy.
(This used to be commit 8a91a69961)
2007-10-10 10:53:22 -05:00