<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.sbin/bsdconfig/usermgmt/share/user_input.subr, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-16T17:55:03+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf'/>
<id>d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>bsdconfig: Fix a bug when editing users</title>
<updated>2018-06-17T22:09:43+00:00</updated>
<author>
<name>Devin Teske</name>
<email>dteske@FreeBSD.org</email>
</author>
<published>2018-06-17T22:09:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=389e4940069316fe667ffa263fa7d6390d0a960f'/>
<id>389e4940069316fe667ffa263fa7d6390d0a960f</id>
<content type='text'>
The usermgmt API was stomping on a global ($user_gid to be specific)
so things would appear to work fine until you tried to make a second
pass into the API with the now-tainted variable contents.

Fixed by localizing menu-specific contents as to not leak outside API.

PR:		bin/208774
Reported by:	Martin Waschbuesch &lt;martin@waschbuesch.de&gt;
MFC after:	1 week
X-MFC-to:	stable/11, stable/10
Sponsored by:	Smule, Inc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The usermgmt API was stomping on a global ($user_gid to be specific)
so things would appear to work fine until you tried to make a second
pass into the API with the now-tainted variable contents.

Fixed by localizing menu-specific contents as to not leak outside API.

PR:		bin/208774
Reported by:	Martin Waschbuesch &lt;martin@waschbuesch.de&gt;
MFC after:	1 week
X-MFC-to:	stable/11, stable/10
Sponsored by:	Smule, Inc.
</pre>
</div>
</content>
</entry>
<entry>
<title>Rewrite usermgmt -- hooking it into the scripting system with dispatch</title>
<updated>2014-03-14T03:42:05+00:00</updated>
<author>
<name>Devin Teske</name>
<email>dteske@FreeBSD.org</email>
</author>
<published>2014-03-14T03:42:05+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f589320a0e392fadc66e67595a6065ae46113430'/>
<id>f589320a0e392fadc66e67595a6065ae46113430</id>
<content type='text'>
commands addUser, deleteUser, and editUser. Getting rid of the awkward-
to-use `userinput' bolt-on which Ron and I talked about rewriting.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commands addUser, deleteUser, and editUser. Getting rid of the awkward-
to-use `userinput' bolt-on which Ron and I talked about rewriting.
</pre>
</div>
</content>
</entry>
<entry>
<title>Performance and debugging enhancements:</title>
<updated>2013-12-07T00:31:01+00:00</updated>
<author>
<name>Devin Teske</name>
<email>dteske@FreeBSD.org</email>
</author>
<published>2013-12-07T00:31:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d4ae33f0721c1b170fe37d97e395228ffcfb3f80'/>
<id>d4ae33f0721c1b170fe37d97e395228ffcfb3f80</id>
<content type='text'>
+ Remove UNAME_P=$(...) from startup/misc -- already supplied by common.subr
+ Use f_getvar instead of $(eval echo \$$var) -- f_getvar is sub-shell free
+ Add `-e' and `-k var' options to f_eval_catch -- increasing use-cases
+ Use f_eval_catch to display errors on failure -- reducing duplicated code
+ Use f_eval_catch when we need output from a command -- improving debugging
+ Optimize f_isinter of strings.subr for performance -- now sub-shell free
+ Improve error checking on pidfiles -- using f_eval_catch and f_isinteger
+ Use $var_to_set arg of f_ifconfig_{inet,netmask} -- eliminate sub-shells
+ Use f_sprintf instead of $(printf ...) -- consolidate sub-shells
+ Use $var_to_set arg of f_route_get_default -- eliminate sub-shells
+ Add f_count to replace $(set -- ...;echo $#) -- eliminate sub-shells
+ Add f_count_ifs to replace $(IFS=x;set -- ...;echo $#) -- no sub-shells
+ Replace var="$var${var:+ }..." in loops with var="$var ..." with a follow-
  up var="${var# }" to trim leading whitespace -- optimize loops
+ Use $var_to_set arg of f_resolv_conf_nameservers -- eliminate sub-shells
+ Comments for the f_eval_catch function
+ Remove a duplicate `local ... desc ...' in f_device_get_all of device.subr
+ Use $var_to_set arg of f_device_capacity -- eliminate sub-shells
+ Whitespace fixes in f_dialog_init of dialog.subr
+ Optimize f_inet_atoi of media/tcpip.subr for performance -- sub-shell free
+ In several cases, send stderr to /dev/null -- clean up runtime execution
+ Change f_err of common.subr to go to program stderr not terminal stderr,
  allowing redirection of output from functions that use f_err
+ Disable debugging when using f_getvar to get variable argument to
  f_startup_rcconf_map_expand of startup/rcconf.subr
+ Use f_replace_all instead of $(echo ... | tr | sed) -- performance
+ Add a $var_to_set option to f_index_{file,menusel_{command,keyword}} of
  common.subr -- centralize sub-shells
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
+ Remove UNAME_P=$(...) from startup/misc -- already supplied by common.subr
+ Use f_getvar instead of $(eval echo \$$var) -- f_getvar is sub-shell free
+ Add `-e' and `-k var' options to f_eval_catch -- increasing use-cases
+ Use f_eval_catch to display errors on failure -- reducing duplicated code
+ Use f_eval_catch when we need output from a command -- improving debugging
+ Optimize f_isinter of strings.subr for performance -- now sub-shell free
+ Improve error checking on pidfiles -- using f_eval_catch and f_isinteger
+ Use $var_to_set arg of f_ifconfig_{inet,netmask} -- eliminate sub-shells
+ Use f_sprintf instead of $(printf ...) -- consolidate sub-shells
+ Use $var_to_set arg of f_route_get_default -- eliminate sub-shells
+ Add f_count to replace $(set -- ...;echo $#) -- eliminate sub-shells
+ Add f_count_ifs to replace $(IFS=x;set -- ...;echo $#) -- no sub-shells
+ Replace var="$var${var:+ }..." in loops with var="$var ..." with a follow-
  up var="${var# }" to trim leading whitespace -- optimize loops
+ Use $var_to_set arg of f_resolv_conf_nameservers -- eliminate sub-shells
+ Comments for the f_eval_catch function
+ Remove a duplicate `local ... desc ...' in f_device_get_all of device.subr
+ Use $var_to_set arg of f_device_capacity -- eliminate sub-shells
+ Whitespace fixes in f_dialog_init of dialog.subr
+ Optimize f_inet_atoi of media/tcpip.subr for performance -- sub-shell free
+ In several cases, send stderr to /dev/null -- clean up runtime execution
+ Change f_err of common.subr to go to program stderr not terminal stderr,
  allowing redirection of output from functions that use f_err
+ Disable debugging when using f_getvar to get variable argument to
  f_startup_rcconf_map_expand of startup/rcconf.subr
+ Use f_replace_all instead of $(echo ... | tr | sed) -- performance
+ Add a $var_to_set option to f_index_{file,menusel_{command,keyword}} of
  common.subr -- centralize sub-shells
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce centralized [X]dialog(1) exit codes to `dialog.subr' and make-use</title>
<updated>2013-10-09T08:12:26+00:00</updated>
<author>
<name>Devin Teske</name>
<email>dteske@FreeBSD.org</email>
</author>
<published>2013-10-09T08:12:26+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f677a9e2672665f4eb3dd4111c07ee8f1f954262'/>
<id>f677a9e2672665f4eb3dd4111c07ee8f1f954262</id>
<content type='text'>
throughout the bsdconfig(8) code. While we're here, add an explicit argument
to lvalue-seeking invocations of "return" that previously had no argument.
Also, consolidate a single instance of double-newline and remove some
comments that are no longer required (given increased readability with new
exit codes).

Approved by:	re (glebius)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
throughout the bsdconfig(8) code. While we're here, add an explicit argument
to lvalue-seeking invocations of "return" that previously had no argument.
Also, consolidate a single instance of double-newline and remove some
comments that are no longer required (given increased readability with new
exit codes).

Approved by:	re (glebius)
</pre>
</div>
</content>
</entry>
<entry>
<title>Use f_show_msg() instead of f_dialog_msgbox() where appropriate. The main</title>
<updated>2013-07-05T16:00:01+00:00</updated>
<author>
<name>Devin Teske</name>
<email>dteske@FreeBSD.org</email>
</author>
<published>2013-07-05T16:00:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7079fc4e0236ff334c2fb0f4367159be6df39332'/>
<id>7079fc4e0236ff334c2fb0f4367159be6df39332</id>
<content type='text'>
difference between these two functions:

	Usage: f_show_msg() $format_string [ $format_args ... ]
	Usage: f_dialog_msgbox() $text [ $hline ]

The former lends itself well to displaying the $msg_* i18n text, prompts,
etc. While the latter is better for text you do not control (error strings
captured as a response from external commands) -- or if you have to control
the hline.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
difference between these two functions:

	Usage: f_show_msg() $format_string [ $format_args ... ]
	Usage: f_dialog_msgbox() $text [ $hline ]

The former lends itself well to displaying the $msg_* i18n text, prompts,
etc. While the latter is better for text you do not control (error strings
captured as a response from external commands) -- or if you have to control
the hline.
</pre>
</div>
</content>
</entry>
<entry>
<title>More whitespace.</title>
<updated>2013-06-24T20:58:54+00:00</updated>
<author>
<name>Devin Teske</name>
<email>dteske@FreeBSD.org</email>
</author>
<published>2013-06-24T20:58:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c9c67103c371140fa440f0be08eaa8f308b23239'/>
<id>c9c67103c371140fa440f0be08eaa8f308b23239</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Curb another regression (this one introduced by r251545, itself trying to</title>
<updated>2013-06-08T18:23:41+00:00</updated>
<author>
<name>Devin Teske</name>
<email>dteske@FreeBSD.org</email>
</author>
<published>2013-06-08T18:23:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=528318ae53c2674b03edf7b0a8894c2aecc6c7ef'/>
<id>528318ae53c2674b03edf7b0a8894c2aecc6c7ef</id>
<content type='text'>
fix the regression introduced by r251544; which was trying to make things
consistent w/respect to ESC versus YES versus NO in the password disable
prompt in "Login Management".

(need stronger coffee; very sorry for the churn)

With this revision, the "YES", "NO", and implied ESC options all work as-
expected. Choosing "YES" allows you to proceed and the password will be
disabled. Choosing "NO" will bring back around to enter a password for the
account. Pressing ESC will drop you out of either user or group input and
back to the usermgmt screen.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fix the regression introduced by r251544; which was trying to make things
consistent w/respect to ESC versus YES versus NO in the password disable
prompt in "Login Management".

(need stronger coffee; very sorry for the churn)

With this revision, the "YES", "NO", and implied ESC options all work as-
expected. Choosing "YES" allows you to proceed and the password will be
disabled. Choosing "NO" will bring back around to enter a password for the
account. Pressing ESC will drop you out of either user or group input and
back to the usermgmt screen.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a regression introduced by r251544; if user chooses "NO" when being</title>
<updated>2013-06-08T18:13:42+00:00</updated>
<author>
<name>Devin Teske</name>
<email>dteske@FreeBSD.org</email>
</author>
<published>2013-06-08T18:13:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=350db06539171e2a83501d381be3fd70d313a95d'/>
<id>350db06539171e2a83501d381be3fd70d313a95d</id>
<content type='text'>
asked if they would like to disable password authentication for the account,
loop back to prompt them for the password again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
asked if they would like to disable password authentication for the account,
loop back to prompt them for the password again.
</pre>
</div>
</content>
</entry>
<entry>
<title>Check for ESC as a separate choice from "NO" when asking if the operator</title>
<updated>2013-06-08T18:08:17+00:00</updated>
<author>
<name>Devin Teske</name>
<email>dteske@FreeBSD.org</email>
</author>
<published>2013-06-08T18:08:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7ca5c4cbc608d44ad228445bbb1942aa7fca94fa'/>
<id>7ca5c4cbc608d44ad228445bbb1942aa7fca94fa</id>
<content type='text'>
would like to disable password management for an account while adding either
a user or group. When being prompted to answer questions while adding a
group or user, two things are trow:

1. You can hit ENTER to blast through all the questions and in the end, the
   group or user is created with sensible defaults for all values.

2. You can press ESC during any prompt to cancel the operation as a whole.

This fix is shoring up an inconsistency in the latter (#2).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
would like to disable password management for an account while adding either
a user or group. When being prompted to answer questions while adding a
group or user, two things are trow:

1. You can hit ENTER to blast through all the questions and in the end, the
   group or user is created with sensible defaults for all values.

2. You can press ESC during any prompt to cancel the operation as a whole.

This fix is shoring up an inconsistency in the latter (#2).
</pre>
</div>
</content>
</entry>
</feed>
