1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

1725 Commits

Author SHA1 Message Date
Volker Lendecke
c6bf2c8922 r15570: Fix Coverity bug # 286. I really wonder why gcc -O1 did not catch this one.
Volker
2007-10-10 11:17:02 -05:00
Günther Deschner
870495e2c8 r15455: Add rpccli_samr_query_dom_info2() and return the comment string in
samr_query_domain_info(2) for consistency reasons.

Guenther
2007-10-10 11:16:48 -05:00
Günther Deschner
3e181b46be r15454: As testing, documentation and samba4 idl indicate that there is no known
difference between samr_query_domain_info and samr_query_domain_info2,
wrap the info2 call around the info call. There have been various "could
not access LDAP when not root" bugs lurking around in
samr_query_domain_info2 anyway.

Guenther
2007-10-10 11:16:48 -05:00
Günther Deschner
6ed7d7fa70 r15452: Again purely cosmetic reformat of the samr query domain info calls.
Guenther
2007-10-10 11:16:47 -05:00
Günther Deschner
41b72e77ae r15442: Add some more client rpc for the querydominfo calls (from samba4 idl).
Also return the hostname for the level 6 call (to be consistent with the
server name in level 2).

Guenther
2007-10-10 11:16:44 -05:00
Günther Deschner
26dd22c9af r15438: Fix samrQueryDomainInfo level 5 where we returned our netbios
name eversince instead of the domain name when we are a DC.

Yes, there are applications relying on this call to be correct.

Guenther
2007-10-10 11:16:43 -05:00
Gerald Carter
a02933c958 r15380: default eventlog tdbs to mode 0660 to allow easier access by BUILTIN\Administrators 2007-10-10 11:16:38 -05:00
Jeremy Allison
9f676603aa r15334: Fix warning. This table and function not used anymore. Jerry please
check.
Jeremy.
2007-10-10 11:16:36 -05:00
Gerald Carter
037f9f831e r15309: normalize printing keys when deleting 2007-10-10 11:16:34 -05:00
Jeremy Allison
93ca3eee55 r15129: Separate out mechanism and policy for NTLMSSP auth/sign/seal.
With this change (and setting lanman auth = no in smb.conf)
we have *identical* NTLMSSP flags to W2K3 in SPNEGO auth.
Jeremy
2007-10-10 11:16:25 -05:00
Volker Lendecke
b9c6e3f556 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
2007-10-10 11:16:23 -05:00
Günther Deschner
3ff278b852 r15044: Fix the build. (void returning non-void).
Guenther
2007-10-10 11:15:59 -05:00
Günther Deschner
0fed66926f r15041: Adding rpc client calls to manipulate auditing policies on remote CIFS
servers. Also add a new "net rpc audit" tool. The lsa query infolevels
were taken from samb4 IDL, the lsa policy flags and categories are
partly documented on msdn. I need to cleanup the double
lsa_query_info_policy{2}{_new} calls next.

Guenther
2007-10-10 11:15:59 -05:00
Jeremy Allison
0217f7d7bf r14788: Fix coverity bug #276. null deref.
Jeremy.
2007-10-10 11:15:48 -05:00
Jeremy Allison
363d31c9ec r14786: Fix coverity #275. null deref.
Jeremy.
2007-10-10 11:15:48 -05:00
Günther Deschner
6c4fe819c6 r14646: Adding samr querygroup infolevels 2 & 5.
Guenther
2007-10-10 11:15:42 -05:00
Gerald Carter
db1162241f r14634: Many bug fixes thanks to train rides and overnight stays in airports
* Finally fix parsing idmap uid/gid ranges not to break with spaces
  surrounding the '-'
* Allow local groups to renamed by adding info level 2 to
  _samr_set_aliasinfo()
* Fix parsing bug in _samr_del_dom_alias() reply
* Prevent root from being deleted via Samba
* Prevent builting groups from being renamed or deleted
* Fix bug in pdb_tdb that broke renaming user accounts
* Make sure winbindd is running when trying to create the Administrators
  and Users BUILTIN groups automatically from smbd (and not just check the
  winbind nexted groups parameter value).
* Have the top level rid allocator verify that the RID it is about to
  grant is not already assigned in our own SAM (retries up to 250 times).
  This fixes passdb with existing SIDs assigned to users from the RID algorithm
  but not monotonically allocating the RIDs from passdb.
2007-10-10 11:15:41 -05:00
Günther Deschner
3f195f8248 r14597: Merge DCERPC_FAULT constants from Samba 4.
Guenther
2007-10-10 11:15:38 -05:00
Gerald Carter
69f816e9f8 r14482: Fixes for spoolss code (after coverity fixes) when the
client sends a NULL RPC_BUFFER*
2007-10-10 11:15:33 -05:00
Gerald Carter
57c705ea63 r14450: Fix more get_md4pw() breakage caused by missing "breaks"
in the switch statement which matched the schannel type
against the account type.
2007-10-10 11:15:30 -05:00
Gerald Carter
a36529535d r14448: * protect against NULL cli_state* pointers in cli_rpc_pipe_open()
* Fix inverted logic check for machine accounts in get_md4pw()
2007-10-10 11:15:30 -05:00
Günther Deschner
c35eb44937 r14443: rework get_md4pw() to ease debugging. The only functional change is that
we now check wheter the sec_channel_type matches the trust account type.

Guenther
2007-10-10 11:15:30 -05:00
Gerald Carter
612979476a r14403: * modifies create_local_nt_token() to create a BUILTIN\Administrators
group IFF sid_to_gid(S-1-5-32-544) fails and 'winbind nested groups = yes'

