HomeAbout Us A-Z IndexSearch * Contact Us Register LoginPress Shop

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 1007 Details

Help Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges

This page provides all information on Problem Report 1007.


Report 1007 Actions


    Problem Report Number 1007
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0522
    Raised 2001-03-21 08:00
    Updated 2003-03-13 08:00
    Published 2001-05-17 08:00
    Product Standard Commands and Utilities V3 (UNIX 98)
    Certification Program The Open Brand certification program
    Test Suite VSC version 5.1.2
    Test Identification POSIX.upe/newgrp 5
    Problem Summary TSD4C.00240 The test may fail on systems where newgrp does not start a subprocess.
    Problem Text
    This assertion fails while executing the following expect code:

    spawn -noecho sh
    expect "$ "
    send "newgrp vscg1\r"
    expect "$ "
    send "id > /tmp/newgrp_id_5\r"
    expect "$ "
    send "exit 0\r"
    sleep 2
    send "exit 0\r"
    expect eof
    exit

    with the following output:

    > expect -f expect_scr
    $ newgrp vscg1
    $ id > /tmp/newgrp_id_5
    $ i_read(spawn_id=4): Invalid argument
    while executing
    "expect eof"
    (file "expect_scr" line 10)
    >

    The reason for the failure is that the new shell replaces the
    old shell's process space.

    The text of the specification says:

    "The newgrp utility creates a new shell execution environment with a new real
    and effective group identification. Of the attributes listed in Shell
    Execution Environment , the new shell execution environment will retain the
    working directory, file creation mask and exported variables from the previous
    environment (that is, 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 exec family of functions in
    the XSH specification also are preserved by newgrp; whether other aspects are
    preserved is unspecified."

    There is nothing in the specification which prohibits an implementation
    from writing newgrp such that the new shell replaces the old shell.

    By removing the extra exit in the expect code, the test will pass.
    In order to be portable, it is suggested that the test check to see
    if the current shell pid is different than the old shell pid, and
    only then do the second exit.
    Test Output
    200|1 1 10:41:51|TP Start
    520|1 1 21026 1 1|Assertion #5 (C): newgrp creates a new shell environment.
    520|1 1 21026 1 11|Expected exit code = 0; Received 1
    220|1 1 1 10:41:53|FAIL
    410|1 5 1 10:41:53|IC End

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    This is accepted as a fault in the test suite.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Test Suite Deficiency (TSD)
    Review Conclusion
    This is an agreed Test Suite Deficiency.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority