GNU Rush – a restricted user shell (split by section):   Section:   Chapter:FastBack: Test Mode   Up: Test Mode   FastForward: Option Summary   Contents: Table of ContentsIndex: Concept Index

7.1 Dump Mode

Dump mode is similar to test mode. The main difference is that in this mode, rush dumps to the standard output a description of the user request after performing all checks and transformations.

The mode is requested by the --dump=attr (-D attr) option. The argument attr is a comma-separated list of the names of attributes to be included in the dump, or the word ‘all’, standing for all attributes.

Additional options and arguments are the same as for the --test option.

The description is formatted as a JSON object5 with the following attributes. These are also the allowed values for the attr list:

cmdline

Command line after transformations.

argv

Array of command line arguments after transformations.

prog

Name of the program to be executed. If ‘null’, argv[0] will be used.

interactive

0’ for normal requests, ‘1’ for interactive requests.

pw_name

Name of the user from the system user database.

pw_uid

UID of the user.

pw_gid

GID of the user.

pw_dir

Home directory of the user, as set in the system user database.

umask

Value of the umask (octal).

chroot_dir

Chroot directory.

home_dir

Current working directory.

gid

New GID as set by the newgrp action, or ‘-1’ if unchanged.

fork

Fork mode. It is a three-state attribute: ‘0’ meaning disabled, ‘1’ meaning enabled, and ‘-1’ meaning default state.

acct

Accounting mode. See ‘fork’, for a description of possible values.

text_domain

Textual domain for i18n.

localedir

Locale directory for i18n.

locale

Locale name

environ

Dump of the environment (array of assignments).

vars

Defined variables, as a JSON object.

The attribute ‘all’ stands for all attribute in the same order as listed in the table above.

Footnotes

(5)

Well, almost. It diverges from the JSON standard in that slash characters are not escaped in string objects.

GNU Rush – a restricted user shell (split by section):   Section:   Chapter:FastBack: Test Mode   Up: Test Mode   FastForward: Option Summary   Contents: Table of ContentsIndex: Concept Index