Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

GlobToRegexFunctionType documentation updates required #245

Closed

Activity

  1. iankko commented on Mar 18, 2015

    @iankko

    Thank you for filing this ticket, David.

    Further issue details (to document what is currently wrong). The current (OVAL 5.11) glob_to_regex() function documentation provides couple of examples for different values of noescape attribute. Quoting relevant parts from current documentation:
        http://oval.mitre.org/language/version5.11/ovaldefinition/documentation/oval-definitions-schema.html#GlobToRegexFunctionType

    For example given the input glob pattern would be '\*' then the resulting Perl 5's regular
    expression would be '^\\.*$' in the default (glob_noescape=false) case (here '\' would be
    interpreted as an escape character), and would produce '^\.*$' in glob_noescape=true case
    (since here '\' would be interpreted as an literal). Similarly the output for '\?' glob
    pattern would be '^\\.$' (default,  glob_noescape=false case), and '^\.$' for
    glob_noescape=true case.
    

    As correctly pointed out by David via the link above, the resulting form of examples is incorrect now.

    The correct version should be:

    # Results for C '\*' glob:
    ----------------------------------------
      glob_noescape  | Perl regular expression
    ----------------------------------------
          FALSE           |      ^\*$
           TRUE           |     ^\\.*$
    ----------------------------------------
    
    # Results for C '\?' glob:
    ----------------------------------------
      glob_noescape | Perl regular expression
    ----------------------------------------
         FALSE           |      ^\?$
          TRUE           |      ^\\.$
    ---------------------------------------- 
    

    And to provide yet one example for handling of '[' and ']' characters it's listed below:

    # Results for C '\[hello\]' glob:
    ----------------------------------------
      glob_noescape | Perl regular expression
    ----------------------------------------
         FALSE           | ^\[hello\]$
          TRUE            | ^\\[hello\\]$ 
    

    I will create & attach corresponding OVAL Language git repository changes & add a diff here.

    Thank you && Regards, Jan.
    Jan iankko Lieskovsky

  2. added a commit that references this issue on Mar 24, 2015
    965aed6
  3. added this to the 5.11.1 milestone on Apr 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions