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

696 Commits

Author SHA1 Message Date
Volker Lendecke
f8a17bd8bd r18047: More C++ stuff
(This used to be commit 86f4ca84f2)
2007-10-10 11:43:24 -05:00
Volker Lendecke
ee0e397d6f r18019: Fix a C++ warnings: Don't use void * in libads/ for LDAPMessage anymore.
Compiled it on systems with and without LDAP, I hope it does not break the
build farm too badly. If it does, I'll fix it tomorrow.

Volker
(This used to be commit b2ff9680eb)
2007-10-10 11:39:49 -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
Volker Lendecke
517efef9a1 r17622: Add a framework for a printing backend designed to support the build farm. If
we want to walk more printing code in the build farm I think doing that with a
customized printing backend is much easier than with a set of shell scripts.

Jerry, comments?

Volker
(This used to be commit 949cd6b992)
2007-10-10 11:38:44 -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
Gerald Carter
be25a49a94 r16701: Fix segv when adding a printer caused by not initializing the
realm name in ads_init() in nt_printer_publish().
(This used to be commit a25e75e78d)
2007-10-10 11:19:09 -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
d1014c1cdf r16582: Fix Klocwork #1997 and all generic class of problems
where we don't correctly check the return from memdup.
Jeremy.
(This used to be commit ce14daf51c)
2007-10-10 11:19:01 -05:00
Jeremy Allison
f014291edd r16424: Fix possible null deref and a memory leak found by
examining Klockwork #1519. get_printer_subkeys()
could return zero without initializing it's return
pointer arg. Fixed this. Added free of subkey pointer
return in registry/reg_printing.c (interesting that
neithe Coverity or Klocwork found this one).
Jeremy.
(This used to be commit 4fbeae1a3a)
2007-10-10 11:18:52 -05:00
Jeremy Allison
a77a699fe9 r16393: Klocwork #1164. Null deref.
Jeremy.
(This used to be commit c9a4ce51ed)
2007-10-10 11:18:51 -05:00
Jeremy Allison
1c8a871aaf r16392: Klockwork #1168. Protect against null deref.
Jeremy.
(This used to be commit cab256d72a)
2007-10-10 11:18:51 -05:00
Jeremy Allison
1b64f06048 r16367: Missed one, Klocwork #915.
Jeremy.
(This used to be commit b581fee982)
2007-10-10 11:18:49 -05:00
Jeremy Allison
d5b6dedfdd r16365: Fix Klocwork #895, #898, #899, #915, #932, #938 and a
few other problems Klocwork missed.
Jeremy.
(This used to be commit fe05769a1a)
2007-10-10 11:18:49 -05:00
Jeremy Allison
8f2d6e4852 r16243: Fix Klocwork bugs #581 and #706, ensure we check
the end of array first in the loop. Reformat to
modern standards.
Jeremy.
(This used to be commit 66275bd3bc)
2007-10-10 11:17:27 -05:00
Jeremy Allison
a1e0a0e928 r16230: Fix Klocwork #861 and others. localtime and asctime
can return NULL. Ensure we check all returns correctly.
Jeremy.
(This used to be commit 6c61dc8ed6)
2007-10-10 11:17:26 -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
5895967601 r15569: Fix Coverity bug # 287. Jerry, can you check if WERR_NOMEM is a correct error
code here?

Thanks,

Volker
(This used to be commit 5787bd0ee9)
2007-10-10 11:17:01 -05:00
Gerald Carter
2c029a8b96 r15543: New implementation of 'net ads join' to be more like Windows XP.
The motivating factor is to not require more privileges for
the user account than Windows does when joining a domain.

The points of interest are

* net_ads_join() uses same rpc mechanisms as net_rpc_join()
* Enable CLDAP queries for filling in the majority of the
  ADS_STRUCT->config information
* Remove ldap_initialized() from sam/idmap_ad.c and
  libads/ldap.c
* Remove some unnecessary fields from ADS_STRUCT
* Manually set the dNSHostName and servicePrincipalName attribute
  using the machine account after the join

