1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

41 Commits

Author SHA1 Message Date
Jeremy Allison
f82c273a42 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.
-
Gerald Carter
66359531b8 i guess i'm the only one this ever annyoed...
fix the confusion when we tdb_lock_bystring() but
we retrieve an entry using tdb_fetch_by_string.
It's now always tdb.*bystring()
-
Tim Potter
a17622103b Fix broken regexp in cvsignore for *.po{,32} files. -
Martin Pool
00b1478822 Add the correct file :-( to ignore .po and .po32 files. -
Martin Pool
a3f90cc6ab Remove this .po file from the repository. I meant to add a cvsignore
file that ignored it, but I slipped.
-
Martin Pool
9a8d50d45c Ignore .po and .po32 files. -
Jeremy Allison
7b945e10a6 More const fixes.
Jeremy.
-
Gerald Carter
33c7b75225 Progress on CR 601
cache the printer_info_2 with the open printer handle.
cache is invalidated on a mod_a_printer() call **on that smbd**.

Yes, this means that the window for admins to step on each other
from different clients just got larger, but since handles a generally
short lived this is probably ok.
-
Andrew Tridgell
e3d00fa47d reverted this patch till I sort out the craziness with UNIHDR -
Andrew Tridgell
b9eff31b14 This removes the 3rd argument from init_unistr2(). There were 240
calls to init_unistr2() in the code and every one of them got the 3rd
argument incorrect, so I thought it best just to remove the argument.

The incorrect usage was caused by callers using strlen() to determine
the length of the string. The 3rd argument to init_unistr2() was
supposed to be the character length, not the byte length of the
string, so for non-english this could come out wrong.

I also removed the bogus 'always allocate at least 256 bytes'
hack. There may be some code that relies on this, but if there is then
the code is broken and needs fixing.
-
Andrew Bartlett
92a777d0ea BIG patch...
This patch makes Samba compile cleanly with -Wwrite-strings.
 - That is, all string literals are marked as 'const'.  These strings are
always read only, this just marks them as such for passing to other functions.

What is most supprising is that I didn't need to change more than a few lines of code (all
in 'net', which got a small cleanup of net.h and extern variables).  The rest
is just adding a lot of 'const'.

As far as I can tell, I have not added any new warnings - apart from making all
of tdbutil.c's function const (so they warn for adding that const string to
struct).

Andrew Bartlett
-
Jeremy Allison
842e08e52a Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
-
Jim McDonough
1426a5ca4f Add some const -
Jim McDonough
1bf36d3fc6 Don't segfault when trying to delete a key when none exist. -
Gerald Carter
ec37633548 fix up print portion of registry. Merge from APP_HEAD. -
Gerald Carter
fd140aadd7 break out REGISTRY_VALUE & REGVAL_CR objects into separate file for
cleaning linking....
-
Gerald Carter
8d510abe12 fix registry editor API for printing backend after I changed
the NT_PRINTER_PARAM to a REGISTRY_VALUE
-
Tim Potter
e84f47a234 Fix compile warnings. -
Gerald Carter
8799d4f7cc fix GetPrinterDataEx() to work with registry subkeys using a depth > 1 -
Gerald Carter
32a7083843 fix to allow EnumPrinterKey() to enumerate multiple levels of subkeys.
Works on the top level.  Needs more testing for levels > 1.
-
Gerald Carter
7ba7c04c0e Fairly large change to printing code.
* removed support for PHANTOM_DEVMODE printer data

* s/NT_PRINTER_PARAM/REGISTRY_VALUE/g - This was a good bit
  of work.  Everything seems stable, but is not complete.

* support for printer data keys other than PrinterDriverData
  in the store and fetch routines.  Still needs to be plugged
  into the XxxPrinterDataEx() calls.

Tested against NT4.0 & 2k.  Like I said, it's not done, but doesn't
crash so it shouldn't upset anyone (unless you're trying to build
a Samba printer server off of HEAD).  More work to come.  Should
settle by Monday.


jerry
-
Tim Potter
f8072d964f Merge of case fixes from APPLIANCE_HEAD. -
Andrew Bartlett
17136a88c3 Back out idra's change (at his request) - the values in the tdb *should* be
upper cased already.

However, if you created your registry tdb in the very early versions of jerry's
patch, you could find that usrmgr doesn't function.  Simply delete the
registry.tdb, it will be recreated on startup.

