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

109 Commits

Author SHA1 Message Date
Jelmer Vernooij
e89be1bf44 r24817: Don't REG_NONE for all value types. Patch from
Andrew Kroeger <andrew@sprocks.gotdns.com>
(This used to be commit ff81ea3f5a)
2007-10-10 15:03:15 -05:00
Jelmer Vernooij
f8c373fd6a r24727: Initialize variable.
(This used to be commit 925fcc3366)
2007-10-10 15:02:58 -05:00
Jelmer Vernooij
5d518417f8 r24726: Add tests for getting/setting security descriptors (still failing at the moment)
(This used to be commit ecdfaf56c0)
2007-10-10 15:02:57 -05:00
Jelmer Vernooij
b409d4120f r24667: Finally merge the registry improvements that Wilco Baan Hofman and I have
been working on for at least half a year now. Contains the following
improvements:

 * proper layering (finally!) for the registry library. Distinction is
   now made between 'real' backends (local, remote, wine, etc) and
   the low-level hive backends (regf, creg, ldb, ...) that are only used
   by the local registry backend
 * tests for all important hive and registry operations
 * re-enable RPC-WINREG tests (still needs more work though, as
							   some return values aren't checked yet)
 * write support for REGF files
 * dir backend now supports setting/reading values, creating keys
 * support for storing security descriptors
 * remove CREG backend as it was incomplete, didn't match the data model
   and wasn't used at all anyway
 * support for parsing ADM files as used by the policy editor (see lib/policy)
 * support for parsing PREG files (format used by .POL files)
 * new streaming interface for registry diffs (improves speed and memory usage
	for regdiff/regpatch significantly)

   ... and fixes a large number of bugs in the registry code
(This used to be commit 7a1eec6358)
2007-10-10 15:02:34 -05:00
Andrew Tridgell
0479a2f1cb r23792: convert Samba4 to GPLv3
There are still a few tidyups of old FSF addresses to come (in both s3
and s4). More commits soon.
(This used to be commit fcf38a38ac)
2007-10-10 14:59:12 -05:00
Jelmer Vernooij
64e88a8ccf r20850: Prefix all server calls with dcesrv_
(This used to be commit 76c78b0339)
2007-10-10 14:43:39 -05:00
Andrew Tridgell
443a22b7f7 r18860: fixed some code that bitrotted while we didn't have the safety check
with NTSTATUS, WERROR etc.
(This used to be commit fddb85bfa8)
2007-10-10 14:20:16 -05:00
Andrew Tridgell
655b710204 r18584: found one of the fd leaks. The registry backend was using a
talloc(NULL, xxx) to allocate the registry context. That had two
consequences

1) it was a massive memory leak, as all winreg operations leaked their
   entire context (including an open ldb database) every time

2) event_context_find() never found the exsting event context, so we
   used a new event context each time, which called epoll_create()
   each time, which caused a fd to be allocated
(This used to be commit 1c0a3de398)
2007-10-10 14:18:52 -05:00
Andrew Tridgell
6adb5717f5 r18566: fixed the winreg pipe and winreg tests
Jerry, there is a big difference on the wire between these two:

  [out] uint32 x;
and
  [out] uint32 *x;

if you change from

  [out] uint32 x;

then you need to change to:

  [out,ref] uint32 *x;

otherwise it changes the format on the wire, which means we are no
longer compatible with MS servers.

but be aware that even if you change to a ref ptr, you also need to
change all the client code to set all the return variables in the out
part of the structure. That's why I don't like the MIDL restriction of
forcing the use of ref pointers for output variables - it makes life
much harder when writing client code, and makes the code much more
error prone (just look at all the extra code needed to make this work
again).

I know we could auto-allocate these variables in the generated client
side NDR code, but if we did that then we would have no way of doing a
_real_ ref out pointer, which we really wanted to set to some already
allocated variable.

