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

316 Commits

Author SHA1 Message Date
Jeremy Allison
d40e47db4b Remove more fstring/pstring bad useage. Go talloc !
Jeremy.
(This used to be commit 2a0173743d)
2007-11-08 17:25:45 -08:00
Günther Deschner
99d9993fdb When deleting a key from the registry make sure the non-default
security descriptor gets deleted as well.

Guenther
(This used to be commit d140d68537)
2007-11-06 00:50:47 +01:00
Gerald (Jerry) Carter
88ee61625a Patch 2 of 3 from Debian Samba packagers:
The point is doing the following associations:

- non discardable state data (all TDB files that may need to be backed
  up) go to statedir
- shared data (codepage stuff) go to codepagedir

The patch *does not change* the default location for these
directories. So, there is no behaviour change when applying it.

The main change is for samba developers who have to think when dealing
with files that previously pertained to libdir whether they:
- go in statedir
- go in codepagedir
- stay in libdir
(This used to be commit d6cdbfd875)
2007-11-01 15:53:44 -04:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Alexander Bokovoy
d76717fe15 Correctly free memory in regfio paths
(This used to be commit 97f9a90b82)
2007-10-15 17:41:09 -05:00
Volker Lendecke
58a0a60bd1 Remove bogus comment
(This used to be commit 142b80bf15)
2007-10-11 15:36:32 +02:00
Volker Lendecke
0ebab65706 r25534: Apply some const
Why? It moves these structs from the data into the text segment, so they
will never been copy-on-write copied. Not much, but as in German you say
"Kleinvieh macht auch Mist...."
(This used to be commit 0141e64ad4)
2007-10-10 12:31:12 -05:00
Volker Lendecke
3cc2fb5e33 r25528: Only do transactions on registry.tdb if anything changes
I got annoyed by the fsync calls clobbering my harddrive when smbd started up
for debugging.

... things you do on a plane without internet
(This used to be commit e0927a7cbf)
2007-10-10 12:31:12 -05:00
Günther Deschner
6334c7cc5f r25417: Use DBGC_REGISTRY class.
Guenther
(This used to be commit 43ca04918a)
2007-10-10 12:31:04 -05:00
Günther Deschner
4d7a1c3bcf r25370: Allow to delete registry keys recursively without deleting the final key.
Guenther
(This used to be commit e9922cd8ae)
2007-10-10 12:31:01 -05:00
Günther Deschner
3d4af73f50 r25362: Add "NT Authority\System" with Full Access to the default registry security
descriptor.

Guenther
(This used to be commit ddc6d05111)
2007-10-10 12:31:00 -05:00
Michael Adam
5b00e7c389 r25162: Refactor further: add mapping functions between
REGISTRY_VALUE and struct registry_value formats for
registry values. Lacking better naming, I called them
regval_hilvl_to_lolvl and regval_lolvl_to_hilvl for a
start. The might be useful elsewhere, so might be put
into another place later on.

Michael
(This used to be commit 883fd79061)
2007-10-10 12:30:47 -05:00
Michael Adam
f157c9abb7 r25160: Refactor out and slightly clean up canonicalization of the registry value
from smbconf_store_values().

Michael
(This used to be commit 7761f9b3cc)
2007-10-10 12:30:46 -05:00
Michael Adam
34991bbd0c r25140: Less red bars to hurt my eyes...
(This used to be commit f935d21200)
2007-10-10 12:30:44 -05:00
Michael Adam
aaa0afaa26 r25139: Avoid code duplication: let regval_ctr_copyvalue() call regval_ctr_addvalue().
This also corrects regval_ctr_copyvalue() in that it cannot create (invalid)
regval containers with dupliacte entries...

Michael
(This used to be commit 2daaaaa835)
2007-10-10 12:30:44 -05:00
Michael Adam
c5d8fd3772 r25002: Refactor out code duplication created by the previous
unification of r24998.

Michael
(This used to be commit 6026d13253)
2007-10-10 12:30:32 -05:00
Michael Adam
30ee281cae r24999: Use the new regval_compose() function in regval_ctr_addvalue().
Michael
(This used to be commit dab9ffe602)
2007-10-10 12:30:32 -05:00
Michael Adam
cc7bc29757 r24998: Add a function regval_compose() to compose a REGISTRY_VALUE from
input data. Use this function in a first step to refactor
the canonicalization code of smbconf_store_values().

