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

1026 Commits

Author SHA1 Message Date
Volker Lendecke
2a7601fcb4 r14134: Fix Coverity bug # 137
(This used to be commit 62e58d939b)
2007-10-10 11:15:13 -05:00
Jeremy Allison
b19d871a1a r14115: Fix coverity bug #23. Don't deref a potentially null ptr.
Jeremy.
(This used to be commit df32eb70a4)
2007-10-10 11:11:13 -05:00
Jeremy Allison
aa3cab954e r14092: Fix coverity bug #22. Ensure no possible null
deref.
Jeremy.
(This used to be commit 0026fb0b28)
2007-10-10 11:11:11 -05:00
Jeremy Allison
d12fd8dcb7 r14090: Fix coverity bug #21, don't deref potential null.
Jeremy.
(This used to be commit 76c4d5212b)
2007-10-10 11:11:11 -05:00
Jeremy Allison
a9d1af9d31 r14083: Fix coverity bug #19. Don't deref possible NULL.
Jeremy.
(This used to be commit fc8e1e5c02)
2007-10-10 11:11:11 -05:00
Jeremy Allison
d785b61a16 r14080: Fix Coverity bug #18. Ensure non-null before ref.
Jeremy.
(This used to be commit 617c5805e5)
2007-10-10 11:11:10 -05:00
Günther Deschner
fc5a7fe064 r14061: Some debugging for the new LOGON/ACB-flags.
Guenther
(This used to be commit 7616317f9f)
2007-10-10 11:11:09 -05:00
Jeremy Allison
b05af76541 r14047: Coverity fix #17. Ensure srv_name and info cannot
be zero before deref.
Jeremy.
(This used to be commit fbf9db6624)
2007-10-10 11:11:08 -05:00
Jeremy Allison
d8ba987bfe r14045: Coverity fix #14. Ensure if len is set buf != NULL.
Jeremy.
(This used to be commit fb1a607332)
2007-10-10 11:11:07 -05:00
Jeremy Allison
8d1dd8bb96 r14043: After discussion with Jerry revert part of the
Coverity null-ref patch - put prs_rpcbuffer_p
back to the way it was (with an additional
coverity paranoia check) - move the real test
into rpcbuf_alloc_size instead.
Jeremy.
(This used to be commit f74993e65c)
2007-10-10 11:11:07 -05:00
Volker Lendecke
874a9d02de r14025: Remove unused code. When we want to export samsync, we better first port
pidl...

Fix Coverity # 15.

Volker
(This used to be commit 29b4b986cc)
2007-10-10 11:11:06 -05:00
Jeremy Allison
a3586ff60c r14014: Coverity paranoia. Shut it up by making the guarentee
in the code explicit - but this was a false positive (CID #16).
Jeremy.
(This used to be commit 43a0e869f2)
2007-10-10 11:11:05 -05:00
Jeremy Allison
cd49e2546e r13989: Fix for Coverity bug #45 and associated spoolss RPC_BUFFER
problems. Ensure that if the parse succeeds on UNMARSHALL
we have a valid (although possibly empty) RPC_BUFFER returned.
Jeremy.
(This used to be commit d319cc9c08)
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
Günther Deschner
9f2e29799e r13864: Some cleanup and the samr set security object function client-side.
Guenther
(This used to be commit 0ae3fddf95)
2007-10-10 11:10:57 -05:00
Volker Lendecke
a787e2d124 r13841: Fix an uninitialized variable warning.
Jerry, this just fixes the warning. This routine does not seem to cope well
with !UNMARSHALLING. You might want to look...

Volker
(This used to be commit 2c0c40dfb5)
2007-10-10 11:10:56 -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
Gerald Carter
889ff32b5e r13824: * add api table for Xcv TCPMON and LOCALMON calls starting
with the "MonitorUI" call
* Fix some parsing errors

This gets us to the Add Port Wizard dialog.
(This used to be commit a444aa7f00)
2007-10-10 11:10:56 -05:00
Gerald Carter
e33b728c7b r13815: "Into the blind world let us now descend,"
Began the poet, his face as pale as death.
"I will go first, and you will follow me."
---

Adding XcvDataPort() to the spoolss code for remotely
add ports.  The design is to allow an intuitive means
of creating a new CUPS print queue from the Windows 2000/XP
APW without hacks like specifying the deviceURI in the
location field of the printer properties dialog.

Also set 'default devmode = yes' as the new default
since it causes no harm and only is executed when you
have a NULL devmode anyways.
(This used to be commit 123e478ce5)
2007-10-10 11:10:55 -05:00
Jeremy Allison
a7552e677e r13802: I *knew* ASU on sparc had to be good for *something* ! :-).
Fix incorrect size understanding of sid name type (yes it's
already correct in the Samba4 IDL :-).
Jeremy.
(This used to be commit 305a774d28)
2007-10-10 11:10:54 -05:00
Günther Deschner
e54786b535 r13711: * Correctly handle acb_info/acct_flags as uint32 not as uint16.
* Fix a couple of related parsing issues.
* in the info3 reply in a samlogon, return the ACB-flags (instead of
  returning zero)