Thanks to Guenther and Simo for the review.

Still to do:

* Fix the userAccountControl for DES only systems
* Set the userPrincipalName in order to support things like
  'kinit -k' (although we might be able to just use the sAMAccountName
  instead)
* Re-add support for pre-creating the machine account in
  a specific OU
(This used to be commit 4c4ea7b20f)
2007-10-10 11:16:57 -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
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
Günther Deschner
a17d276fa0 r14506: Remove remaining references to a KCM credential cache type.
Guenther
(This used to be commit aae8f8ae7a)
2007-10-10 11:15:35 -05:00
Jeremy Allison
419871306c r14489: Guard against coverity reversion. #181 is a false positive
but make the intent clearer.
Jeremy.
(This used to be commit 2703df7a8f)
2007-10-10 11:15:34 -05:00
Jeremy Allison
3b58c82a52 r14273: Fix coverity bug #202. Memory leak on error path.
Jeremy.
(This used to be commit d2be8163f2)
2007-10-10 11:15:22 -05:00
Jeremy Allison
c00e664e25 r14221: Fix coverity #76. My previous change wasn't quite enough :-).
Jeremy.
(This used to be commit 21b70035f3)
2007-10-10 11:15:17 -05:00
Jeremy Allison
f2006f8ce1 r14184: Coverity fix #56. Ensure we can't deref null.
Jeremy.
(This used to be commit c76092a066)
2007-10-10 11:15:15 -05:00
Jeremy Allison
82ab2bce5a r14023: My last bug fix still left a potential null deref.
C- "must try harder" :-).
Jeremy.
(This used to be commit 9c55bf74ca)
2007-10-10 11:11:06 -05:00
Jeremy Allison
3527b5cc25 r14003: Clarify code that lead to Coverity report #13.
Not a bug, but better to remove false positives.
Jeremy.
(This used to be commit f9a75d7654)
2007-10-10 11:11:04 -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
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
Günther Deschner
ae25f82ac2 r13408: Remove C++ comments (# 3494)
Guenther
(This used to be commit cf86d4c9f0)
2007-10-10 11:09:59 -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
Gerald Carter
dbac670166 r12889: BUG 3380: fix crash when changing printer drivers caused by accessing a previously freed pointer
(This used to be commit bcce3b69f8)
2007-10-10 11:06:06 -05:00
Gerald Carter
b1e8785070 r11855: patch from Aruna Prabakar for checking that the spooler si running on HP-UX
(This used to be commit 017775f287)
2007-10-10 11:05:30 -05:00
Jeremy Allison
6baec64a73 r11420: Fix issue pointed out by Dina Fine <dina@exanet.com>. We can
only tell at parse time from the wire if an incoming name
has wildcards or not. If it's a mangled name and we demangle
the demangled name may contain wildcard characters. Ensure
these are ignored.
Jeremy.
(This used to be commit 4cd8e2a96b)
2007-10-10 11:05:15 -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
Gerald Carter
a1faaa9e67 r10554: * BUG 3057: assume x64 drivers are v3 drivers
* BUG 3087: allow smbspool to establisha geust connection
  using a username with no password
(This used to be commit 39369c8041)
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
Günther Deschner
b4857a4c2a r10154: Fix crash bug on security descriptor upgrade (as seen on x86_64).
Guenther
(This used to be commit daa61ef75b)
2007-10-10 11:03:35 -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
Jeremy Allison
4ae6b9765f r9244: Fix bugs found by Coverity.
Jeremy.
(This used to be commit bf80edeea7)
2007-10-10 11:00:28 -05:00
Gerald Carter
ac42cd59f2 r9086: * fix invalid read in parse_spoolss when writing a devmode to
the wire
* fix dup_a_regval() when size is 0
* ensure we pass a pstring to unlink_internals (fixes delete_driver
  code)
(This used to be commit 353e63ff42)
2007-10-10 11:00:25 -05:00