Michael
(This used to be commit f4caa2d7d4)
2007-10-10 12:30:32 -05:00
Michael Adam
628e4d9009 r24996: Eliminate more trailing spaces...
(This used to be commit 1ee1b75113)
2007-10-10 12:30:32 -05:00
Michael Adam
b3fbff6eb5 r24970: Polish some comments and add my (C).
Michael
(This used to be commit aa043bb446)
2007-10-10 12:30:30 -05:00
Volker Lendecke
ff0947fbed r24949: Remove some static buffers
(This used to be commit df648d47ff)
2007-10-10 12:30:29 -05:00
Günther Deschner
7a30cb15da r24632: Fix build warnings.
Guenther
(This used to be commit e9178af01d)
2007-10-10 12:30:12 -05:00
Michael Adam
92ec897627 r24630: Store Samba configuratin options only under the default name, not as aliases.
This prevents creation of problematic configurations from registry editors
like regedit or "net rpc registry".

I will refactor the code to be somewhat more concise,
but I wanted to have this in the tree, now I got it working... :-)

Michael
(This used to be commit 4424a03032)
2007-10-10 12:30:12 -05:00
Günther Deschner
873bc06d95 r24418: Adding reg_deleteallvalues().
Guenther
(This used to be commit f7457c6173)
2007-10-10 12:29:44 -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
Michael Adam
ba2dc0530f r23667: Prevent storing of forbidden parameter names in registry
configuration as values. I would really like to check whether
the valuename is a valid parameter name (with lp_parameter_is_valid)
here, but unfortunately, regedit cereates new values as
"New Value #1" (and so on) first, before dropping into the
rename box. So this is impossible here.

Michael
(This used to be commit 10014833da)
2007-10-10 12:23:44 -05:00
Jeremy Allison
d1d2157153 r23591: Fix bug #4725. Don't crash when no eventlogs specified. Needs
merging for 3.0.25b.
Jeremy.
(This used to be commit ae239fec6f)
2007-10-10 12:23:33 -05:00
Michael Adam
3618a07708 r23584: Use a while loop instead of a for loop without increment... :-)
Michael
(This used to be commit fb4ade3b4d)
2007-10-10 12:23:32 -05:00
Michael Adam
394291281a r23583: Add a utility function to recursively delete a Registry
key with all its subkeys. (reg_deletekey will refuse to
delete a key with subkeys with WERR_ACCESS_DENIED).

Michael
(This used to be commit 41c3ff6e27)
2007-10-10 12:23:32 -05:00
Michael Adam
7fd8a16d23 r23581: Move regkey_open_onelevel from reg_frontend to reg_api,
where it actually belongs, and make it static.

Michael
(This used to be commit aa702e53a7)
2007-10-10 12:23:32 -05:00
Michael Adam
f7de0933f3 r23578: When calling DeleteKey for a key that has subkey(s), Windows
returns WERR_ACCESS_DENIED. This adapts reg_deletekey to behave
the same way.

Michael
(This used to be commit 0c9cb69b45)
2007-10-10 12:23:32 -05:00
Jeremy Allison
72099d8f66 r23512: Fix conflict in #define for SECDESC_PREFIX. Ensure all
reg #defines use "REG_" prefix. Michael - please check
gcc warnings on compiles.
Jeremy.
(This used to be commit 7885b68bb5)
2007-10-10 12:23:23 -05:00
Michael Adam
aa4110e6f2 r23509: This activates the global options from the registry in loadparm.
The global options are stored as values in the subkey "global"
of the SMBCONF registry key.

The activation is accomplished in smb.conf though a new special
semantic of the "include" parameter: "include = registry" triggers
the processing of the registry global options exactly at the
position of the include statement. Options read from the registry
take the same precedence as parameters loaded from a file via
include. Need to reload the registry globals is detected by
watching the tdb sequence number.

Registry shares are automatically activated when the registry
globals are processed.

So a "registry only" configuration can be realized by an
smb.conf that looks as follows:

================================
[global]
include = registry
================================

The global options and registry shares can be conveniently
edited with the "net conf" utility.

Caveat:

A possible pitfall consists in using "include = registry"
together with the "lock directory" directive in the registry.
This problem will be addressed in the next time.

Note on the code:

