{"action":"created","issue":{"url":"https://api.github.com/repos/OVALProject/Sandbox/issues/146","repository_url":"https://api.github.com/repos/OVALProject/Sandbox","labels_url":"https://api.github.com/repos/OVALProject/Sandbox/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/OVALProject/Sandbox/issues/146/comments","events_url":"https://api.github.com/repos/OVALProject/Sandbox/issues/146/events","html_url":"https://github.com/OVALProject/Sandbox/pull/146","id":169347762,"number":146,"title":"Add support for negative values of the \"instance\" element of the textfilecontent54_object and textfilecontent54_state elements","user":{"login":"iankko","id":8414918,"avatar_url":"https://avatars.githubusercontent.com/u/8414918?v=3","gravatar_id":"","url":"https://api.github.com/users/iankko","html_url":"https://github.com/iankko","followers_url":"https://api.github.com/users/iankko/followers","following_url":"https://api.github.com/users/iankko/following{/other_user}","gists_url":"https://api.github.com/users/iankko/gists{/gist_id}","starred_url":"https://api.github.com/users/iankko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iankko/subscriptions","organizations_url":"https://api.github.com/users/iankko/orgs","repos_url":"https://api.github.com/users/iankko/repos","events_url":"https://api.github.com/users/iankko/events{/privacy}","received_events_url":"https://api.github.com/users/iankko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-08-04T10:58:33Z","updated_at":"2016-09-30T15:09:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OVALProject/Sandbox/pulls/146","html_url":"https://github.com/OVALProject/Sandbox/pull/146","diff_url":"https://github.com/OVALProject/Sandbox/pull/146.diff","patch_url":"https://github.com/OVALProject/Sandbox/pull/146.patch"},"body":"In certain scenarios it is necessary to obtain not the first, but the last match of a specific match in the ```<textfilecontent54_object>``` and ```<textfilecontent54_state>``` elements.\r\n\r\nThis situation happens when the textfilecontent file allows multiple occurrences of the same directive to be present, and have different values. And at the end, value of the directive specified as the last one is truly used for the configuration of the system.  Examples of such configuration files:\r\n* ```/etc/login.defs```,\r\n* ```/etc/profile```,\r\n* ```/etc/bashrc```,\r\n* ```/etc/csh.cshrc```\r\n\r\nThere are more configuration files / services following this behavioral pattern. More representatives of them can be provided upon request if necessary.\r\n\r\nThe ```instance``` element of ```<textfilecontent54_object>``` and ```<textfilecontent54_state>``` allows to specify particular match, that should be retrieved (first match will have value of ```1```, second value of ```2```, and so on.) But since when retrieving ```textfilecontent54``` file content it is not know, how many instances of specific directive will be present, it's currently not possible to obtain the last one (that will be taken in effect).\r\n\r\nTherefore we propose enhancement of the ```instance``` element of the ```<textfilecontent54_object>``` and ```<textfilecontent54_state>```complex elements to support also negative values with the meaning as follows:\r\n* The last match is given an instance of ```-1```,\r\n* The penultimate match is given an instance value of ```-2```,\r\n* and so on.\r\n\r\nAdditional Information: It was not necessary to change the current OVAL datatype for the ```<instance>``` element, since the current type (```oval-def:EntityObjectIntType```) is able to handle also negative numbers. Therefore we enhanced just the documentation for the ```<instance>``` element of these two complex element to documented the desired / modified behavior.\r\n\r\nRegards, Jan\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/OVALProject/Sandbox/issues/comments/250769592","html_url":"https://github.com/OVALProject/Sandbox/pull/146#issuecomment-250769592","issue_url":"https://api.github.com/repos/OVALProject/Sandbox/issues/146","id":250769592,"user":{"login":"radzy","id":1441739,"avatar_url":"https://avatars.githubusercontent.com/u/1441739?v=3","gravatar_id":"","url":"https://api.github.com/users/radzy","html_url":"https://github.com/radzy","followers_url":"https://api.github.com/users/radzy/followers","following_url":"https://api.github.com/users/radzy/following{/other_user}","gists_url":"https://api.github.com/users/radzy/gists{/gist_id}","starred_url":"https://api.github.com/users/radzy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radzy/subscriptions","organizations_url":"https://api.github.com/users/radzy/orgs","repos_url":"https://api.github.com/users/radzy/repos","events_url":"https://api.github.com/users/radzy/events{/privacy}","received_events_url":"https://api.github.com/users/radzy/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T15:09:02Z","updated_at":"2016-09-30T15:09:02Z","body":"@solind : I'm not sure what that would look like.  Would you mind giving a specific example, perhaps using object_etc_security_limitsd_conf_maxlogins_exists from https://github.com/OpenSCAP/scap-security-guide/pull/1487/files"}}
{"actor":{"display_login":"radzy"}}