Andrew Bartlett
-
Simo Sorce
2ad0e81c8d commented out strupper before key check against internal db, it's no good
to check for uppercased strings when we store them not uppercased.

jerry, this fix is needed to make usrmgr.exe work again.
meanwhile we found out that NT_STATUS code may not be appropriate there.
In particular it seem that an NT PDC will send back 02 as error
(ERRbadfile) not 0xc000000f (NT_STATUS_NO_SUCH_FILE NT)

I think further investigation is need to understand which are aprropriate
return codes here.
-
Gerald Carter
efbfb8ca54 hardcode printprocessor name since it is everywhere else -
Gerald Carter
5640e6cdb2 3 things:
* normalize all registry key strings before storing or looking
  up paths in the registry tdb
* return the current buffer size for REG_INFO even when not returning
  actual data
* fix a segfault report by metze on #samba-technical so that the
  user/group object picker works again (was the "ProductType" key
  lookup that was failing).
-
Gerald Carter
915ee5c0ec * fix return code so we don't let a client just open any key it wants
(even nonexistent ones).  This gets rid of the Scheduling Agent icon.

* fix NT_STATUS return code for bad registry path (NT_STATUS_NO_SUCH_FILE)
-
Gerald Carter
2a30c243ec done! printer_info_2, devicemode, sec_desc, & printer data all enumerate
and display correctly in regedit.exe.

Not sure about REG_SZ values in PrinterDriverData.  If we store these
in UNICODE, I'll have to fix up a few things.

REG_BINARY & REG_DWORD are fine.
-
Gerald Carter
419d7208e8 several changes in this checkin
* added REG_OPEN_HKCR for supporting regedit.exe

* All data n a REGISTRY_VALUE is stored to a pointer now

* fixed REG_INFO to correctly display data when double clicking on
  and entry in the registry editor

* Will now enumerate installed driver_info_3 data

* fixed numerous bugs related to pointer offsets, memory issues, etc..
  in the registry routines

* added a simple caching mechanism to fetch_reg_[keys|values]_specific()

All that is left now is to enumerate PrinterData and I will have finished
what I started out to do....
-
Gerald Carter
88f0e68bc6 * fix to display correct form information in REG_BINARY information
This should be 8 x uint32 (not 7.  I'm guessing the 2nd to the last
  uint32 is the index number for the form?  Not that big a deal
  I don't think.
-
Gerald Carter
998eb9c731 * changed structure of REG_R_ENUM_VALUE structure since the BUFFER2
is not and [in/out] buffer

* registry value enumeration is working now for the Print\Forms
  key.  The format of the binary data is not quite right yet
  but all installed forms are listed
-
Gerald Carter
8e94f68a80 fix seg fault due to memory allocation goof. -
Gerald Carter
e62ae94823 another intermediate checkin on the way to enumerating forms
via the registry.  There is a seg fault here which shouldn't
bother anyone until I can get it fixed.  I just need
a check point in case I need to roll back to this version later on.
-
Gerald Carter
c5768538f6 enumeration of printers keys ( no data yet ) via the registry
functions now works :-)
-
Gerald Carter
2050859f03 fixed a logic error in the sorted_tree_find_child() routine
that caused a valid search to fail.  The printing registry
view now works again.
-
Gerald Carter
432b9f8d7c fixed seg fault in registry frontend caused by trying to
use a destroyed TALLOC_CTX*
-
Tim Potter
bc0f1c1ec2 Fixed a compiler warning. -
Gerald Carter
e7b55e8f01 * refactored registry operations some. subkey lists and
registry values are now passed around in containers
  (REGSUBKEY_CTR & REGVAL_CTR) which each possess a TALLOC_CTX.

* removed subkey_specific_fn() from REGISTRY_OPS.  Is implemented
  in the form of a wrapper

* temporarily broke the printing registry ops.

* implemented inheritence for the data_p of nodes in a SORTED_TREE

* All REGISTRY_KEY instances now store a valid REGISTRY_HOOK since
  the default REGOSTRY_OPS structure is stored in the root of the
  cache_tree.

* Probably some other change I forgot....  T
-
Jeremy Allison
beb298898d Formatting fixup. Fix shadow warning.
Jeremy.
-
Gerald Carter
a43d9788fa virtual registry framework with initial printing hooks. -
Gerald Carter
9772acd9ad splitting off storage/retrieval routines for abstracting the
registry view front end.  Now to plug in the various hooks.
-