Processing of the registry options is accomplished by a function
process_registry_globals() in loadparm.c The current version is
only an interim solution: It is handcoded instead of using the
infrastructure of reg_api.c. The reason for this is that using
reg_api still has too large linker dependencies, bloating virtually
all targets by PASSDB_OBJ, SMBLDAP_OBJ, GROUPDB_OBJ and LDB stuff.
A version of process_registry_globals that uses reg_api is
included but commented out. The goal is to eventually refactor
and restructure the registry code so that one can use the reg_api
to access only the registry tdb and not link all the dynamic
backends with all their linking implications.
(This used to be commit 24b0cbcb37)
2007-10-10 12:23:23 -05:00
Michael Adam
43d59b7d42 r23507: Split one general function normalize_dbkey from reg_db.c into util_reg.c
(To be used in other place in subsequent commit.)

Michael
(This used to be commit 6fd7114049)
2007-10-10 12:23:22 -05:00
Michael Adam
9bb19474d7 r23504: Use tdb_wrap_open (instead of usual tdb_open) in reg_db.
This eliminates the need of maintaining reg_db's own
reference counter for the tdb. Maybe as a next step...

Michael
(This used to be commit 31d64767fc)
2007-10-10 12:23:22 -05:00
Michael Adam
a2762cfcaa r23468: Open registry.tdb with sequence number.
Add a function to retrieve the registry db sequence number.

This is in preparation of loadparm integration of registry global
smb.conf options: this will allow to detect changes in order to trigger reload.

Michael
(This used to be commit ebe2ea8f22)
2007-10-10 12:23:18 -05:00
Michael Adam
46906b2c75 r23465: There was this diff between reg_printing in 3_0 and 3_0_26:
before writing to secdesc_buf->sd,
3_0 checked secdesc_buf->sd while 3_0_26 checked secdesc_buf->sd_size.

This patch makes both revisions check _both_ befor writing.

Jerry / Jeremy : please check if this is correct!

Michael
(This used to be commit dfc4217870)
2007-10-10 12:23:18 -05:00
Michael Adam
6f28dc588c r23460: Re-add whitespace to reduce diff between branches.
Sorry for the noise...

Michael
(This used to be commit c7d004dec4)
2007-10-10 12:23:17 -05:00
Michael Adam
00323dc738 r23459: Remove one superfluous cast.
(This used to be commit beed875507)
2007-10-10 12:23:17 -05:00
Michael Adam
cb7f45560f r23458: Cosmetic fix in debug output.
(This used to be commit 03dbdb561a)
2007-10-10 12:23:17 -05:00
Michael Adam
774ceeea50 r23379: Whitespace cosmetics, to reduce irritating diffs...
Michael
(This used to be commit df30f8d5c2)
2007-10-10 12:23:11 -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
Jeremy Allison
56a5d05b8b r22590: Make TALLOC_ARRAY consistent across all uses.
That should be it....
Jeremy.
(This used to be commit 603233a98b)
2007-10-10 12:19:49 -05:00
Jeremy Allison
be8b0685a5 r22589: Make TALLOC_ARRAY consistent across all uses.
Jeremy.
(This used to be commit 8968808c3b)
2007-10-10 12:19:49 -05:00
Jeremy Allison
79de0ad946 r22588: Make all uses of TALLOC_MEMDUP consistent.
Jeremy.
(This used to be commit 8ad13718af)
2007-10-10 12:19:48 -05:00
Michael Adam
b93f78025d r22496: reg_enumvalue should return WERR_NO_MORE_ITEMS instead of
WERR_BAD_FILE when all items have been successfully enumerated.
Besides seeming the reasonable code to return,
this is what I have seen from w2k3, w2k, wxp.
(This used to be commit e09e0d642d)
2007-10-10 12:19:39 -05:00
Volker Lendecke
a40df6f92d r22135: Check in most of Michael Adam's net conf utility. A good share of this patch
is moving functions around to fix some linker dependencies for the registry.

Michael, I've renamed your auth_utils2.c to token_utils.c.

Thanks!

Volker
(This used to be commit 9de16f25c1)
2007-10-10 12:19:16 -05:00
Stefan Metzmacher
bc2b6436d0 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
(This used to be commit 3a28443079)
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
56ba447668 r22001: change prototype of dump_data(), so that it takes unsigned char * now,
which matches what samba4 has.

also fix all the callers to prevent compiler warnings

metze
(This used to be commit fa322f0cc9)
2007-10-10 12:18:59 -05:00
Stefan Metzmacher
c2f09ee288 r21979: make use of string_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand"

note: we can't use the tdb_*_bystring functions here, as the key isn't
null-terminated here...

metze
(This used to be commit 29b42ea89c)
2007-10-10 12:18:55 -05:00
Stefan Metzmacher
4d7c7bb689 r21978: make use of tdb_*_bystring()
to avoid creating the TDB_DATA struct from strings "by hand"

