IEEE P1003.2a Draft 8 - December 1991 Copyright (c) 1991 by the Institute of Electrical and Electronics Engineers, Inc. 345 East 47th Street New York, NY 10017, USA All rights reserved as an unpublished work. This is an unapproved and unpublished IEEE Standards Draft, subject to change. The publication, distribution, or copying of this draft, as well as all derivative works based on this draft, is expressly prohibited except as set forth below. Permission is hereby granted for IEEE Standards Committee participants to reproduce this document for purposes of IEEE standardization activities only, and subject to the restrictions contained herein. Permission is hereby also granted for member bodies and technical committees of ISO and IEC to reproduce this document for purposes of developing a national position, subject to the restrictions contained herein. Permission is hereby also granted to the preceding entities to make limited copies of this document in an electronic form only for the stated activities. The following restrictions apply to reproducing or transmitting the document in any form: 1) all copies or portions thereof must identify the document's IEEE project number and draft number, and must be accompanied by this entire notice in a prominent location; 2) no portion of this document may be redistributed in any modified or abridged form without the prior approval of the IEEE Standards Department. Other entities seeking permission to reproduce this document, or any portion thereof, for standardization or other activities, must contact the IEEE Standards Department for the appropriate license. Use of information contained in this unapproved draft is at your own risk. IEEE Standards Department Copyright and Permissions 445 Hoes Lane, P.O. Box 1331 Piscataway, NJ 08855-1331, USA +1 (908) 562-3800 +1 (908) 562-1571 [FAX] PART 2: SHELL AND UTILITIES -- Amd. 1: UPE P1003.2a/D8 When the standard output is not a terminal, none of the filter- 8 modification options are effective. This is based on historical 8 practice. For example, a typical implementation of man pipes its output 8 through more -s to squeeze excess white space for terminal users. When 8 man is piped to lp, however, it is undesirable for this squeezing to 8 happen. 8 END_RATIONALE 8 5.19 newgrp - Change to a new group 5.19.1 Synopsis newgrp [-l] [_g_r_o_u_p] _O_b_s_o_l_e_s_c_e_n_t _V_e_r_s_i_o_n: newgrp [-] [_g_r_o_u_p] 5.19.2 Description The newgrp utility shall create a new shell execution environment with a new real and effective group identification. Of the attributes listed in 3.12, the new shell execution environment shall retain the working directory, file creation mask, and exported variables from the previous environment (i.e., open files, traps, unexported variables, alias definitions, shell functions, and set options may be lost). All other aspects of the process environment that are preserved by the _e_x_e_c family of functions in POSIX.1 {8} also shall be preserved by newgrp; whether other aspects are preserved is unspecified. A new shell execution environment shall be created whether or not newgrp is able to change to the requested new group. If the POSIX.1 {8} {NGROUPS_MAX} is greater than 1, newgrp shall add the specified group to the supplemental groups for the process, if there is room to add another group. With no operands, newgrp shall change the effective group back to the group(s) identified in the user's user entry, and if {NGROUPS_MAX} is greater than 1, shall set the list of supplementary groups to that set in the user's group database entries. If a password is required for the specified group, and the user is not listed as a member of that group in the group database, the user shall be prompted to enter the correct password for that group. If the user is Copyright (c) 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 5.19 newgrp - Change to a new group 223 P1003.2a/D8 INFORMATION TECHNOLOGY--POSIX listed as a member of that group, no password shall be requested. If no password is required for the specified group, it is implementation defined whether users not listed as members of that group can change to that group. Whether or not a password is required, implementation- defined system accounting mechanisms may impose additional authorization restrictions that may cause newgrp to exit with an error status. 5.19.3 Options The newgrp utility shall conform to the utility argument syntax guidelines described in 2.10.2, except that the obsolescent version uses - in a nonstandard manner. The following option shall be supported by the implementation: -l (The letter ell.) - (Obsolescent.) Change the environment to what would be expected if the user actually logged in again. 5.19.4 Operands The following operand shall be supported by the implementation: _g_r_o_u_p A group name from the group database or a nonnegative numeric group ID. Either specifies the group ID to which the real and effective group IDs shall be set. If _g_r_o_u_p is a nonnegative numeric string and exists in the group database as a group name [see _g_e_t_g_r_n_a_m() in POSIX.1 {8} 9.2.1], the numeric group ID associated with that group name shall be used as the group ID. 5.19.5 External Influences 5.19.5.1 Standard Input None. 5.19.5.2 Input Files The file /dev/tty shall be used to read a single line of text for password checking, when one is required. Copyright (c) 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 224 5 User Portability Utilities Option PART 2: SHELL AND UTILITIES -- Amd. 1: UPE P1003.2a/D8 5.19.5.3 Environment Variables The following environment variables shall affect the execution of newgrp: LANG This variable shall determine the locale to use for the locale categories when both LC_ALL and the corresponding environment variable (beginning with LC_) do not specify a locale. See 2.6. LC_ALL This variable shall determine the locale to be used to override any values for locale categories specified by the settings of LANG or any environment variables beginning with LC_. LC_CTYPE This variable shall determine the interpretation of sequences of bytes of text data as characters (e.g., single- versus multibyte characters in arguments). LC_MESSAGES This variable shall determine the language in which messages should be written. 5.19.5.4 Asynchronous Events Default. 5.19.6 External Effects 5.19.6.1 Standard Output None. 5.19.6.2 Standard Error Used for diagnostic messages and a prompt string for a password, if one is required. 5.19.6.3 Output Files None. 5.19.7 Extended Description None. Copyright (c) 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 5.19 newgrp - Change to a new group 225 P1003.2a/D8 INFORMATION TECHNOLOGY--POSIX 5.19.8 Exit Status If newgrp succeeds, the exit status shall be the exit status of the shell. Otherwise, the newgrp utility shall exit with the following value: >0 An error occurred. 5.19.9 Consequences of Errors The invoking shell may terminate. BEGIN_RATIONALE 5.19.10 Rationale. (_T_h_i_s _s_u_b_c_l_a_u_s_e _i_s _n_o_t _a _p_a_r_t _o_f _P_1_0_0_3._2_a) _U_s_a_g_e_,__E_x_a_m_p_l_e_s None. _H_i_s_t_o_r_y__o_f__D_e_c_i_s_i_o_n_s__M_a_d_e Most historical implementations use one of the _e_x_e_c functions to implement the behavior of newgrp. Errors detected before the _e_x_e_c leave the environment unchanged, while errors detected after the _e_x_e_c leave the user in a changed environment. While it would be useful to have newgrp issue a diagnostic message to tell the user that the environment changed, it would be inappropriate to require this change to some historical implementations. The password mechanism is allowed in the group file, but how this would be implemented is not specified. The newgrp utility was retained in POSIX.2 even given the existence of the multiple group permissions feature in POSIX.1 {8}, because it allows files to be created with a specific group ownership. In some systems, the group ownership is determined by the group of the parent directory in which a file is created, as allowed by POSIX.1 {8}; on such systems, 8 newgrp does not affect the group ownership in directories where the 8 parent directory dictates it. However, POSIX.1 {8} allows systems to 8 omit this feature; therefore, the newgrp functionality is still required on those systems. END_RATIONALE Copyright (c) 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 226 5 User Portability Utilities Option PART 2: SHELL AND UTILITIES -- Amd. 1: UPE P1003.2a/D8 5.20 nice - Invoke a utility with an altered system scheduling priority 5.20.1 Synopsis nice [-n _i_n_c_r_e_m_e_n_t] _u_t_i_l_i_t_y [_a_r_g_u_m_e_n_t ...] _O_b_s_o_l_e_s_c_e_n_t _V_e_r_s_i_o_n: nice [-_i_n_c_r_e_m_e_n_t] _u_t_i_l_i_t_y [_a_r_g_u_m_e_n_t ...] 5.20.2 Description The nice utility shall invoke a utility, requesting that it be run with a 7 different system scheduling priority (see 2.2.2.212). With no options 7 and only if the user has appropriate privileges, the executed utility 7 shall be run with a system scheduling priority that is some 7 implementation-defined quantity less than or equal to the system 7 scheduling priority of the current process. If the user lacks 7 appropriate privileges to affect the system scheduling priority in the 7 requested manner, the nice utility shall not affect the system scheduling 7 priority; in this case, a warning message may be written to standard 8 error, but this shall not prevent the invocation of _u_t_i_l_i_t_y or affect the 8 exit status. 8 5.20.3 Options The nice utility shall conform to the utility argument syntax guidelines described in 2.10.2, except that the obsolescent version allows a multidigit decimal integer as an option name. The following option shall be supported by the implementation: -n _i_n_c_r_e_m_e_n_t -_i_n_c_r_e_m_e_n_t (Obsolescent.) Specify how the system scheduling priority of the executed utility shall be adjusted. The _i_n_c_r_e_m_e_n_t option-argument shall be a positive or negative decimal integer that shall be used to modify the system scheduling priority of the executed utility in an implementation-defined manner. Positive _i_n_c_r_e_m_e_n_t values shall cause a lower or unchanged system scheduling priority. Negative _i_n_c_r_e_m_e_n_t values may require appropriate privileges and shall cause a higher or unchanged system scheduling priority. The system scheduling priority shall be bounded in an implementation-defined manner. If the requested _i_n_c_r_e_m_e_n_t Copyright (c) 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 5.20 nice - Invoke a utility with an altered system scheduling priority227