Guenther
(This used to be commit 5b89e8bc24)
2007-10-10 11:10:25 -05:00
Jeremy Allison
115996503c r13585: Sorry Gunther, had to revert this. It's got a buffer
overrun. Spoke to Jerry about the correct fix. Will add
this after.
Jeremy.
(This used to be commit 33e13aabd3)
2007-10-10 11:10:16 -05:00
Günther Deschner
4ea92f3098 r13581: Correctly parse a non-null terminated, little-endian UCS2 string in the
PAC_LOGON_NAME structure. This was broken on big-endian machines
(Solaris SPARC and ppc). Fixes Bug #3330.

Jerry, this should be in 3.0.21c.

Guenther
(This used to be commit 9732490811)
2007-10-10 11:10:16 -05:00
Gerald Carter
2203bed32c r13576: This is the beginnings of moving the SAM_ACCOUNT data structure
to make full use of the new talloc() interface.  Discussed with Volker
and Jeremy.

* remove the internal mem_ctx and simply use the talloc()
  structure as the context.
* replace the internal free_fn() with a talloc_destructor() function
* remove the unnecessary private nested structure
* rename SAM_ACCOUNT to 'struct samu' to indicate the current an
  upcoming changes.  Groups will most likely be replaced with a
  'struct samg' in the future.

Note that there are now passbd API changes.  And for the most
part, the wrapper functions remain the same.

While this code has been tested on tdb and ldap based Samba PDC's
as well as Samba member servers, there are probably still
some bugs.  The code also needs more testing under valgrind to
ensure it's not leaking memory.

But it's a start......
(This used to be commit 19b7593972)
2007-10-10 11:10:15 -05:00
Gerald Carter
fb5362c069 r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
(This used to be commit b65be8874a)
2007-10-10 11:10:14 -05:00
Günther Deschner
6a6f2463f6 r13522: Add SAMR_GET_USRDOM_PWINFO client-side.
Guenther
(This used to be commit 290a581b75)
2007-10-10 11:10:09 -05:00
Jeremy Allison
8d5ef34aa3 r13521: Implement LOOKUPNAME3 and 4.
Jeremy.
(This used to be commit 6ec0e9124a)
2007-10-10 11:10:09 -05:00
Jeremy Allison
85160e654e r13458: Add parsing functions - but stub internals for lookupnames3 and 4.
Jeremy.
(This used to be commit f1a362580a)
2007-10-10 11:10:04 -05:00
Jeremy Allison
e22d38bdde r13455: Prepare to add lookupnames2.
Jeremy.
(This used to be commit 2274709587)
2007-10-10 11:10:04 -05:00
Jeremy Allison
06cf1e18e5 r13447: Added LSA_LOOKUPSIDS2 and LSA_LOOKUPSIDS3.
Jeremy.
(This used to be commit a164cfab42)
2007-10-10 11:10:03 -05:00
Günther Deschner
a48f4e832f r13445: We already made the decision whether to include the dominfo and
changereject.