metze
(This used to be commit 1a0599d7aa)
2007-10-10 12:18:55 -05:00
Stefan Metzmacher
3f370211a5 r21977: little cosmetic change to remove a local var that's not really needed
metze
(This used to be commit 71c3880e89)
2007-10-10 12:18:54 -05:00
Jeremy Allison
4901d7f10b r21225: Couple of fixes from Martin Zielinski mz@seh.de,
one typo, one to make sure that time initialization
is done before modules that depend on it (printer
initialization).
Jeremy.
(This used to be commit 6df32b4a6a)
2007-10-10 12:17:48 -05:00
Volker Lendecke
08bf58d8fc r21219: Speed up the initial startup time of smbd on systems with loaded disk
subsystems. See the comment in the diff.

Volker
(This used to be commit 92fdb1193d)
2007-10-10 12:17:48 -05:00
Volker Lendecke
0e4ab9a5ac r20626: Fix a memleak found by the IBM checker -- not on 3.0.24
(This used to be commit 9d0a789e32)
2007-10-10 12:16:59 -05:00
Herb Lewis
e59e787b48 r20269: merge -r20264:20267 from SAMBA_3_0_24
more no previous prototype warnings
(This used to be commit 41be182f78)
2007-10-10 12:16:38 -05:00
Volker Lendecke
ed7e7efd20 r20210: registry_fetch_values is not needed anymore, fix typo
(This used to be commit 77e556f4a3)
2007-10-10 12:16:32 -05:00
Volker Lendecke
5ee2748106 r20209: Fix two memleaks
(This used to be commit 92bc870768)
2007-10-10 12:16:32 -05:00
Volker Lendecke
5b1f85a832 r20037: Reduce code size slightly by shuffling stuff around
(This used to be commit 0742faaacd)
2007-10-10 12:16:22 -05:00
Volker Lendecke
2494868ffb r20020: Arglll... eventlogadm links against reg_db but not the rest of the registry
stuff. Revert the last change.

This needs better fixing.

Volker
(This used to be commit ad1e00430b)
2007-10-10 12:16:21 -05:00
Volker Lendecke
61bd0c8e45 r20019: Replace one set of tricky code by calls to another set of tricky code:
Initializing the reg_db now uses reg_createkey and reg_setvalue.

Volker
(This used to be commit cab5ccbbe4)
2007-10-10 12:16:21 -05:00
Volker Lendecke
b0a6049391 r20018: Fix a memleak in reg_createkey
(This used to be commit 281640823b)
2007-10-10 12:16:21 -05:00
Volker Lendecke
4a272ef0a8 r20016: Add two utility functions for easy opening/creating registry keys
(This used to be commit ad22a46718)
2007-10-10 12:16:20 -05:00
Volker Lendecke
9690500e57 r20005: reg_open_path should become the replacement for regkey_open_internal.
(This used to be commit a6039eb46c)
2007-10-10 12:16:19 -05:00
Volker Lendecke
1a66ed34cd r20004: Remove a const, "name" is allocated anyway
(This used to be commit dc0300ec70)
2007-10-10 12:16:19 -05:00
Volker Lendecke
ecf90c495e r19991: Sorry for this 2000-liner...
The main thing here is a rewrite of srv_winreg_nt.c. The core functionality
has moved to registry/reg_api.c which is then usable by the rest of Samba as
well.

On that way it fixes creating keys with more than one element in the
path. This did not work before.

Two things that sneaked in (sorry :-) is the change of some routines from
NTSTATUS to WERROR the removed "parent" argument to regkey_open_internal.

Volker
(This used to be commit fea52801de)
2007-10-10 12:16:18 -05:00
Volker Lendecke
e57de5730c r19990: Fix comment
(This used to be commit 8b3d860f27)
2007-10-10 12:16:18 -05:00
Volker Lendecke
575845ccbe r19963: Add 'registry shares = yes' and registry key security descriptors.
(This used to be commit 6cab254c49)
2007-10-10 12:16:16 -05:00
Volker Lendecke
4a42371c20 r19948: Fix a memleak
(This used to be commit fd429c8c06)
2007-10-10 12:16:15 -05:00
Volker Lendecke
1c91cca86e r19947: Change regkey_open_internal to take the parent key and a talloc_ctx as
arguments. This also replaces regkey_close_internal by TALLOC_FREE.