So please hold off on changing our idl to use the MIDL convention for
output variables until Jelmer and I have had a good "chat" about this :-)
(This used to be commit 555aed43ba)
2007-10-10 14:18:47 -05:00
Gerald Carter
dce0c9e4fd r18561: Fix [out] pointers in winreg IDL
(This used to be commit 694677dafe)
2007-10-10 14:18:46 -05:00
Andrew Tridgell
f6d98fe853 r18330: don't mix pointer types in RPC replies
(This used to be commit cc86719f53)
2007-10-10 14:18:10 -05:00
Jelmer Vernooij
cf0f4ec073 r15358: Fix some compiler warnings / type safety. Found by tcc
(This used to be commit 12ba42de58)
2007-10-10 14:05:25 -05:00
Jelmer Vernooij
d64ccc0176 r14599: Pass ACLs down the registry layer.
(This used to be commit 6cdefd8945)
2007-10-10 13:58:59 -05:00
Jelmer Vernooij
8528016978 r14464: Don't include ndr_BASENAME.h files unless strictly required, instead
try to include just the BASENAME.h files (containing only structs)
(This used to be commit 3dd477ca51)
2007-10-10 13:57:27 -05:00
Tim Potter
9759d435ca r11261: Rename access_required field in winreg idl to access_mask so it matches
the other interfaces.
(This used to be commit 8eb582b578)
2007-10-10 13:45:09 -05:00
Jelmer Vernooij
ff7342a4ad r10026: Move registry header file to lib/registry
Add support for showing security descriptor in regshell
Add support for saving files in NT4 registry backend
(This used to be commit 47cecd4726)
2007-10-10 13:36:30 -05:00
Jelmer Vernooij
02b3abec25 r10007: Merge data_blk and data_len member of registry_value into a DATA_BLOB.
Fix handling of REG_DWORD in the LDB backend.
Fix a couple of warnings
(This used to be commit 709fdc7ebf)
2007-10-10 13:36:28 -05:00
Andrew Tridgell
649882d8d5 r9567: fixed the winreg IDL for CreateKey, including a security
descriptor. To keep it simple I just use normal IDL buffers for now,
avoiding the complex methods metze used in spoolss. We might change
that later

Also added decoding of the security_descriptor in
winreg_GetKeySecurity() in smbtorture
(This used to be commit 439f34a962)
2007-10-10 13:34:29 -05:00
Andrew Tridgell
d5edfef325 r9410: - a winreg_CloseKey() should return a zero key on success (zeroing the
callers key). This is the normal pattern with rpc handles.

- fixed reference to undefined error variable in winreg_DeleteKey()
(This used to be commit 6757d51a28)
2007-10-10 13:33:35 -05:00
Andrew Tridgell
71f34f401e r9388: we should fault bad handles given to winreg_GetVersion()
(This used to be commit 00e55be9ef)
2007-10-10 13:33:32 -05:00
Andrew Tridgell
0d425487da r9359: don't check for size overflow if value is NULL
this gets viewing the product options in smbd HKLM from w2k3 regedit
working
(This used to be commit 17f3250dd6)
2007-10-10 13:33:28 -05:00
Andrew Tridgell
a152245a99 r9358: - opening a winreg key of "" is the same as re-opening the hive. The
w2k3 regedit does this.

- w2k3 expects null termination is string lengths
(This used to be commit bcef9e592a)
2007-10-10 13:33:27 -05:00
Andrew Tridgell
9fffd12799 r9338: fixed the winreg IDL to be correct for the EnumKey and EnumValue
calls. The previous IDL was just a workaround for the limitations of
our older rpc infrastructure. Now that Jelmer has added much improved
string support using the charset keyword we can correctly implemenent
the unusual winreg string buffers.

Jelmer, note the little comment I put on winreg_StringBuf() about why
I couldn't use [value()] for the length field.

