2 r_uint = "(0|[1-9][0-9]*)"
3 regexp = "^getx?uid" suffix "\\(\\)[[:space:]]+= " r_uint "$"
14 if (match($0, regexp, a)) {
15 if (expected == "getuid") {
18 regexp = "^setuid" suffix "\\(" uid "\\)[[:space:]]+= 0$"
19 } else if (expected == "setuid") {
20 expected = "getresuid"
21 regexp = "^getresuid" suffix "\\(\\[" uid "\\], \\[" uid "\\], \\[" uid "\\]\\)[[:space:]]+= 0$"
22 } else if (expected == "getresuid") {
24 regexp = "^setreuid" suffix "\\(-1, -1\\)[[:space:]]+= 0$"
25 } else if (expected == "setreuid") {
26 expected = "setresuid"
27 regexp = "^setresuid" suffix "\\(" uid ", -1, -1\\)[[:space:]]+= 0$"
28 } else if (expected == "setresuid") {
30 regexp = "^fchown" suffix "\\(1, -1, -1\\)[[:space:]]+= 0$"
31 } else if (expected == "fchown") {
32 expected = "1st getgroups"
33 regexp = "^getgroups" suffix "\\(0, NULL\\)[[:space:]]+= " r_uint "$"
34 } else if (expected == "1st getgroups") {
38 else if (ngroups == "1")
41 list=r_uint "(, " r_uint "){" (ngroups - 1) "}"
42 expected = "2nd getgroups"
43 regexp = "^getgroups" suffix "\\(" ngroups ", \\[" list "\\]\\)[[:space:]]+= " ngroups "$"
44 } else if (expected == "2nd getgroups") {
45 expected = "the last line"
46 regexp = "^\\+\\+\\+ exited with 0 \\+\\+\\+$"
47 } else if (expected == "the last line") {
56 print "Unexpected output after exit"
61 print "error: " expected " doesn't match"