Volker
(This used to be commit a177bbb2d5)
2007-10-10 12:16:14 -05:00
Volker Lendecke
213bc9d440 r19913: Fix a const warning
(This used to be commit a660993d14)
2007-10-10 12:16:08 -05:00
Volker Lendecke
b189e6d76e r19912: Move the subkey cache to srv_winreg_nt.c
(This used to be commit 01a53590a6)
2007-10-10 12:16:08 -05:00
Volker Lendecke
015534e254 r19872: Move the value cache to srv_winreg_nt.c. Fix some minor issues found while
playing with regedit.exe.

Volker
(This used to be commit 81bd816fa2)
2007-10-10 12:16:03 -05:00
Volker Lendecke
fb904d2299 r19858: Fix a memleak, add a const
(This used to be commit ed4dc40512)
2007-10-10 12:16:03 -05:00
Volker Lendecke
969a7faa7c r19853: Update a link
(This used to be commit ce44158dde)
2007-10-10 12:16:02 -05:00
Volker Lendecke
7a19259051 r19841: Wrap regdb_store_keys and regdb_store_values in tdb transactions
(This used to be commit 5ec7379220)
2007-10-10 12:16:01 -05:00
Volker Lendecke
9e29e5d2b8 r19839: Fix the build, we are not there yet :-)
(This used to be commit ff4123c8f2)
2007-10-10 12:16:01 -05:00
Volker Lendecke
45111ff1cb r19838: We have to delete the value record as well, otherwise the old values pop up
again if the key is re-created.

Volker
(This used to be commit f722f3341f)
2007-10-10 12:16:01 -05:00
Volker Lendecke
aad7194999 r19837: Some reformatting (Jerry, I hope you do not mind
(This used to be commit 6639f8c119)
2007-10-10 12:16:01 -05:00
Volker Lendecke
45fcd0f0b7 r19828: Add a helper function to pull *and* unparse local registry values
(This used to be commit 969eb9cda6)
2007-10-10 12:16:00 -05:00
Volker Lendecke
bfad442144 r19780: Ok, regkey_open_internal needs a regkey_close_internal. Giving a talloc ctx is
misleading here. This needs fixing properly :-)

Volker
(This used to be commit f808182346)
2007-10-10 12:15:55 -05:00
Volker Lendecke
76b320c8df r19779: Fail properly on talloc_strdup failure
(This used to be commit b57e446789)
2007-10-10 12:15:55 -05:00
Volker Lendecke
e82cd437cc r19778: Make regkey_open_internal take a talloc ctx
(This used to be commit cb7f4211b8)
2007-10-10 12:15:55 -05:00
Volker Lendecke
cbc03ec6df r19777: Make regsubkey_ctr_addkey return WERROR. Nobody checks this so far, but this
will change.

Volker
(This used to be commit 17c7c337f6)
2007-10-10 12:15:54 -05:00
Jelmer Vernooij
4db7642caa r18745: Use the Samba4 data structures for security descriptors and security descriptor
buffers.

Make security access masks simply a uint32 rather than a structure
with a uint32 in it.
(This used to be commit b41c52b9db)
2007-10-10 12:00:54 -05:00
Stefan Metzmacher
258a465e20 r18605: sync dlinklist.h with samba4, that means DLIST_ADD_END()
and DLIST_DEMOTE() now take the type of the tmp pointer
not the tmp pointer itself anymore.

metze
(This used to be commit 2f58645b70)
2007-10-10 11:51:59 -05:00
Jeremy Allison
2eff779b17 r17878: Fix possible null deref found by Stanford checker.
Jeremy.
(This used to be commit ae20201494)
2007-10-10 11:38:56 -05:00
Jeremy Allison
5f925a0190 r17867: Fix null deref in error code path. Found by the
Stanford checker.
Jeremy.
(This used to be commit 09652dc71c)
2007-10-10 11:38:55 -05:00
Volker Lendecke
02eea79624 r17333: Some C++ warnings
(This used to be commit be9aaffdac)
2007-10-10 11:38:26 -05:00
Volker Lendecke
4f33673b41 r17047: Fix a typo and a possible NULL dereference
(This used to be commit c0d9114706)
2007-10-10 11:19:22 -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
68e4fc8066 r16650: Fix bug #3890 reported by jason@ncac.gwu.edu.
Jeremy.
(This used to be commit 590b58cb50)
2007-10-10 11:19:06 -05:00
Jeremy Allison
7d6856240b r16636: Fix bug #3884 reported by jason@ncac.gwu.edu
Jeremy.
(This used to be commit 7580eb947c)
2007-10-10 11:19:05 -05:00
Jeremy Allison
6a9b101dd6 r16634: Fix bug #3883 reported by jason@ncac.gwu.edu.
Jeremy.
(This used to be commit d04462f1d8)
2007-10-10 11:19:04 -05:00
Jeremy Allison
5fb4cc9dff r16603: Klockwork #2028. Fix null deref on error path.
Jeremy.
(This used to be commit 067feef343)
2007-10-10 11:19:03 -05:00
Volker Lendecke
1d21b9659b r16490: Fix a memleak and two typos
(This used to be commit 8cf364e602)
2007-10-10 11:18:57 -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
Volker Lendecke
3c34f6085a r16409: Fix Klocwork ID's.
1177

