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

124 Commits

Author SHA1 Message Date
Volker Lendecke
929e1d9920 r24809: Consolidate the use of temporary talloc contexts.
This adds the two functions talloc_stackframe() and talloc_tos().

 * When a new talloc stackframe is allocated with talloc_stackframe(), then
 * the TALLOC_CTX returned with talloc_tos() is reset to that new
 * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse
 * happens: The previous talloc_tos() is restored.
 *
 * This API is designed to be robust in the sense that if someone forgets to
 * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and
 * resets the talloc_tos().

The original motivation for this patch was to get rid of the
sid_string_static & friends buffers. Explicitly passing talloc context
everywhere clutters code too much for my taste, so an implicit
talloc_tos() is introduced here. Many of these static buffers are
replaced by a single static pointer.

The intended use would thus be that low-level functions can rather
freely push stuff to talloc_tos, the upper layers clean up by freeing
the stackframe. The more of these stackframes are used and correctly
freed the more exact the memory cleanup happens.

This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and
lp_talloc_ctx (did I forget any?)

So, never do a

tmp_ctx = talloc_init("foo");

anymore, instead, use

tmp_ctx = talloc_stackframe()

:-)

Volker
(This used to be commit 6585ea2cb7)
2007-10-10 12:30:24 -05: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
4ed5f70eed r23665: Remove two unneeded global variables
(This used to be commit 51a3933b3d)
2007-10-10 12:23:43 -05:00
Günther Deschner
7eb828135b r23627: Allow to pass down the lookup-level to rpccli_lsa_lookup_names().
Guenther
(This used to be commit e9a7512a9f)
2007-10-10 12:23:38 -05:00
Jeremy Allison
2e6deee020 r23400: Fix lsa crash bug #4683. The "names" enum struct
in a lookup_sidX reply isn't optional - like the
lookup_sidX query it needs to be defined in the
struct.
All this will go away with PIDL (thank goodness....).
Jerry - I think this is a showstopper to be merged
for 3.0.25b.
I'll be watching the build farm to see if anything broke.
Jeremy.
(This used to be commit 9300b92f7a)
2007-10-10 12:23:13 -05:00
Jeremy Allison
71ee55f98d r23080: Fix bug #4637 - we hads missed some cases where
we were calling PRS_ALLOC_MEM with zero count.
Jeremy.
(This used to be commit 9a10736e6f)
2007-10-10 12:22:43 -05:00
Gerald Carter
d34f6bb969 r22852: merge fixes for CVE-2007-2446 and CVE-2007-2447 to all branches
(This used to be commit f65214be68)
2007-10-10 12:22:02 -05:00
Jeremy Allison
61f95f1f97 r22585: Get us into a consistent state with TALLOC_ZERO_ARRAY also.
Jeremy.
(This used to be commit c622fb8536)
2007-10-10 12:19:47 -05:00
Jeremy Allison
138668d5d2 r22577: Change all of parse/*.c to use standard form. Fix some
marshalling bugs.
Jeremy.
(This used to be commit 3df99006f8)
2007-10-10 12:19:46 -05:00
Günther Deschner
1f3b19d569 r18678: Fix the build. (never commit before breakfeast).
Guenther
(This used to be commit e1e9b57ce2)
2007-10-10 12:00:46 -05:00
Volker Lendecke
8cfb182bdb r17136: Fix alignment on lsaquery. This broke in particular level 6, where the client
tried to figure out which role we are.

Needs to go into 23a.

Thanks to Karolin for insisting and setting up the test case :-)

Volker
(This used to be commit 3482bb1ef5)
2007-10-10 11:38:14 -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
96a54e7d23 r16369: Klocwork #1035.
Jeremy.
(This used to be commit 6924d1cd44)
2007-10-10 11:18:49 -05:00
Jeremy Allison
9a38c05154 r15884: Fix bug #3803 from jason@ncac.gwu.edu - bad comparison.
Jeremy.
(This used to be commit 1d9dbe3b66)
2007-10-10 11:17:11 -05:00
Günther Deschner
655b04e4f8 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
(This used to be commit 0fed66926f)
2007-10-10 11:15:59 -05:00
Jeremy Allison
4d9ad70060 r14774: Fix null deref coverity bugs #260, #261, #262.
Jeremy.
(This used to be commit 46e575af17)
2007-10-10 11:15:47 -05:00
Volker Lendecke
2a7601fcb4 r14134: Fix Coverity bug # 137
(This used to be commit 62e58d939b)
2007-10-10 11:15:13 -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
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
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
James Peach
8c072021ef r9780: Clean up a bunch of compiler warnings.
(This used to be commit 623d2e6931)
2007-10-10 11:03:26 -05:00
Günther Deschner
4bc39f05b7 r7391: - Added client-support for various lsa_query_trust_dom_info-calls and a
rpcclient-tester for some info-levels.

  Jerry, I tried to adopt to prs_pointer() where possible and to not
  interfere with your work for usrmgr.

- Add "net rpc trustdom vampire"-tool.

  This allows to retrieve Interdomain Trust(ed)-Relationships from
  NT4-Servers including cleartext-passwords (still stored in the local
  secrets.tdb).

  The net-hook was done in cooperation with Lars Mueller
  <lmuelle@suse.de>.

  To vampire trusted domains simply call:

        net rpc trustdom vampire -S nt4dc -Uadmin%pass

Guenther
(This used to be commit 5125852939)
2007-10-10 10:57:07 -05:00
Gerald Carter
f24d88cf9d r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1
(This used to be commit 9727d05241)
2007-10-10 10:57:02 -05:00
Gerald Carter
b137b7cc47 r6228: remove BUFHDR2 and clean up LsaEnumTrustedDomains()
Tested client and server code.
(This used to be commit efb3ac4c69)
2007-10-10 10:56:30 -05:00
Gerald Carter
0aa89db947 r6071: * clean up UNISTR2_ARRAY ( really just an array of UNISTR4 + count )
* add some backwards compatibility to 'net rpc rights list'
* verify privilege name in 'net rpc rights privileges <name>' in order
  to give back better error messages.
(This used to be commit 0e29dc8aa3)
2007-10-10 10:56:20 -05:00
Gerald Carter
5d1cb8e79e r6014: rather large change set....
pulling back all recent rpc changes from trunk into
3.0.  I've tested a compile and so don't think I've missed
any files.  But if so, just mail me and I'll clean backup
in a couple of hours.

Changes include \winreg, \eventlog, \svcctl, and
general parse_misc.c updates.

I am planning on bracketing the event code with an
#ifdef ENABLE_EVENTLOG until I finish merging Marcin's
changes (very soon).
(This used to be commit 4e0ac63c36)
2007-10-10 10:56:15 -05:00
Gerald Carter
66df8431ec r5726: merge LsaLookupPrivValue() code from trunk
(This used to be commit 277203b535)
2007-10-10 10:55:57 -05:00
Volker Lendecke
c23c9bfd67 r5125: Fix bug 2113 -- thanks to jason@ncac.gwu.edu
(This used to be commit 0c205bcc86)
2007-10-10 10:55:28 -05:00
Gerald Carter
ff90927478 r4746: add server support for lsa_enum_acct_rights(); last checkin for the night
(This used to be commit ccdff4a998)
2007-10-10 10:53:54 -05:00
Gerald Carter
c727866172 r4742: add server support for lsa_add/remove_account_rights() and fix some parsing bugs related to that code
(This used to be commit 7bf1312287)
2007-10-10 10:53:53 -05:00
Gerald Carter
d94d87472c r4724: Add support for Windows privileges in Samba 3.0
(based on Simo's code in trunk).  Rewritten with the
following changes:

* privilege set is based on a 32-bit mask instead of strings
  (plans are to extend this to a 64 or 128-bit mask before
   the next 3.0.11preX release).
* Remove the privilege code from the passdb API
  (replication to come later)
* Only support the minimum amount of privileges that make
  sense.
* Rewrite the domain join checks to use the SeMachineAccountPrivilege
  instead of the 'is a member of "Domain Admins"?' check that started
  all this.

Still todo:

* Utilize the SePrintOperatorPrivilege in addition to the 'printer admin'
  parameter
* Utilize the SeAddUserPrivilege for adding users and groups
* Fix some of the hard coded _lsa_*() calls
* Start work on enough of SAM replication to get privileges from one
  Samba DC to another.
* Come up with some management tool for manipultaing privileges
  instead of user manager since it is buggy when run on a 2k client
  (haven't tried xp).  Works ok on NT4.
(This used to be commit 77c10ff9aa)
2007-10-10 10:53:51 -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
8ad3d8c9b0 r196: merging struct uuid from trunk
(This used to be commit 911a28361b)
2007-10-10 10:51:13 -05:00
Andrew Bartlett
614c18d24b rpc_client/cli_lsarpc.c:
rpc_parse/parse_lsa.c:
nsswitch/winbindd_rpc.c:
nsswitch/winbindd.h:
 - Add const

libads/ads_ldap.c:
 - Cleanup function for use

nsswitch/winbindd_ads.c:
 - Use new utility function ads_sid_to_dn
 - Don't search for 'dn=', rather call the ads_search_retry_dn()

nsswitch/winbindd_ads.c:
include/rpc_ds.h:
rpc_client/cli_ds.c:
 - Fixup braindamage in cli_ds_enum_domain_trusts():
    - This function was returning a UNISTR2 up to the caller, and
      was doing nasty (invalid, per valgrind) things with memcpy()
    - Create a new structure that represents this informaiton in a useful way
      and use talloc.

Andrew Bartlett
(This used to be commit 06c3f15aa1)
2004-01-05 02:04:37 +00:00
Jeremy Allison
764c03b9b8 Tut tut - always run with max warnings on gcc...
Jeremy.
(This used to be commit 3ebbd67dec)
2003-10-07 05:06:58 +00:00
Simo Sorce
b1f610ebb1 split some security related functions in their own files.
(no need to include all of smbd files to use some basic sec functions)

also minor compile fixes
couldn't compile to test these due to some kerberos problems wirh 3.0,
but on HEAD they're working well, so I suppose it's ok to commit
(This used to be commit c78f2d0bd1)
2003-10-06 01:38:46 +00:00
Jeremy Allison
d3b9384308 Fix for #480. Change the interface for init_unistr2 to not take a length
but a flags field. We were assuming that 2*strlen(mb_string) == length of ucs2-le string.
This is not the case. Count it after conversion.
Jeremy.
(This used to be commit f82c273a42)
2003-09-25 21:26:16 +00:00
Jim McDonough
8c64504f7c Update my copyrights according to my agreement with IBM
(This used to be commit a2bd8f0bfa)
2003-08-01 15:30:44 +00:00
Jeremy Allison
ead7ad7f80 Fix debug message merge.
Jeremy.
(This used to be commit d6f2316642)
2003-06-03 07:21:09 +00:00
Andrew Bartlett
e88eab35bc Merge from HEAD:
signed/unsigned (mostly i counters)

a little bit of const.

Andrew Bartlett
(This used to be commit 50f0ca752e)
2003-03-17 23:04:03 +00:00
Jeremy Allison
438b5c92d4 Merge tridge's client priv code from HEAD.
Jeremy
(This used to be commit 49739be1e2)
2003-01-29 02:24:12 +00:00
Jeremy Allison
734c6d8a51 Merging tridge's privillage client changes from HEAD.
Jeremy.
(This used to be commit 30a33920b4)
2003-01-28 21:09:56 +00:00
Gerald Carter
4242eda183 merging some rpcclient and net functionality from HEAD
(This used to be commit 7a4c874842)
2003-01-15 17:22:48 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Jelmer Vernooij
b2edf254ed sync 3.0 branch with head
(This used to be commit 3928578b52)
2002-08-17 17:00:51 +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