[SCM] Samba Shared Repository - branch master updated
Michael Adam
obnox at samba.org
Mon Apr 29 07:03:03 MDT 2013
The branch, master has been updated
via 08d7cae regedit: Use color only when available.
via 92b6fc0 regedit: Improve the while loop.
via 7b970e9 regedit: Remove talloc leak report.
via 68d4e8d regedit: Mark string values if they contain unprintable chars.
via 8508b41 regedit: Add an edit binary command.
via 8ea38ce regedit: Handle zero-length buffers better with hexedit.
via ad15a83 regedit: Load values on startup.
via 1208167 regedit: Simplify the editor dialog input loop.
via d7d75fd regedit: Fix white space and wrap long lines.
via 384a593 regedit: Add missing copyright headers to hexedit code.
via 8982bf8 regedit: Enable using tab to cycle thru dialog buttons.
via e8d6a33 regedit: Restore cursor position when user tabs to a field.
via 9d0ccd1 regedit: Add a general help section.
via e279aaf regedit: Print help on left side of screen instead of the right.
via 2b6afa6 regedit: Reduce magic numbers in edit dialog, clean up edit dialog creation.
via e9645db regedit: Add help msgs for key and value sections at bottom of screen.
via 77edcd4 regedit: Prefer copywin() over prefresh() for displaying path.
via dc119eb regedit: Cut off the front of the path when screen width is too small.
via 485af4a regedit: Uese a pad for path label.
via a857475 regedit: Improve padding for value summary.
via 05dde21 regedit: Update dialog position on screen resize.
via 58f9e36 regedit: Handle term resizes.
via 560003f regedit: Create subkeys.
via 3344f5e regedit: Delete and add keys.
via 6ef5ee2 regedit: Edit binary values with hexedit.
via ec6fb5d regedit: Initialize hexedit buf with data if available.
via 7c60ec1 regedit:hexedit: make sure cursor is updated on physical screen.
via f723fc9 regedit: Add an input dialog.
via e4ed97f regedit: Simplify notice dialogs, don't overwrite existing values.
via 5cfbf73 regedit: Don't pass empty value names to new_item().
via 360f31d regedit: Really delete value.
via 3b6da77 regedit: Add new value type selection dialog.
via af60882 regedit: Save contents of value editor.
via 1436499 regedit: Value editor changes.
via a43a949 regedit: Don't refresh treeview and value list.
via db5295a regedit: Some work on dialogs.
via 3c14ab1 regedit: Import hex editor.
via bdc40f9 regedit: Link to ncurses form library
via 4a87a7a regedit: Don't panic if we can't open the file.
via 86f88ee waf: Create a better wscript for finding ncurses.
via 5e0f4be regedit: Improve calculation for centering dialogs.
via 6155abc regedit: Introduce dialog windows.
via 4267ec5 regedit: Take into account that getch() may return a '
' instead of KEY_ENTER.
via 19b9a70 regedit: Use tab key to switch between key and value sections.
via 0fb6cc0 regedit: Don't overwrite the '/' when printing path.
via 6d82438 regedit: Print value summary, fix heap corruption and path printing.
via e75057a regedit: List values for the selected key.
via f751b36 regedit: Print the registry path.
via 632cefa regedit: Make all hives browsable.
via 89d3067 regedit: load the configuration after processing the command line
via d3633c0 regedit: Setup a test tree view of HKLM.
via c99675b regedit: Initial import of treeview code
via dc0029c regedit: First crack at linking to ncurses.
via 6c881e2 regedit: Add regedit main source file
via 44f7d1b Support s3 local access with the s4 libregistry framework
via 1ac6bb1 s3: Wrap calls to the s3 registry API.
from 251767c Fix bug #9822 - Samba crashing during Win8 sync.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 08d7caedf0f549d6ca61dc939d94fc267d7d54d4
Author: Andreas Schneider <asn at samba.org>
Date: Fri Oct 26 19:52:08 2012 +0200
regedit: Use color only when available.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
Autobuild-User(master): Michael Adam <obnox at samba.org>
Autobuild-Date(master): Mon Apr 29 15:02:19 CEST 2013 on sn-devel-104
commit 92b6fc0edebe5df103c305f2d5226ba37ad632e4
Author: Andreas Schneider <asn at samba.org>
Date: Fri Oct 26 19:21:50 2012 +0200
regedit: Improve the while loop.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 7b970e930ef97cef28c1d4b0a576d8f9bb4464e8
Author: Andreas Schneider <asn at samba.org>
Date: Fri Oct 26 18:46:29 2012 +0200
regedit: Remove talloc leak report.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 68d4e8dfc75fa788eae44e7f23ec866450792837
Author: C. Davis <cd.rattan at gmail.com>
Date: Sun Aug 19 20:09:53 2012 -0700
regedit: Mark string values if they contain unprintable chars.
Also, edit the values in bin mode to avoid screen glitches.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 8508b411b2ff69f59aa133ebd97e489d7c6c1626
Author: C. Davis <cd.rattan at gmail.com>
Date: Sun Aug 19 20:02:51 2012 -0700
regedit: Add an edit binary command.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 8ea38ce970d7539c25d4da08065d6bfa999f3e96
Author: C. Davis <cd.rattan at gmail.com>
Date: Sun Aug 19 19:11:16 2012 -0700
regedit: Handle zero-length buffers better with hexedit.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit ad15a83357dccc9a41ade1642cca24a0b7de92df
Author: C. Davis <cd.rattan at gmail.com>
Date: Sun Aug 19 18:29:06 2012 -0700
regedit: Load values on startup.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 1208167c77a58154c612dc2bd1655bd70ae994e8
Author: C. Davis <cd.rattan at gmail.com>
Date: Sun Aug 19 00:18:22 2012 -0700
regedit: Simplify the editor dialog input loop.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit d7d75fd311e6c8ebd799160411efe2a3ab3500c9
Author: C. Davis <cd.rattan at gmail.com>
Date: Sat Aug 18 23:44:59 2012 -0700
regedit: Fix white space and wrap long lines.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 384a593309d22c8d16315d362b8b6a8cfb425707
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Aug 17 19:03:12 2012 -0700
regedit: Add missing copyright headers to hexedit code.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 8982bf841d24ea0f5cf8d08b09ebf7ad8a4cdc3b
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Aug 17 03:06:20 2012 -0700
regedit: Enable using tab to cycle thru dialog buttons.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e8d6a33c830bf34733450c9d9a9cf792f1136c1a
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Aug 17 02:15:20 2012 -0700
regedit: Restore cursor position when user tabs to a field.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 9d0ccd1b4896396b0a83d6e767b145bcc3ab111f
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Aug 15 21:05:01 2012 -0700
regedit: Add a general help section.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e279aaff8df4fa1183e0427400eed79f9d9baf4a
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Aug 15 20:50:00 2012 -0700
regedit: Print help on left side of screen instead of the right.
This is little bit easier to read to my eye.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 2b6afa6aa426238d6a6d2d04cb7829e82b2b8bd0
Author: C. Davis <cd.rattan at gmail.com>
Date: Sun Aug 12 22:39:21 2012 -0700
regedit: Reduce magic numbers in edit dialog, clean up edit dialog creation.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e9645db344d4a8fcdca0eb447b273fff539d85df
Author: C. Davis <cd.rattan at gmail.com>
Date: Sun Aug 12 22:38:06 2012 -0700
regedit: Add help msgs for key and value sections at bottom of screen.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 77edcd4dbfee304ed39da134da0752d693250f98
Author: C. Davis <cd.rattan at gmail.com>
Date: Sat Aug 11 23:29:13 2012 -0700
regedit: Prefer copywin() over prefresh() for displaying path.
copywin() works better with panels, dialogs, etc.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit dc119eb9b2881c0f3cf92a0c77fe71411a6a1a13
Author: C. Davis <cd.rattan at gmail.com>
Date: Sat Aug 11 23:22:06 2012 -0700
regedit: Cut off the front of the path when screen width is too small.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 485af4a785e16b9a219363be50e996e50bca8f77
Author: C. Davis <cd.rattan at gmail.com>
Date: Sat Aug 11 22:10:51 2012 -0700
regedit: Uese a pad for path label.
This makes it easier scale the label on resize.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit a857475501591b6761d15ed933a9927abed23555
Author: C. Davis <cd.rattan at gmail.com>
Date: Sat Aug 11 15:00:55 2012 -0700
regedit: Improve padding for value summary.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 05dde2188fd81af17f1714aac35973df4b170354
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Aug 10 21:56:58 2012 -0700
regedit: Update dialog position on screen resize.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 58f9e368c8366bba103ae9214638cc4c99fe4caf
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Aug 10 20:05:20 2012 -0700
regedit: Handle term resizes.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 560003fcd98eb109dd8391c7975aae4ef277604b
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Aug 10 13:16:20 2012 -0700
regedit: Create subkeys.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 3344f5e3d568d607bdf354ed74dc473a612fbf9d
Author: C. Davis <cd.rattan at gmail.com>
Date: Thu Aug 9 18:14:42 2012 -0700
regedit: Delete and add keys.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 6ef5ee250c3b906d56413b213e1f18fe1ff3579f
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Aug 8 20:44:58 2012 -0700
regedit: Edit binary values with hexedit.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit ec6fb5d1ce75fa3746f473727f2533e629bdb136
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Aug 8 20:16:05 2012 -0700
regedit: Initialize hexedit buf with data if available.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 7c60ec12dec39ec63bf8246d478d9335a6451fb4
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Aug 8 20:06:13 2012 -0700
regedit:hexedit: make sure cursor is updated on physical screen.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit f723fc9619fa7cf69888680731b4329832659ff4
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Aug 8 17:49:06 2012 -0700
regedit: Add an input dialog.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e4ed97f9b36a562815fe370c2b0b60105d7f5eba
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Aug 8 15:36:01 2012 -0700
regedit: Simplify notice dialogs, don't overwrite existing values.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 5cfbf7316c16c0205ff87f7980e05a2ab1671709
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Aug 8 14:37:20 2012 -0700
regedit: Don't pass empty value names to new_item().
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 360f31d52b30ef14e8a584f62ff61cc55c95ed53
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Aug 8 14:16:41 2012 -0700
regedit: Really delete value.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 3b6da775d30edcc44655d4eccca00dc71a1835bb
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Aug 8 12:09:03 2012 -0700
regedit: Add new value type selection dialog.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit af60882af4f34556b101d6735095014304620b2d
Author: C. Davis <cd.rattan at gmail.com>
Date: Tue Aug 7 23:41:50 2012 -0700
regedit: Save contents of value editor.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 14364997c75a7ea2b9f698f97421ed7227a3a5d7
Author: C. Davis <cd.rattan at gmail.com>
Date: Tue Aug 7 19:19:28 2012 -0700
regedit: Value editor changes.
* Handle tab and back-tab for navigating among sections of the
editor dialog.
* Read in REG_MULTI_SZ values into a multi-line form field.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit a43a9497b444c7a13437cf0701df009ef9ae8425
Author: C. Davis <cd.rattan at gmail.com>
Date: Mon Aug 6 19:18:56 2012 -0700
regedit: Don't refresh treeview and value list.
This is handled by update_panels() and doupdate() now.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit db5295a7dc61056092b43523409fd11b147e031d
Author: C. Davis <cd.rattan at gmail.com>
Date: Mon Aug 6 19:11:13 2012 -0700
regedit: Some work on dialogs.
* Make dialogs modal with a separate getch() loop to avoid extra
complexity keeping track of dialogs and getting the result.
* Start work on the value editor dialog.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 3c14ab13b19fd11f728d61b7f467b09c4e06fc02
Author: C. Davis <cd.rattan at gmail.com>
Date: Mon Aug 6 19:06:15 2012 -0700
regedit: Import hex editor.
This was tested separately editing files. It needs to be
connected to regedit's value editor.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit bdc40f909f5387698664d3e77dc530d2c2b68a93
Author: C. Davis <cd.rattan at gmail.com>
Date: Mon Aug 6 12:29:11 2012 -0700
regedit: Link to ncurses form library
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 4a87a7ab61ae965cef6a8ffe2d017d1e877cce74
Author: Andreas Schneider <asn at samba.org>
Date: Thu Aug 2 12:41:49 2012 +0200
regedit: Don't panic if we can't open the file.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 86f88ee7b074fc8193a445e0c8ece58c3058b6c3
Author: Andreas Schneider <asn at samba.org>
Date: Thu Aug 2 11:29:10 2012 +0200
waf: Create a better wscript for finding ncurses.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 5e0f4be8e2123ccf9f6beece95b187cd2676ff24
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Jul 27 18:39:54 2012 -0700
regedit: Improve calculation for centering dialogs.
Add some sanity checks to avoid crashing.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 6155abcf82f0bb03e62f7fc4b1df3f7260337bc3
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Jul 27 03:37:22 2012 -0700
regedit: Introduce dialog windows.
Link to ncurses "panels" library to support popup dialog
windows, and begin working on a small dialog library.
Right now, it is useful for "yes/no" confirmation popups,
but later it'll be used for more complex forms for editing
values.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 4267ec59feca258792e62aa2525b246599478fa8
Author: C. Davis <cd.rattan at gmail.com>
Date: Thu Jul 26 01:56:31 2012 -0700
regedit: Take into account that getch() may return a '\n' instead of KEY_ENTER.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 19b9a7063be9a0f74e7bb350542f9665e8ac060b
Author: C. Davis <cd.rattan at gmail.com>
Date: Tue Jul 24 04:12:56 2012 -0700
regedit: Use tab key to switch between key and value sections.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 0fb6cc01f32410cdc4ce0f5d69c886cd40f0256e
Author: C. Davis <cd.rattan at gmail.com>
Date: Tue Jul 24 03:10:45 2012 -0700
regedit: Don't overwrite the '/' when printing path.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 6d82438c63b4655f86985035ffd13b9507f6012b
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Jul 20 03:53:42 2012 -0700
regedit: Print value summary, fix heap corruption and path printing.
Added code to summarize value data. Also fixed a few bugs,
including some heap corruption found with valgrind.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e75057a906b6a7e275622ee1a97675d70ab61912
Author: C. Davis <cd.rattan at gmail.com>
Date: Wed Jul 18 02:31:41 2012 -0700
regedit: List values for the selected key.
Next step is to format a preview for the data and show that
next to the data type.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit f751b36979aecca2189b1258fb8b454039c88cc6
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Jul 13 17:16:51 2012 -0700
regedit: Print the registry path.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 632cefa1da3e0ecda5932420cc551d40faa245af
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Jul 13 17:07:44 2012 -0700
regedit: Make all hives browsable.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 89d3067c22406d943555fcc7c41e7d57ddfbb152
Author: Michael Adam <obnox at samba.org>
Date: Fri Jul 13 10:57:02 2012 +0200
regedit: load the configuration after processing the command line
this way the "-s" parameter can change the config file to be loaded...
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit d3633c08cd5e997d329ff42930d320a8eb4ac7f2
Author: C. Davis <cd.rattan at gmail.com>
Date: Thu Jul 12 21:11:55 2012 -0700
regedit: Setup a test tree view of HKLM.
Expand on the former test by allowing the user to walk HKLM
with the tree view. Subkeys are loaded dynamically in memory
as the user walks the hierarchy with tree_node_load_children().
One issue with this at the moment is detecting if the
in-memory copy of the hierarchy is out of date.
TODO: figure out when to reload out of date portions of the
hierarchy (probably by checking last_modified_time).
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit c99675b813c9e7020f670542750320b9145b3096
Author: C. Davis <cd.rattan at gmail.com>
Date: Tue Jul 10 06:23:33 2012 -0700
regedit: Initial import of treeview code
Reviewed-by: Andreas Schneider <asn at samba.org>
commit dc0029c9463612d9fce6e19f04cf5d9aeed1b2d6
Author: C. Davis <cd.rattan at gmail.com>
Date: Tue Jul 10 06:16:35 2012 -0700
regedit: First crack at linking to ncurses.
First attempt of editing build scripts to link to ncurses
libraries. It seems to work, though checks may need to be
expanded upon.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 6c881e285b4a130bddd15f7d740e4c64a33e0de3
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Jul 6 03:08:17 2012 -0700
regedit: Add regedit main source file
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 44f7d1b67337684f2d65b32042900c200c5ae209
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Jul 6 02:57:55 2012 -0700
Support s3 local access with the s4 libregistry framework
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 1ac6bb1491e034f00be517d65a695b182f6a3f2a
Author: C. Davis <cd.rattan at gmail.com>
Date: Fri Jul 6 02:42:53 2012 -0700
s3: Wrap calls to the s3 registry API.
To use Samba 4's libregistry in the registry editor, some
compatibility issues with Samba 3 need to be addressed.
"struct registry_key" is defined differently in source3 and
source4, and so this wrapper is used to isolate conflicting
types and avoid headaches compiling the code.
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/utils/regedit.c | 554 ++++++++++++++
source3/utils/regedit.h | 61 ++
source3/utils/regedit_dialog.c | 1209 ++++++++++++++++++++++++++++++
source3/utils/regedit_dialog.h | 76 ++
source3/utils/regedit_hexedit.c | 452 +++++++++++
source3/utils/regedit_hexedit.h | 69 ++
source3/utils/regedit_samba3.c | 244 ++++++
source3/utils/regedit_treeview.c | 399 ++++++++++
source3/utils/regedit_treeview.h | 72 ++
source3/utils/regedit_valuelist.c | 315 ++++++++
source3/utils/regedit_valuelist.h | 53 ++
source3/utils/regedit_wrap.c | 143 ++++
source3/wscript | 5 +
source3/wscript_build | 9 +
source3/wscript_configure_system_ncurses | 24 +
15 files changed, 3685 insertions(+), 0 deletions(-)
create mode 100644 source3/utils/regedit.c
create mode 100644 source3/utils/regedit.h
create mode 100644 source3/utils/regedit_dialog.c
create mode 100644 source3/utils/regedit_dialog.h
create mode 100644 source3/utils/regedit_hexedit.c
create mode 100644 source3/utils/regedit_hexedit.h
create mode 100644 source3/utils/regedit_samba3.c
create mode 100644 source3/utils/regedit_treeview.c
create mode 100644 source3/utils/regedit_treeview.h
create mode 100644 source3/utils/regedit_valuelist.c
create mode 100644 source3/utils/regedit_valuelist.h
create mode 100644 source3/utils/regedit_wrap.c
create mode 100644 source3/wscript_configure_system_ncurses
Changeset truncated at 500 lines:
diff --git a/source3/utils/regedit.c b/source3/utils/regedit.c
new file mode 100644
index 0000000..bd9765e
--- /dev/null
+++ b/source3/utils/regedit.c
@@ -0,0 +1,554 @@
+/*
+ * Samba Unix/Linux SMB client library
+ * Registry Editor
+ * Copyright (C) Christopher Davis 2012
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "includes.h"
+#include "popt_common.h"
+#include "lib/util/data_blob.h"
+#include "lib/registry/registry.h"
+#include "regedit.h"
+#include "regedit_treeview.h"
+#include "regedit_valuelist.h"
+#include "regedit_dialog.h"
+#include <ncurses.h>
+#include <menu.h>
+#include <panel.h>
+
+#define KEY_START_X 0
+#define KEY_START_Y 3
+#define KEY_WIDTH (COLS / 4)
+#define KEY_HEIGHT (LINES - KEY_START_Y - 2)
+#define VAL_START_X KEY_WIDTH
+#define VAL_START_Y 3
+#define VAL_WIDTH (COLS - KEY_WIDTH)
+#define VAL_HEIGHT (LINES - VAL_START_Y - 2)
+#define HEADING_START_Y (KEY_START_Y - 1)
+#define HELP1_START_Y (LINES - 2)
+#define HELP1_START_X 0
+#define HELP1_WIDTH (LINES)
+#define HELP2_START_Y (LINES - 1)
+#define HELP2_START_X 0
+#define HELP2_WIDTH (LINES)
+#define PATH_START_Y 0
+#define PATH_START_X 6
+#define PATH_MAX_Y (COLS - 1)
+#define PATH_WIDTH (COLS - 6)
+#define PATH_WIDTH_MAX 1024
+
+struct regedit {
+ WINDOW *main_window;
+ WINDOW *path_label;
+ size_t path_len;
+ struct value_list *vl;
+ struct tree_view *keys;
+ bool tree_input;
+};
+
+static struct regedit *regedit_main = NULL;
+
+static void show_path(struct regedit *regedit)
+{
+ int start_pad = 0;
+ int start_win = PATH_START_X;
+
+ if (PATH_START_X + regedit->path_len > COLS) {
+ start_pad = 3 + PATH_START_X + regedit->path_len - COLS;
+ mvprintw(PATH_START_Y, start_win, "...");
+ start_win += 3;
+ }
+ copywin(regedit->path_label, regedit->main_window, 0, start_pad,
+ PATH_START_Y, start_win, PATH_START_Y, PATH_MAX_Y, false);
+}
+
+static void print_path(struct regedit *regedit, struct tree_node *node)
+{
+ regedit->path_len = tree_node_print_path(regedit->path_label, node);
+ show_path(regedit);
+}
+
+/* load all available hives */
+static struct tree_node *load_hives(TALLOC_CTX *mem_ctx,
+ struct registry_context *ctx)
+{
+ const char *hives[] = {
+ "HKEY_CLASSES_ROOT",
+ "HKEY_CURRENT_USER",
+ "HKEY_LOCAL_MACHINE",
+ "HKEY_PERFORMANCE_DATA",
+ "HKEY_USERS",
+ "HKEY_CURRENT_CONFIG",
+ "HKEY_DYN_DATA",
+ "HKEY_PERFORMANCE_TEXT",
+ "HKEY_PERFORMANCE_NLSTEXT",
+ NULL
+ };
+ struct tree_node *root, *prev, *node;
+ struct registry_key *key;
+ WERROR rv;
+ size_t i;
+
+ root = NULL;
+ prev = NULL;
+
+ for (i = 0; hives[i] != NULL; ++i) {
+ rv = reg_get_predefined_key_by_name(ctx, hives[i], &key);
+ if (!W_ERROR_IS_OK(rv)) {
+ continue;
+ }
+
+ node = tree_node_new(mem_ctx, NULL, hives[i], key);
+ if (node == NULL) {
+ return NULL;
+ }
+
+ if (root == NULL) {
+ root = node;
+ }
+ if (prev) {
+ tree_node_append(prev, node);
+ }
+ prev = node;
+ }
+
+ return root;
+}
+
+static void print_help(struct regedit *regedit)
+{
+ const char *khelp = "[n] New Key [s] New Subkey [d] Del Key "
+ "[LEFT] Ascend [RIGHT] Descend";
+ const char *vhelp = "[n] New Value [d] Del Value [ENTER] Edit "
+ "[b] Edit binary";
+ const char *msg = "KEYS";
+ const char *help = khelp;
+ const char *genhelp = "[TAB] Switch sections [q] Quit regedit "
+ "[UP] List up [DOWN] List down";
+ int i, pad;
+
+ if (!regedit->tree_input) {
+ msg = "VALUES";
+ help = vhelp;
+ }
+
+ move(HELP1_START_Y, HELP1_START_X);
+ clrtoeol();
+ attron(A_REVERSE);
+ mvaddstr(HELP1_START_Y, HELP1_START_X, help);
+ pad = COLS - strlen(msg) - strlen(help);
+ for (i = 0; i < pad; ++i) {
+ addch(' ');
+ }
+ attron(A_BOLD);
+ addstr(msg);
+ attroff(A_REVERSE | A_BOLD);
+
+ move(HELP2_START_Y, HELP2_START_X);
+ clrtoeol();
+ mvaddstr(HELP2_START_Y, HELP2_START_X, genhelp);
+}
+
+static void print_heading(struct regedit *regedit)
+{
+ move(HEADING_START_Y, 0);
+ clrtoeol();
+
+ if (regedit->tree_input) {
+ attron(A_REVERSE);
+ } else {
+ attroff(A_REVERSE);
+ }
+ mvprintw(HEADING_START_Y, KEY_START_X, "Key");
+ attroff(A_REVERSE);
+
+ if (!regedit->tree_input) {
+ attron(A_REVERSE);
+ } else {
+ attroff(A_REVERSE);
+ }
+ mvprintw(HEADING_START_Y, VAL_START_X, "Value");
+ attroff(A_REVERSE);
+
+ print_help(regedit);
+}
+
+static void load_values(struct regedit *regedit)
+{
+ struct tree_node *node;
+
+ node = item_userptr(current_item(regedit->keys->menu));
+ value_list_load(regedit->vl, node->key);
+}
+
+static void add_reg_key(struct regedit *regedit, struct tree_node *node,
+ bool subkey)
+{
+ char *name;
+ const char *msg;
+
+ if (!subkey && !node->parent) {
+ return;
+ }
+
+ msg = "Enter name of new key";
+ if (subkey) {
+ msg = "Enter name of new subkey";
+ }
+ dialog_input(regedit, &name, "New Key", msg);
+ if (name) {
+ WERROR rv;
+ struct registry_key *new_key;
+ struct tree_node *new_node;
+ struct tree_node *list;
+ struct tree_node *parent;
+
+ if (subkey) {
+ parent = node;
+ list = node->child_head;
+ } else {
+ parent = node->parent;
+ list = tree_node_first(node);
+ SMB_ASSERT(list != NULL);
+ }
+ rv = reg_key_add_name(regedit, parent->key, name,
+ NULL, NULL, &new_key);
+ if (W_ERROR_IS_OK(rv)) {
+ /* The list of subkeys may not be present in
+ cache yet, so if not, don't bother allocating
+ a new node for the key. */
+ if (list) {
+ new_node = tree_node_new(parent, parent,
+ name, new_key);
+ SMB_ASSERT(new_node);
+ tree_node_append_last(list, new_node);
+ }
+
+ list = tree_node_first(node);
+ tree_view_clear(regedit->keys);
+ tree_view_update(regedit->keys, list);
+ } else {
+ dialog_notice(regedit, DIA_ALERT, "New Key",
+ "Failed to create key.");
+ }
+ talloc_free(name);
+ }
+}
+
+static void handle_tree_input(struct regedit *regedit, int c)
+{
+ struct tree_node *node;
+
+ switch (c) {
+ case KEY_DOWN:
+ menu_driver(regedit->keys->menu, REQ_DOWN_ITEM);
+ load_values(regedit);
+ break;
+ case KEY_UP:
+ menu_driver(regedit->keys->menu, REQ_UP_ITEM);
+ load_values(regedit);
+ break;
+ case '\n':
+ case KEY_ENTER:
+ case KEY_RIGHT:
+ node = item_userptr(current_item(regedit->keys->menu));
+ if (node && tree_node_has_children(node)) {
+ tree_node_load_children(node);
+ print_path(regedit, node->child_head);
+ tree_view_update(regedit->keys, node->child_head);
+ value_list_load(regedit->vl, node->child_head->key);
+ }
+ break;
+ case KEY_LEFT:
+ node = item_userptr(current_item(regedit->keys->menu));
+ if (node && node->parent) {
+ print_path(regedit, node->parent);
+ node = tree_node_first(node->parent);
+ tree_view_update(regedit->keys, node);
+ value_list_load(regedit->vl, node->key);
+ }
+ break;
+ case 'n':
+ case 'N':
+ node = item_userptr(current_item(regedit->keys->menu));
+ add_reg_key(regedit, node, false);
+ break;
+ case 's':
+ case 'S':
+ node = item_userptr(current_item(regedit->keys->menu));
+ add_reg_key(regedit, node, true);
+ break;
+ case 'd':
+ case 'D': {
+ int sel;
+
+ node = item_userptr(current_item(regedit->keys->menu));
+ if (!node->parent) {
+ break;
+ }
+ sel = dialog_notice(regedit, DIA_CONFIRM,
+ "Delete Key",
+ "Really delete key \"%s\"?",
+ node->name);
+ if (sel == DIALOG_OK) {
+ WERROR rv;
+ struct tree_node *pop;
+ struct tree_node *parent = node->parent;
+
+ rv = reg_key_del(node, parent->key, node->name);
+ if (W_ERROR_IS_OK(rv)) {
+ tree_view_clear(regedit->keys);
+ pop = tree_node_pop(&node);
+ tree_node_free_recursive(pop);
+ node = parent->child_head;
+ if (node == NULL) {
+ node = tree_node_first(parent);
+ print_path(regedit, node);
+ }
+ tree_view_update(regedit->keys, node);
+ value_list_load(regedit->vl, node->key);
+ } else {
+ dialog_notice(regedit, DIA_ALERT, "Delete Key",
+ "Failed to delete key.");
+ }
+ }
+ break;
+ }
+ }
+
+ tree_view_show(regedit->keys);
+ value_list_show(regedit->vl);
+}
+
+static void handle_value_input(struct regedit *regedit, int c)
+{
+ struct value_item *vitem;
+ bool binmode = false;
+
+ switch (c) {
+ case KEY_DOWN:
+ menu_driver(regedit->vl->menu, REQ_DOWN_ITEM);
+ break;
+ case KEY_UP:
+ menu_driver(regedit->vl->menu, REQ_UP_ITEM);
+ break;
+ case 'b':
+ case 'B':
+ binmode = true;
+ /* Falthrough... */
+ case '\n':
+ case KEY_ENTER:
+ vitem = item_userptr(current_item(regedit->vl->menu));
+ if (vitem) {
+ struct tree_node *node;
+ node = item_userptr(current_item(regedit->keys->menu));
+ dialog_edit_value(regedit, node->key, vitem->type,
+ vitem, binmode);
+ value_list_load(regedit->vl, node->key);
+ }
+ break;
+ case 'n':
+ case 'N': {
+ int new_type;
+ int sel;
+
+ sel = dialog_select_type(regedit, &new_type);
+ if (sel == DIALOG_OK) {
+ struct tree_node *node;
+ node = item_userptr(current_item(regedit->keys->menu));
+ dialog_edit_value(regedit, node->key, new_type, NULL,
+ false);
+ value_list_load(regedit->vl, node->key);
+ }
+ break;
+ }
+ case 'd':
+ case 'D':
+ vitem = item_userptr(current_item(regedit->vl->menu));
+ if (vitem) {
+ int sel;
+
+ sel = dialog_notice(regedit, DIA_CONFIRM,
+ "Delete Value",
+ "Really delete value \"%s\"?",
+ vitem->value_name);
+ if (sel == DIALOG_OK) {
+ ITEM *it = current_item(regedit->keys->menu);
+ struct tree_node *node = item_userptr(it);
+ reg_del_value(regedit, node->key,
+ vitem->value_name);
+ value_list_load(regedit->vl, node->key);
+ }
+ }
+ break;
+ }
+
+ value_list_show(regedit->vl);
+}
+
+static void handle_main_input(struct regedit *regedit, int c)
+{
+ switch (c) {
+ case '\t':
+ regedit->tree_input = !regedit->tree_input;
+ print_heading(regedit);
+ break;
+ default:
+ if (regedit->tree_input) {
+ handle_tree_input(regedit, c);
+ } else {
+ handle_value_input(regedit, c);
+ }
+ }
+}
+
+int regedit_getch(void)
+{
+ int c;
+
+ SMB_ASSERT(regedit_main);
+
+ c = getch();
+ if (c == KEY_RESIZE) {
+ tree_view_resize(regedit_main->keys, KEY_HEIGHT, KEY_WIDTH,
+ KEY_START_Y, KEY_START_X);
+ value_list_resize(regedit_main->vl, VAL_HEIGHT, VAL_WIDTH,
+ VAL_START_Y, VAL_START_X);
+ print_heading(regedit_main);
+ show_path(regedit_main);
+ }
+
+ return c;
+}
+
+static void display_window(TALLOC_CTX *mem_ctx, struct registry_context *ctx)
+{
+ struct regedit *regedit;
+ struct tree_node *root;
+ bool colors;
+ int key;
+
+ initscr();
+
+ cbreak();
+ noecho();
+
+ colors = has_colors();
+ if (colors) {
+ start_color();
+ use_default_colors();
+ }
+
+ regedit = talloc_zero(mem_ctx, struct regedit);
+ SMB_ASSERT(regedit != NULL);
+ regedit_main = regedit;
+
+ regedit->main_window = stdscr;
+ keypad(regedit->main_window, TRUE);
+
+ mvwprintw(regedit->main_window, 0, 0, "Path: ");
+ regedit->path_label = newpad(1, PATH_WIDTH_MAX);
+ SMB_ASSERT(regedit->path_label);
+ wprintw(regedit->path_label, "/");
+ show_path(regedit_main);
+
+ root = load_hives(regedit, ctx);
+ SMB_ASSERT(root != NULL);
+
+ regedit->keys = tree_view_new(regedit, root, KEY_HEIGHT, KEY_WIDTH,
+ KEY_START_Y, KEY_START_X);
+ SMB_ASSERT(regedit->keys != NULL);
+
+ regedit->vl = value_list_new(regedit, VAL_HEIGHT, VAL_WIDTH,
+ VAL_START_Y, VAL_START_X);
+ SMB_ASSERT(regedit->vl != NULL);
+
+ regedit->tree_input = true;
+ print_heading(regedit);
+
+ tree_view_show(regedit->keys);
+ menu_driver(regedit->keys->menu, REQ_FIRST_ITEM);
+ load_values(regedit);
+ value_list_show(regedit->vl);
+
+ update_panels();
+ doupdate();
+
+ do {
+ key = regedit_getch();
+
+ handle_main_input(regedit, key);
+ update_panels();
--
Samba Shared Repository
More information about the samba-cvs
mailing list