In reg_perfcount.c: 1200 1202 1203 1204
In regfio.c: 1243 1245 1246 1247 1251

Jerry, the reg_perfcount and regfio.c ones, can you take a look please? This
is really your code, and I'm not sure I did the right thing to return an
error.

smbcacls.c: 1377
srv_eventlog_nt.c: 1415 1416 1417
srv_lsa_nt.c: 1420 1421
srv_netlog_nt.c: 1429
srv_samr_nt: 1458 1459 1460

Volker

Volker
(This used to be commit d6547d12b1)
2007-10-10 11:18:52 -05:00
Volker Lendecke
30832e95dc r15104: Implement Samba4's tdb_name().
Volker
(This used to be commit d52002c1c9)
2007-10-10 11:16:23 -05:00
Jeremy Allison
68dcff3f3a r14768: Fix potential null deref coverity bugs #255, #256.
Jeremy.
(This used to be commit a40c7a0cd8)
2007-10-10 11:15:47 -05:00
Jeremy Allison
e4c66fe4ca r14766: Fix possible NULL deref. Coverity #254.
Jeremy.
(This used to be commit e2e2d8b939)
2007-10-10 11:15:47 -05:00
Volker Lendecke
db249de135 r14247: Fix Coverity bug # 136
(This used to be commit 1b247ff2ed)
2007-10-10 11:15:20 -05:00
Jeremy Allison
2615b079f0 r13978: Here is why it's essential to use SAFE_FREE instead of free.
If we use free(data.dptr) and then the subsequent tdb_open
fails in _reg_perfcount_get_counter_data() then data.dptr
is left as a non-zero pointer that has been freed. This would
cause it to be reused later on. Coverity bug #162.
Jeremy.
(This used to be commit 053efc2098)
2007-10-10 11:11:02 -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
15615dc1f6 r12002: patch from marcin to allow for the creation of a File value in the eventlog registry keys so that file properties can be displayed
(This used to be commit 270fef5175)
2007-10-10 11:05:41 -05:00
Gerald Carter
f2ecd4fed0 r11860: BUG 3156: don't use find_service() when explicitly looking for a printer as the username map might get in the way
(This used to be commit 46bf28c81c)
2007-10-10 11:05:31 -05:00
Gerald Carter
77460a9075 r11579: syncing up perf counter code cfrom trunk
(This used to be commit 59c00924b6)
2007-10-10 11:05:21 -05:00
Gerald Carter
f1195329a7 r11227: patch from brian moran to fix typo in eventlog message file registry value name
(This used to be commit 34c3fd77b3)
2007-10-10 11:05:06 -05:00
Jeremy Allison
8d7c886671 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
(This used to be commit d720867a78)
2007-10-10 11:05:02 -05:00
Gerald Carter
afca439d19 r11136: patches from Brian Moran for eventlogadm utility
(This used to be commit 47b626a8f7)
2007-10-10 11:05:02 -05:00
Gerald Carter
c246649e3d r11123: * patches from Brian Moran for creating new eventlog
source keys
* my patches to get registry utility functions linking
  with eventlogadm tool
(This used to be commit 24e7663086)
2007-10-10 11:05:00 -05:00
Gerald Carter
d45d113659 r11073: safety checks on pointers to prevent crashing when converting REG_MULTI_SZ
(This used to be commit db8d85aa1e)
2007-10-10 11:05:00 -05:00
Gerald Carter
5b52e4a0eb r11072: add routines for converting REG_MULTI_SZ to and from char**
(This used to be commit e858eed813)
2007-10-10 11:05:00 -05:00
Gerald Carter
01a1e5cdb0 r10819: merging a couple of fixes from trunk
* only keep the registry,tdb file open when we have an open key handle
* tpot's setup.py fix
* removing files that no longer exist in trunk and copying some
  that were missing in 3.0
