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

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 0578 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 0578.


Report 0578 Actions


    Problem Report Number 0578
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Rejected (REJ)
    Problem Resolution ID REJ.X.0182
    Raised 1970-01-01 08:00
    Updated 2003-03-13 08:00
    Published null
    Product Standard Commands and Utilities V2 (UNIX 95)
    Certification Program The Open Brand certification program
    Test Suite VSC version 4.1.6
    Test Identification POSIX.cmd/ls 61
    Problem Summary PG4C.00095 This IR claims that quote removal is incorrect for part of the test.
    Problem Text

    Tp61 has a parsing problem with the following command:
    eval "`date '+touch_time=%m%d%H%M; grep_string=\"%b %e %H:%M\"'`"

    The date command within backquotes is subject to the command
    substitution rules defined in Section 2.6.3 on page 36 of the
    Commands and Utilities CAE Specification.

    The date '+touch_time=%m%d%H%M; grep_string=\"%b %e %H:%M\"'
    follows the rules for single quotes, in section 2.2.2.

    The rule for single quotes is that the literal value of all characters
    is preserved. Therefore, the backslash is preserved and grep_string
    does not get set as expected. This causes the eval to fail.

    This test works properly if the following change is made to
    tp61:
    eval "`date '+touch_time=%m%d%H%M; grep_string=\"%b %e %H:%M\"'`"
    is changed to:
    eval "`date '+touch_time=%m%d%H%M; grep_string="%b %e %H:%M"'`"
    Test Output

    200|196 1 03:39:16|TP Start
    520|196 1 1098383369 1 1|Assertion #61 (A): Verify the format of < date and tim
    520|196 1 1098383369 1 2| <LC> e> if LC_TIME is set to POSIX Locale and the fi
    520|196 1 1098383369 1 3| <LC> le has been modified within last 6 months.
    520|196 1 1098383369 1 11|Command failed: 'eval "`date '+touch_time=%m%d%H%M; g
    520|196 1 1098383369 1 12| <LC> rep_string="%b %e %H:%M"'`"'
    220|196 1 2 03:39:30|UNRESOLVED
    410|196 61 1 03:39:31|IC End

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    We recommend this request be refused.

    We believe the test is correct. The rules of quote removal in word
    expansions defined in section 2.6 Word Expansions (page 31), describe
    the expected behavior.

    1. Tilde expansion (see Section 2.6.1 on page 32),
    parameter expansion (see Section 2.6.2 on page
    33), command substitution (see Section 2.6.3 on
    page 36), and arithmetic expansion (see Section
    2.6.4 on page 38) are performed, beginning to
    end. See item 5 in Section 2.3 on page 23.

    2. Field splitting (see Section 2.6.5 on page 38)
    is performed on the portions of the fields
    generated by step 1, unless IFS is null.

    3. Pathname expansion (see Section 2.6.6 on page
    39) is performed, unless set -f is in effect.

    4. Quote removal (see Section 2.6.7 on page 39)
    always is performed last.

    Consider the expression in question:

    eval "`date '+touch_time=%m%d%H%M; grep_string=\"%b %e %H:%M\"'`"

    Note that if the grep string quotes are not escaped that the
    Step 1 causes the evaluation of command substitution

    date '+touch_time=%m%d%H%M; grep_string=\"%b %e %H:%M\"'

    which results in something like

    touch_time10031113; grep_string=\"Oct 3 11:13\"

    Step 2 and 3 do not affect the resulting command output as described
    in section 2.6.3 Command Substitution (page 37):

    The results of command substitution will not be field
    splitting and pathname expansion processed for further tilde
    expansion, parameter expansion, command substitution or
    arithmetic expansion. If a command substitution occurs inside
    double-quotes, it will not be performed on the results of the
    substitution.

    After field splitting and pathname expansion (none) in the main
    command we get two arguments,

    eval
    and
    "touch_time=10031113; grep_string=\"Oct 3 11:13\""

    Step 4 causes the quoting to be removed, resulting in the two arguments

    eval
    and
    touch_time=10031113; grep_string="Oct 3 11:13"

    At this point the eval occurs on the single argument

    touch_time=10031113; grep_string="Oct 3 11:13"

    which results in the proper definition of touch_time and grep_string.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Rejected (REJ)
    Review Conclusion
    This request is refused.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority