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

40 Commits

Author SHA1 Message Date
Ralph Boehme
2327471756 lib: relicense smb_strtoul(l) under LGPLv3
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug  3 22:21:04 UTC 2020 on sn-devel-184
2020-08-03 22:21:02 +00:00
Swen Schillig
a75727f191 source3: Update all consumers of strtoul_err(), strtoull_err() to new API
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2019-06-30 11:32:18 +00:00
Swen Schillig
8ca4b1f6d9 utils: Update error check for new string conversion wrapper
The new string conversion wrappers detect and flag errors
which occured during the string to integer conversion.
Those modifications required an update of the callees
error checks.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2019-04-11 22:29:26 +00:00
Swen Schillig
e82228f2e0 utils: Use wrapper for string to integer conversion
In order to detect an value overflow error during
the string to integer conversion with strtoul/strtoull,
the errno variable must be set to zero before the execution and
checked after the conversion is performed. This is achieved by
using the wrapper function strtoul_err and strtoull_err.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-03-01 00:32:10 +00:00
Günther Deschner
b00f30c0ac werror: replace WERR_NOMEM with WERR_NOT_ENOUGH_MEMORY in source3/utils/
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:19 +02:00
Amitay Isaacs
5855b039dd regedit: Fix format-nonliteral warning
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12168

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-24 01:33:50 +02:00
Stefan Metzmacher
5d070d9f18 s3:utils: rename variables in regedit_*.c to fix shadow warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:45 +01:00
Chris Davis
b96c432194 regedit: handle del and backspace in hexeditor
Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:10 +02:00
Chris Davis
3c6541c44e regedit: grow hexedit buffer as the user types
Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:10 +02:00
Chris Davis
4badab3a60 regedit: add a button to resize hexedit buffer
Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
8acb87e42e regedit: add a number input box
Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
5bbed3d93d regedit: don't expand single line text field buffer with cursor movement
Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
00765544af regedit: handle DEL key in text fields
Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
58db858619 regedit: adjust some variable names to make them more distinct
Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
09245177a4 regedit: flesh out search dialog and simplify search opts
Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
982c06f55a regedit: don't use subwindows in hexedit
Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
c272178ccc regedit: use pad as a canvas for dialogs
Drawing in a pad allows the dialog to maintain the same size even when
the terminal window is shrunk to some awkwardly small size.  It also
helps avoid hacks needed to update positions of subwindows when the
panel is moved.

Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
061d3e9a66 regedit: move cursor to edited value in list and report edit errors
Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
a728c391d7 regedit: Introduce a new API to build the dialogs.
This helps make new dialogs easier to create, because it provides some
common building blocks and a consistent way to deal with user input.

Dialogs are divided into sections that stack vertically, and common
sections for typical UI things like text boxes, option lists, and
buttons are provided.

The old dialogs are rewritten to use this API.

Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
42df2e643f regedit: add padding to fit REG_MULTI_SZ to the text field
This fixes a bug loading REG_MULTI_SZ values into the editor dialog,
since ncurses fields don't handle newline characters.

Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:09 +02:00
Chris Davis
0ab07cb806 regedit: add search feature.
Open up a search input with '/'. 'x' key gets the next
result.

This patch also ensures that keys are always sorted, so
that the search order matches the order the keys appear
on screen.

TODO:
	+ flesh out search interface
	+ find previous
	+ search values

Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-01 14:32:08 +02:00
C. Davis
68d4e8dfc7 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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:08:22 +02:00
C. Davis
8508b411b2 regedit: Add an edit binary command.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:08:20 +02:00
C. Davis
8ea38ce970 regedit: Handle zero-length buffers better with hexedit.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:07:54 +02:00
C. Davis
1208167c77 regedit: Simplify the editor dialog input loop.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:37 +02:00
C. Davis
d7d75fd311 regedit: Fix white space and wrap long lines.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:36 +02:00
C. Davis
8982bf841d regedit: Enable using tab to cycle thru dialog buttons.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:33 +02:00
C. Davis
e8d6a33c83 regedit: Restore cursor position when user tabs to a field.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:32 +02:00
C. Davis
2b6afa6aa4 regedit: Reduce magic numbers in edit dialog, clean up edit dialog creation.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:29 +02:00
C. Davis
05dde2188f regedit: Update dialog position on screen resize.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:21 +02:00
C. Davis
58f9e368c8 regedit: Handle term resizes.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:20 +02:00
C. Davis
6ef5ee250c regedit: Edit binary values with hexedit.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:16 +02:00
C. Davis
f723fc9619 regedit: Add an input dialog.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:13 +02:00
C. Davis
e4ed97f9b3 regedit: Simplify notice dialogs, don't overwrite existing values.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:11 +02:00
C. Davis
3b6da775d3 regedit: Add new value type selection dialog.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:08 +02:00
C. Davis
af60882af4 regedit: Save contents of value editor.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:07 +02:00
C. Davis
14364997c7 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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:06 +02:00
C. Davis
db5295a7dc 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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:06:03 +02:00
C. Davis
5e0f4be8e2 regedit: Improve calculation for centering dialogs.
Add some sanity checks to avoid crashing.

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:05:58 +02:00
C. Davis
6155abcf82 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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-29 13:05:57 +02:00