(This used to be commit 6c6bf6ca5f)
2007-10-10 11:04:54 -05:00
Gerald Carter
0bf72b6e33 r10781: merging eventlog and svcctl code from trunk
(This used to be commit f10aa9fb84)
2007-10-10 11:04:53 -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
7b31155d2c r10012: fix build breakage caused by forgotten commit in local tree
(This used to be commit 8c819cd0c6)
2007-10-10 11:03:31 -05:00
Jelmer Vernooij
e8a5fad39d r9965: Fix some typo's
(This used to be commit d30356b9ad)
2007-10-10 11:03:29 -05:00
Gerald Carter
4fa0ed6349 r9914: key ordering in hash list is case insensitive
(This used to be commit 18d0543183)
2007-10-10 11:03:28 -05:00
Gerald Carter
926ebe50ff r9895: fix typo in registry path
(This used to be commit ef7e0d70c6)
2007-10-10 11:03:27 -05:00
Gerald Carter
790a29253c r9894: Add new registry key expected by Windows XP clients.
HKLM\\SYSTEM\\CurrentControlSet\\Control\\Termininal Server\\DefaultUserConfiguration

Apparently this started showing up after the winreg-write support
was added in 3.0.20rc1 or so.

Also modifed init_registry_data() to always run and add the
required keys.  Initial values however are only written if
they don't already exist.

This makes it easier to add new keys without having to rev the
tdb version number (which is really unnecessary in this case).

