Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-integ / recipes-extended / sudo / files / sudo-1.8.23-fix-double-quote-parsing-for-Defaults-values.patch
1 From 1a9754ec64f703542a5faf9ae9c5058b50047b26 Mon Sep 17 00:00:00 2001
2 From: "Sar Ashki, Babak" <Babak.SarAshki@windriver.com>
3 Date: Wed, 11 Dec 2019 19:43:19 -0800
4  sudo-1.8.23-fix-double-quote-parsing-for-Defaults-values.patch
5
6 ---
7  plugins/sudoers/regress/sudoers/test2.json.ok | 6 +++---
8  plugins/sudoers/regress/sudoers/test2.toke.ok | 6 +++---
9  plugins/sudoers/toke.c                        | 2 +-
10  plugins/sudoers/toke.l                        | 2 +-
11  4 files changed, 8 insertions(+), 8 deletions(-)
12
13 diff --git a/plugins/sudoers/regress/sudoers/test2.json.ok b/plugins/sudoers/regress/sudoers/test2.json.ok
14 index 8e6656e..769c3fd 100644
15 --- a/plugins/sudoers/regress/sudoers/test2.json.ok
16 +++ b/plugins/sudoers/regress/sudoers/test2.json.ok
17 @@ -34,7 +34,7 @@
18          },
19          {
20              "Binding": [
21 -                { "username": "%them" }
22 +                { "usergroup": "them" }
23              ],
24              "Options": [
25                  { "set_home": true }
26 @@ -42,7 +42,7 @@
27          },
28          {
29              "Binding": [
30 -                { "username": "%: non UNIX 0 c" }
31 +                { "nonunixgroup": " non UNIX 0 c" }
32              ],
33              "Options": [
34                  { "set_home": true }
35 @@ -50,7 +50,7 @@
36          },
37          {
38              "Binding": [
39 -                { "username": "+net" }
40 +                { "netgroup": "net" }
41              ],
42              "Options": [
43                  { "set_home": true }
44 diff --git a/plugins/sudoers/regress/sudoers/test2.toke.ok b/plugins/sudoers/regress/sudoers/test2.toke.ok
45 index fcd7b73..63e1648 100644
46 --- a/plugins/sudoers/regress/sudoers/test2.toke.ok
47 +++ b/plugins/sudoers/regress/sudoers/test2.toke.ok
48 @@ -29,9 +29,9 @@ DEFAULTS_HOST BEGINSTR STRBODY ENDSTR WORD(4) DEFVAR
49  #
50  DEFAULTS_USER BEGINSTR STRBODY ENDSTR WORD(4) DEFVAR 
51  DEFAULTS_USER BEGINSTR STRBODY ENDSTR WORD(4) DEFVAR 
52 -DEFAULTS_USER BEGINSTR STRBODY ENDSTR WORD(4) DEFVAR 
53 -DEFAULTS_USER BEGINSTR STRBODY ENDSTR WORD(4) DEFVAR 
54 -DEFAULTS_USER BEGINSTR STRBODY ENDSTR WORD(4) DEFVAR 
55 +DEFAULTS_USER BEGINSTR STRBODY ENDSTR USERGROUP DEFVAR 
56 +DEFAULTS_USER BEGINSTR STRBODY ENDSTR USERGROUP DEFVAR 
57 +DEFAULTS_USER BEGINSTR STRBODY ENDSTR NETGROUP DEFVAR 
58  
59  #
60  DEFAULTS_RUNAS BEGINSTR STRBODY ENDSTR WORD(4) DEFVAR 
61 diff --git a/plugins/sudoers/toke.c b/plugins/sudoers/toke.c
62 index d0dd5e3..784218b 100644
63 --- a/plugins/sudoers/toke.c
64 +++ b/plugins/sudoers/toke.c
65 @@ -2512,7 +2512,7 @@ YY_RULE_SETUP
66                                 LEXTRACE("ERROR "); /* empty string */
67                                 LEXRETURN(ERROR);
68                             }
69 -                           if (prev_state == INITIAL) {
70 +                           if (prev_state == INITIAL || prev_state == GOTDEFS) {
71                                 switch (sudoerslval.string[0]) {
72                                 case '%':
73                                     if (sudoerslval.string[1] == '\0' ||
74 diff --git a/plugins/sudoers/toke.l b/plugins/sudoers/toke.l
75 index d275a26..638d9ea 100644
76 --- a/plugins/sudoers/toke.l
77 +++ b/plugins/sudoers/toke.l
78 @@ -178,7 +178,7 @@ DEFVAR                      [a-z_]+
79                                 LEXTRACE("ERROR "); /* empty string */
80                                 LEXRETURN(ERROR);
81                             }
82 -                           if (prev_state == INITIAL) {
83 +                           if (prev_state == INITIAL || prev_state == GOTDEFS) {
84                                 switch (sudoerslval.string[0]) {
85                                 case '%':
86                                     if (sudoerslval.string[1] == '\0' ||