This also fixes EnumKey() and EnumValue() to use NTTIME fields for the
last_changed_time. I don't know why we were using a pair of uint32's,
as it is just a NTTIME.
(This used to be commit 8354b01612)
2007-10-10 13:33:25 -05:00
Tim Potter
7c8c36ea15 r9284: Whitespace. (-:
(This used to be commit 6a7922a02c)
2007-10-10 13:33:21 -05:00
Andrew Tridgell
e82aad1ce3 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
(This used to be commit 9db6c79e90)
2007-10-10 13:09:38 -05:00
Andrew Tridgell
759da3b915 r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the
large commit. I thought this was worthwhile to get done for
consistency.
(This used to be commit ec32b22ed5)
2007-10-10 13:09:15 -05:00
Andrew Tridgell
577218b2ad r4640: first stage in the server side support for multiple context_ids on one pipe
this stage does the following:

 - simplifies the dcerpc_handle handling, and all the callers of it

 - split out the context_id depenent state into a linked list of established contexts

 - fixed some talloc handling in several rpc servers that i noticed while doing the above
(This used to be commit fde042b3fc)
2007-10-10 13:08:38 -05:00
Jelmer Vernooij
efdf83f4a6 r4213: Store REG_SZ in UTF16, not the unix charset..
It is now possible to use the "Add..." button in the Security
tab of the File Properties Dialog box.
(This used to be commit 9fa25260d3)
2007-10-10 13:07:27 -05:00
Jelmer Vernooij
d8c3428b3b r4209: Fix several smaller bugs
Add "predef" and "set" commands in regshell

Some of the remote calls from a Windows box work now.
(This used to be commit f3e0578280)
2007-10-10 13:07:27 -05:00
Jelmer Vernooij
1a340869c4 r4204: Arguments to reg_del_key more like the RPC for more efficient usage
Fix small bug in regpatch
Fix segfault in regshell cmdline completion
Implement set_value and del_value in ldb backend
(This used to be commit 8e2aa58abe)
2007-10-10 13:07:26 -05:00
Jelmer Vernooij
1971d529b4 r4168: Implement QueryValue in the server
IDL for NotifyChangeKeyValue
(This used to be commit a402142431)
2007-10-10 13:07:21 -05:00
Jelmer Vernooij
47fa1d33e4 r4166: More small API fixes, keep registry structs as small as possible.
Implement DelValue in the RPC server
(This used to be commit f6b9ec89af)
2007-10-10 13:07:21 -05:00
Jelmer Vernooij
969e14eae9 r4155: More destinction between hives and predefined keys
(This used to be commit c37d6f3c58)
2007-10-10 13:07:20 -05:00
Jelmer Vernooij
6cf13f4d72 r4154: Add definitions for HKEY_PERFORMANCE_TEXT and HKEY_PERFORMANCE_NLSTEXT
Hives and predefined keys (HKEY_*) are not necessarily the same thing.
(This used to be commit 217e4e5841)
2007-10-10 13:07:19 -05:00
Jelmer Vernooij
444a867924 r4132: - Bunch of rather large fixes in the registry
- Added some README files

Not everything works yet, e.g. the EnumValue test appears to be broken.
(This used to be commit c169e86c1f)
2007-10-10 13:06:29 -05:00
Andrew Tridgell
b71dba6a76 r4118: don't assume that "unsigned int" is the same type as uint32_t
(This used to be commit 1ddab01d2a)
2007-10-10 13:06:28 -05:00
Andrew Tridgell
3c70b82f42 r4117: fixed EnumValue in winreg server
(This used to be commit f2f21033b6)
2007-10-10 13:06:28 -05:00
Jelmer Vernooij
4b533a9070 r4106: Add full name of two more hives
(This used to be commit c1023db5e8)
2007-10-10 13:06:27 -05:00
Andrew Tridgell
c051779a0a r3468: split out dcerpc_server.h
(This used to be commit 729e0026e4)
2007-10-10 13:05:17 -05:00
Andrew Tridgell
a42142439a r3464: split out registry.h, rap.h and ldap_server.h
(This used to be commit 70d2090f6b)
2007-10-10 13:05:17 -05:00
Andrew Tridgell
90067934cd r3428: switched to using minimal includes for the auto-generated RPC code.
The thing that finally convinced me that minimal includes was worth
pursuing for rpc was a compiler (tcc) that failed to build Samba due
to reaching internal limits of the size of include files. Also the
fact that includes.h.gch was 16MB, which really seems excessive. This
patch brings it back to 12M, which is still too large, but
better. Note that this patch speeds up compile times for both the pch
and non-pch case.

This change also includes the addition iof a "depends()" option in our
IDL files, allowing you to specify that one IDL file depends on
another. This capability was needed for the auto-includes generation.
(This used to be commit b8f5fa8ac8)
2007-10-10 13:05:09 -05:00
Jelmer Vernooij
9dc3f789c4 r3369: More registry updates
We now pass the RPC-WINREG torture test.
Also, constructions like the following work now:

regtree <-> smbd <-> NTUSER.DAT
(This used to be commit df952e95cd)
2007-10-10 13:05:02 -05:00
Jelmer Vernooij
a29c24f180 r3367: More registry updates.
Add support flush_key and close_hive.
(This used to be commit c526273df2)
2007-10-10 13:05:02 -05:00
Jelmer Vernooij
7ce7137ad4 r3348: More registry fixes and additions. The following functions work right now against samba 4, at least with a ldb backend:
winreg_Open*
winreg_OpenKey
winreg_EnumKey
winreg_DeleteKey
winreg_CreateKey
(This used to be commit a71d51dd3b)
2007-10-10 13:04:58 -05:00
Jelmer Vernooij
479bf22c81 r3340: Various fixes in the registry code. Implement the EnumKey call
in the server.
(This used to be commit da65a248c2)
2007-10-10 13:04:57 -05:00
Jelmer Vernooij
858f176322 r3338: More work on the winreg RPC server. Opening hives is now supported, most other calls
return WERR_NOT_SUPPORTED for now.

Hive backends can be set like this:

registry:HKEY_LOCAL_MACHINE = ldb:tdb://registry.tdb
registry:HKEY_CURRENT_USER = gconf
registry:HKEY_USERS = dir:/tmp/registry
registry:HKEY_CLASSES_ROOT = nt4:/path/to/NTUSER.DAT
registry:HKEY_PERFORMANCE_DATA = w95:/path/to/USER.DAT
(This used to be commit 42844a4e34)
2007-10-10 13:04:57 -05:00
Jelmer Vernooij
fc3c05e63f r2696: DCOM updates:
- Start working on OXIDResolver interface
 - Add torture test for SimplePing()
(This used to be commit b54d14a01a)
2007-10-10 12:59:24 -05:00
Andrew Tridgell
d79c7d41da r2627: use the new talloc capabilities in a bunch more places in the rpc
server code. This fixes a number of memory leaks I found when testing
with valgrind and smbtorture, as the cascading effect of a
talloc_free() ensures that anything derived from the top level object
is destroyed on disconnect.
(This used to be commit 76d0b8206c)
2007-10-10 12:59:13 -05:00
Jelmer Vernooij
a3e321d735 r2519: Registry RPC pipe fixes (use struct registry_key instead of REG_KEY, etc)
(This used to be commit 00de28876d)
2007-10-10 12:59:01 -05:00
Andrew Tridgell
d2ea763761 r465: we need common.h in two more rpc server pipes
(This used to be commit d96b68169a)
2007-10-10 12:51:44 -05:00
Andrew Tridgell
21e6b1531b r464: a big improvement to the API for writing server-side RPC
servers. Previously the server pipe code needed to return the RPC
level status (nearly always "OK") and separately set the function call
return using r->out.result. All the programmers writing servers
(metze, jelmer and me) were often getting this wrong, by doing things
like "return NT_STATUS_NO_MEMORY" which was really quite meaningless
as there is no code like that at the dcerpc level.

I have now modified pidl to generate the necessary boilerplate so that
just returning the status you want from the function will work. So for
a NTSTATUS function you return NT_STATUS_XXX and from a WERROR
function you return WERR_XXX. If you really want to generate a DCERPC
level fault rather than just a return value in your function then you
should use the DCESRV_FAULT() macro which will correctly generate a
fault for you.

As a side effect, this also adds automatic type checking of all of our
server side rpc functions, which was impossible with the old API. When
I changed the API I found and fixed quite a few functions with the
wrong type information, so this is definately useful.

I have also changed the server side template generation to generate a
DCERPC "operation range error" by default when you have not yet filled
in a server side function. This allows us to correctly implement
functions in any order in our rpc pipe servers and give the client the
right information about the fault.
(This used to be commit a4df5c7cf8)
2007-10-10 12:51:44 -05:00
Stefan Metzmacher
f517d6b7ae r424: let this code compile on every machine hopefully
metze
(This used to be commit 3e911db7c2)
2007-10-10 12:51:37 -05:00
Tim Potter
f3d3b3c809 r355: Fix a bunch of compiler warnings in the registry code.
(This used to be commit 0be7a866dc)
2007-10-10 12:51:34 -05:00
Jelmer Vernooij
aebfb3b9f4 r128: Another registry update. Changes:
- Start with the LDB backend
- The API is now more windows-like, which should make it easier to use
  in rpc_server
- Added a GTK+ front-end
- Added some more IDL

More updates will follow, especially in the RPC field..
(This used to be commit 3adffa0217)
2007-10-10 12:51:09 -05:00
Stefan Metzmacher
8709182fd3 r126: - add first srvsvc and wkssvc server side stuff
- we know can browse the server via the Windows Explorer

- some little fixes to the winreg server pipe

metze
(This used to be commit 6f213a3494)
2007-10-10 12:51:09 -05:00
Jelmer Vernooij
f9235e0964 r62: Fix the build
(This used to be commit 1396db8537)
2007-10-10 12:50:41 -05:00
Jelmer Vernooij
b96025eb15 r61: - Implement first call in the winreg rpc server
- Add some initial implementation of the ldb backend
- More checks in the winreg torture test
(This used to be commit ae2b63b6f1)
2007-10-10 12:50:41 -05:00
Jelmer Vernooij
69c19afb62 r31: More registry updates. regdiff/regpatch work now.
(This used to be commit 98224f5436)
2007-10-10 12:50:40 -05:00
Jelmer Vernooij
c424c2b857 r20: Add the registry library. Still needs a lot of work,
see source/lib/registry/TODO for details.
(This used to be commit 7cab3a00d7)
2007-10-10 12:50:33 -05:00