Portions of patch reviewed by Thomas Bork on the general samba ml.
(This used to be commit b12a05b237)
2007-10-10 11:03:27 -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
Gerald Carter
f5b2238bb3 r9657: fix final issue with regf sk_records; profiles now successfully rewrites
Win2k and WinXP user profile security descriptors.
(This used to be commit 3a3bf4ddb7)
2007-10-10 11:03:24 -05:00
Gerald Carter
d602d8c442 r9656: fix bug in sk record list with next offsets
(This used to be commit c588c2ee69)
2007-10-10 11:03:23 -05:00
Gerald Carter
030bba20f1 r9486: ensure that the registry hash records are sorted by original subkey name and not the 4 character hash key
(This used to be commit 8d34756191)
2007-10-10 11:01:11 -05:00
Tim Potter
9a14b005a1 r9278: Remove unused variable. Bugzilla #2983.
(This used to be commit 5d592691e4)
2007-10-10 11:00:30 -05:00
Gerald Carter
30865196bf r9115: using #define for reg paths rather than typing the string
(This used to be commit e9427912a7)
2007-10-10 11:00:26 -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
Gerald Carter
638b694070 r8607: BUG 2900 more compiler warnings
(This used to be commit ed93cc50e1)
2007-10-10 11:00:12 -05:00
Gerald Carter
6ac01319b4 r8606: BUG 2899: fix compiler warning in regfio routine
(This used to be commit d6b1f695a0)
2007-10-10 11:00:12 -05:00
Gerald Carter
7a51eb50d4 r8604: BUG 2890: fix unitialized variable reported by Jason Mader <jason@ncac.gwu.edu>
(This used to be commit 9f8344e31d)
2007-10-10 11:00:12 -05:00
Gerald Carter
6fe5451543 r8501: * disable printer handle object cache (was mostly used
for NT4 clients enumerating printer data on slow CPUs)
* fix pinter and secdesc record upgrade to normalize the key
  (rev'd printer tdb version)
* fixed problem that was normalizing the printername name field

in general, this should fix the issues upgrading print servers
from 3.0.14a to 3.0.20
(This used to be commit d07179de2f)
2007-10-10 11:00:06 -05:00
Gerald Carter
b5c7572419 r8327: * don't use unitialized variables
(This used to be commit bd87819795)
2007-10-10 10:58:20 -05:00
Gerald Carter
1cb4334fb9 r8325: * punt....don't normalize the printer name in the RegCreateKey().
Print Migrator now works as long as the addprinter command can
  handle the name
(This used to be commit 61f14cdcbd)
2007-10-10 10:58:19 -05:00
Gerald Carter
e574081ad9 r8324: * initial cut at creating printers via the registry API
Need to add delete_key support
(This used to be commit 9a27f7181a)
2007-10-10 10:58:19 -05:00
Gerald Carter
279a2b48b4 r8323: * convert RegSetValue() calls immediately beneath the printer
key to PRINTER_INFO_2 fields.
(This used to be commit fadda2f240)
2007-10-10 10:58:19 -05:00
Gerald Carter
18609ce1af r8322: * get RegSetValue() working for printer subkey values
(not immediate values below the <printer name> key yet.
(This used to be commit a872ea5f0e)
2007-10-10 10:58:19 -05:00
Gerald Carter
2427e00b1d r8152: * remove commented out structure
* use SAMBA_PRINTER_PORT_NAME in registry values for builtin printer
  port
(This used to be commit 63bc03536b)
2007-10-10 10:58:12 -05:00
Gerald Carter
22ea1952c8 r8089: successfully delete printer subkeys via the registry....now for values
(This used to be commit d3427960b0)
2007-10-10 10:58:10 -05:00
Gerald Carter
c296f858ef r8066: * had to modify the printer data storage slightly in ntprinters.tdb
when packing values.  It is a compatible change though and will
  not require a tdb version upgrade
* Can successfully create new printer subkeys via winreg that
  are immediately available via spoolss calls.  Still cannot delete
  keys yet though.  That comes next.
(This used to be commit 00bce2b3bb)
2007-10-10 10:58:10 -05:00
Gerald Carter
0a01b2246a r8064: * add the REG_XXX error codes to the pretty error messages
* more work on the store_values() functions for the Printers key
* add Control\Print\Monitors key to list for reg_db
(This used to be commit 89f17b41ce)
2007-10-10 10:58:10 -05:00
Gerald Carter
8e3445c804 r8061: * mostly cleanup and refactoring for better readability
* move to registry.tdb for port listing (at least via the winreg ops)
  If no one opposes on the samba list, we'll move to a registry
  lookup for enumerating ports rather than the 'enumports command'.
  This means that there is a bit of a disconnect between EnumPorts() and
  RegEnumKey('hklm\software\microsoft\windows nt\currentversion\ports').
(This used to be commit 6f654c5741)
2007-10-10 10:58:10 -05:00
Gerald Carter
c5a51f0273 r8027: driver information is now back via winreg
(This used to be commit f0a1c6b9ce)
2007-10-10 10:58:09 -05:00
Gerald Carter
8cea99d3ac r8026: * more fixes to the printing registry interface
(still not completely back to the read functionality
  we previously had but the cleanup is progressing)
(This used to be commit 04431372a6)
2007-10-10 10:58:09 -05:00
Gerald Carter
d80f6fd4a4 r8022: * implement default actions rather than having to define functions
for every fetch/store callback (some keys should never have a value)
(This used to be commit 7466351dd0)
2007-10-10 10:58:08 -05:00
Gerald Carter
9e31275531 r8008: * start adding logic for restricting subkey paths
e.g. 'hklm\software\microsoft\windows nt\currentversion\ports'
  should have no subkeys.  Return an error if a client tries
  to open a path below here
(This used to be commit 7a2ecb1aec)
2007-10-10 10:58:08 -05:00
Gerald Carter
b319bdd32f r8007: * cleanup unused structure from reg_objects.h
* make regdb_store_XXX() and regdb_fetch_XXX() functions non-static
* use case sensitive string lookups in reg_dynamic.c since the
  keys have already been normalized
* move to new design for making printing related data available
  via the winreg pipe (with the intent of allowing writes)
(This used to be commit 28c7293ee9)
2007-10-10 10:58:08 -05:00
Gerald Carter
1946e917a6 r7997: Pointers don't kill people, people with pointers kill people...
"Honest office!  It was a mistake!  I thought the safety lock was on!"

* Fix problem setting registry values in in-memory objects

I now have printmig.exe successfully creating all of the printer
registry keys (in the tdb backend) which means that the top level
semantics are correct.
(This used to be commit 5289955107)
2007-10-10 10:58:08 -05:00
Gerald Carter
270b90e25f r7995: * privileges are local except when they're *not*
printmig.exe assumes that the LUID of the SeBackupPrivlege
  on the target server matches the LUID of the privilege
  on the local client.  Even though an LUID is never guaranteed
  to be the same across reboots.  How *awful*!  My cat could
  write better code! (more on my cat later....)

* Set the privelege LUID in the global PRIVS[] array

* Rename RegCreateKey() to RegCreateKeyEx() to better match MSDN

* Rename the unknown field in RegCreateKeyEx() to disposition
  (guess according to MSDN)

* Add the capability to define REG_TDB_ONLY for using the reg_db.c
  functions and stress the RegXXX() rpc functions.
(This used to be commit 0d6352da48)
2007-10-10 10:58:07 -05:00