* Add a SID domain to the group mapping enumeration passdb call
  to fix the checks for local and builtin groups.  The SID can be
  NULL if you want the old semantics for internal maintenance.
  I only updated the tdb group mapping code.

* remove any group mapping from the tdb that have a
  gid of -1 for better consistency with pdb_ldap.c.
  The fixes the problem with calling add_group_map() in
  the tdb code for unmapped groups which might have had
  a record present.

* Ensure that we distinguish between groups in the
  BUILTIN and local machine domains via getgrnam()
  Other wise BUILTIN\Administrators & SERVER\Administrators
  would resolve to the same gid.

* Doesn't strip the global_sam_name() from groups in the
  local machine's domain (this is required to work with
  'winbind default domain' code)

Still todo.

* Fix fallback Administrators membership for root and domain Admins
  if nested groups = no or winbindd is not running

* issues with "su - user -c 'groups'" command

* There are a few outstanding issues with BUILTIN\Users that
  Windows apparently tends to assume.  I worked around this
  presently with a manual group mapping but I do not think
  this is a good solution.  So I'll probably add some similar
  as I did for Administrators.
2007-10-10 11:15:28 -05:00
Jeremy Allison
cd3ad3f1a6 r14395: Fix coverity bug #55. Ensure no unsigned/signed comparisons.
Jeremy.
2007-10-10 11:15:28 -05:00
Jeremy Allison
f65d7afe19 r14387: Try and fix the coverity issues (#53, #54) with negative
sink by ensuring all uses of rpcstr_push are consistent
with a size_t dest size arg.
Jeremy.
2007-10-10 11:15:27 -05:00
Jeremy Allison
338538410d r14353: Fix coverity bugs #61 and #62. Remember to divide by
the size of the data table. Clean up the struct a little.
Jeremy.
2007-10-10 11:15:26 -05:00
Jeremy Allison
1fece52da4 r14338: Fix coverity #55 by explicit cast.
Jeremy.
2007-10-10 11:15:25 -05:00
Jeremy Allison
f71aa3ab8f r14303: Fix coverity #223. In a loop we were forgetting to free
resources on error exit path.
Jeremy.
2007-10-10 11:15:24 -05:00
Jeremy Allison
f1a5e5aefe r14301: Fix coverity #224. In a loop we were forgetting to free
resources on error exit path.
Jeremy.
2007-10-10 11:15:24 -05:00
Jeremy Allison
1c0b4ed0ac r14299: Fix coverity #225. In a loop we were forgetting to free
resources on error exit path.
Jeremy.
2007-10-10 11:15:24 -05:00
Jeremy Allison
d9e1d6fed0 r14289: Fix coverity #101, resource leak on error code path.
Jeremy.
2007-10-10 11:15:23 -05:00
Jeremy Allison
f458596b0e r14286: Similar clarifiction fix for coverity #102.
Jeremy.
2007-10-10 11:15:23 -05:00
Jeremy Allison
6621acc68f r14284: Fix coverity bug #103. Make code clearer - probably
not a real issue but this code is easier to read.
Jeremy.
2007-10-10 11:15:23 -05:00
Jeremy Allison
5f74e56b86 r14268: Fix coverity error #204. Resource leak on error path.
Jeremy.
2007-10-10 11:15:22 -05:00
Jeremy Allison
23d69758bb r14266: Fix coverity #205. Resource leak on error path.
Jeremy.
2007-10-10 11:15:21 -05:00
Jeremy Allison
0429b6e8c3 r14264: Fix coverity #207. Resource leak on error path.
Jeremy.
2007-10-10 11:15:21 -05:00
Jeremy Allison
ca96c7be77 r14250: Fix coverity bug #107. Resource leak on error path.
Jeremy.
2007-10-10 11:15:20 -05:00
Volker Lendecke
0dc3030bce r14233: Fix Coverity bug # 206 2007-10-10 11:15:18 -05:00
Volker Lendecke
e9a63e3b35 r14226: Fix Coverity bug # 109 2007-10-10 11:15:18 -05:00
Jeremy Allison
e3a28bf4c8 r14182: Ensure we know that dom_sid cannot be null.
Jeremy.
2007-10-10 11:15:15 -05:00
Jeremy Allison
e83515afd2 r14178: Clarify code for Coverity #49. Ensure we know we
can't have an uninitialized *returned val.
Jeremy.
2007-10-10 11:15:15 -05:00
Jeremy Allison
daa919a94b r14031: Coverity bug CID #110. Free all resources correctly
on pipe initialization failure.
Jeremy.
2007-10-10 11:11:06 -05:00
Jeremy Allison
d993797191 r13994: Belt and braces - ensure RPC_BUFFER is valid.
Jeremy.
2007-10-10 11:11:03 -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
c803e1b2af r13878: move PORT_DATA_1 to use static sized UNICODE strings as per MSDN 2007-10-10 11:10:57 -05:00
Gerald Carter
6d74de7a67 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
2007-10-10 11:10:56 -05:00
Gerald Carter
a444aa7f00 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.
2007-10-10 11:10:56 -05:00
Gerald Carter
a34ab5c827 r13821: replacing some strings with macros 2007-10-10 11:10:56 -05:00
Gerald Carter
ba9cdd88a0 r13820: * Start fleshing out the XcvDataPort() server implementation
* Add support for the "Local Port" monitor as well through this API
2007-10-10 11:10:55 -05:00
Gerald Carter
123e478ce5 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.
2007-10-10 11:10:55 -05:00