Guenther
(This used to be commit 98d3c63e04)
2007-10-10 11:10:03 -05:00
Günther Deschner
e83c7d0141 r13442: Implement samr_chgpasswd_user3 server-side.
Guenther
(This used to be commit f60eddc0a4)
2007-10-10 11:10:03 -05:00
Jeremy Allison
e493d32912 r13439: Fix NET_SAM_LOGON_EX.
Jeremy.
(This used to be commit 9437ffc84f)
2007-10-10 11:10:02 -05:00
Jeremy Allison
74bc039f1e r13433: Get ready to implement NET_SAM_LOGON_EX.
Jeremy.
(This used to be commit 666b03b4a9)
2007-10-10 11:10:01 -05:00
Jeremy Allison
ad8b47a2ba r13407: Change the credentials code to be more like the Samba4 structure,
makes fixes much easier to port. Fix the size of dc->sess_key to
be 16 bytes, not 8 bytes - only store 8 bytes in the inter-smbd
store in secrets.tdb though. Should fix some uses of the dc->sess_key
where we where assuming we could read 16 bytes.
Jeremy.
(This used to be commit 5b3c2e63c7)
2007-10-10 11:09:59 -05:00
Jeremy Allison
cf7c47aac9 r13399: Get closer to passing RPC-SCHANNEL test.
Jeremy.
(This used to be commit 8ae70122b7)
2007-10-10 11:09:59 -05:00
Jeremy Allison
86358fc10b r13396: Add in userinfo26, re-enable userinfo25 - took the knowledge
from Samba4 on how to decode the 532 byte password buffers.
Getting closer to passing samba4 RPC-SCHANNEL test.
Jeremy.
(This used to be commit 205db6968a)
2007-10-10 11:09:59 -05:00
Jeremy Allison
1b14d3b697 r13386: Fix parsing of SAMR_Q_CONNECT_ANON.
Jeremy.
(This used to be commit 6f8334ad31)
2007-10-10 11:09:58 -05:00
Volker Lendecke
da979c9e7e r13350: Implement rpccli_samr_set_domain_info. Weird that it was not around :-)
Implement 'net rpc shell account' -- An editor for account policies

nt_time_to_unix_abs changed its argument which to me seems wrong, and I could
not find a caller that depends on this. So I changed it. Applied some more
const in time.c.

Volker
(This used to be commit fc73690a70)
2007-10-10 11:06:26 -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
Alexander Bokovoy
a02415bf36 r12935: After discussion with Volker fix bug #3397 using a variant of the patch by Alex Deiter (tiamat@komi.mts.ru).
Introduces level 9 of getuserinfo and allows to successfully install MS SMS2003
on a member of a Samba domain. Also added support for this level in rpcclient.

The code for infolevel 9 is modelled upon Samba-TNG by Alex Deiter.

Jerry, we need this in 3.0.21b.
(This used to be commit 93461646ce)
2007-10-10 11:06:08 -05:00
Gerald Carter
e7a1a0ead2 r12914: adding query/set ops for security descriptors on services.
(This used to be commit cefd2d7cb6)
2007-10-10 11:06:07 -05:00
Gerald Carter
7cd1af4a63 r12176: fix type mismatch after rpc structure change in rpc_svcctl.h
(This used to be commit ba67d3ae04)
2007-10-10 11:05:48 -05:00
Jeremy Allison
d1f91f7c72 r12043: It's amazing the warnings you find when compiling on a 64-bit
box with gcc4 and -O6...
Fix a bunch of C99 dereferencing type-punned pointer will break
strict-aliasing rules errors. Also added prs_int32 (not uint32...)
as it's needed in one place. Find places where prs_uint32 was being
used to marshall/unmarshall a time_t (a big no no on 64-bits).
More warning fixes to come.
Thanks to Volker for nudging me to compile like this.
Jeremy.
(This used to be commit c65b752604)
2007-10-10 11:05:42 -05:00
Günther Deschner
6ffd82ea77 r11964: rename flag to password_properties in SAM_UNK_INFO_1 because that's what
it is. (SAM_UNK_INFO_1 should get a better name as well).

Guenther
(This used to be commit d94aaeb625)
2007-10-10 11:05:40 -05:00
Günther Deschner
41eb1127fd r11963: add rpccli_samr_chgpasswd3 from samba4.
Guenther
(This used to be commit 0705fed566)
2007-10-10 11:05:40 -05:00
Günther Deschner
1b624b69bd r11858: Fill in the clientside TRUSTED_DOMAIN_INFO_EX query.
Guenther
(This used to be commit 02f13dee6d)
2007-10-10 11:05:31 -05:00
Günther Deschner
2770e98aec r11856: Replace unknown1 with group_attr.
Can anyone remember why we initialize groups only with 0x03 instead of 0x07 ?

Guenther
(This used to be commit 3282c7c458)
2007-10-10 11:05:30 -05:00
Günther Deschner
63addcb4d7 r11853: Add Dsr_GetSiteName (handy for experimenting with GPOs).
Guenther
(This used to be commit c54430a7b5)
2007-10-10 11:05:30 -05:00