]> granicus.if.org Git - sudo/commitdiff
Add test for a newline in the middle of a string when no line continuation
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 27 Mar 2011 21:22:02 +0000 (17:22 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 27 Mar 2011 21:22:02 +0000 (17:22 -0400)
character is used.

plugins/sudoers/regress/sudoers/test8.in [new file with mode: 0644]
plugins/sudoers/regress/sudoers/test8.out.ok [new file with mode: 0644]
plugins/sudoers/regress/sudoers/test8.toke.ok [new file with mode: 0644]

diff --git a/plugins/sudoers/regress/sudoers/test8.in b/plugins/sudoers/regress/sudoers/test8.in
new file mode 100644 (file)
index 0000000..d25e834
--- /dev/null
@@ -0,0 +1,8 @@
+# Test quoted strings
+User_Alias UA1 = "xy"
+User_Alias UA2 = "x\
+y"
+User_Alias UA3 = x\"y
+
+# A newline in the middle of a string is an error
+User_Alias UA4 = "x
diff --git a/plugins/sudoers/regress/sudoers/test8.out.ok b/plugins/sudoers/regress/sudoers/test8.out.ok
new file mode 100644 (file)
index 0000000..ccea904
--- /dev/null
@@ -0,0 +1,7 @@
+Does not parse.
+
+
+User_Alias     UA1 = xy
+User_Alias     UA2 = xy
+User_Alias     UA3 = x"y
+
diff --git a/plugins/sudoers/regress/sudoers/test8.toke.ok b/plugins/sudoers/regress/sudoers/test8.toke.ok
new file mode 100644 (file)
index 0000000..0f7e2a9
--- /dev/null
@@ -0,0 +1,7 @@
+#
+USERALIAS ALIAS = BEGINSTR STRBODY ENDSTR WORD(4) 
+USERALIAS ALIAS = BEGINSTR STRBODY STRBODY ENDSTR WORD(4) 
+USERALIAS ALIAS = WORD(5) 
+
+#
+USERALIAS ALIAS = BEGINSTR STRBODY ERROR <*> ERROR 
\ No newline at end of file