Debian Codegraph @

tests/probes/shadow/test_probes_shadow.xml.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 LINES_COUNT=`catscip-shell system . . cat. /etc/shadowscip-shell filesystem . . `/etc/shadow`. | wcscip-shell system . . wc. -l`
4
5 function getFieldscip-shell shell shell-project 0.0.0 getField(). {
6 LINE=`sedscip-shell system . . sed. -n "${I}p" /etc/shadowscip-shell filesystem . . `/etc/shadow`.`
7 case $1 in
8 'username' )
9 echoscip-shell system . . echo. $LINE | awkscip-shell system . . awk. -F':' '{print $1}'
10 ;;
11 'password' )
12 echoscip-shell system . . echo. $LINE | awkscip-shell system . . awk. -F':' '{print $2}'
13 ;;
14 'chg_lst' )
15 local CHGLST=`echoscip-shell system . . echo. $LINE | awkscip-shell system . . awk. -F':' '{print $3}'`
16 if [scip-shell system . . `[`. "${CHGLST}X" = "X" ]; then echoscip-shell system . . echo. "-1"; else echoscip-shell system . . echo. "$CHGLST"; fi
17 ;;
18 'chg_allow' )
19 local CHGALLOW=`echoscip-shell system . . echo. $LINE | awkscip-shell system . . awk. -F':' '{print $4}'`
20 if [scip-shell system . . `[`. "${CHGALLOW}X" = "X" ]; then echoscip-shell system . . echo. "-1"; else echoscip-shell system . . echo. "$CHGALLOW"; fi
21 ;;
22 'chg_req' )
23 local CHGREQ=`echoscip-shell system . . echo. $LINE | awkscip-shell system . . awk. -F':' '{print $5}'`
24 if [scip-shell system . . `[`. "${CHGREQ}X" = "X" ]; then echoscip-shell system . . echo. "-1"; else echoscip-shell system . . echo. "$CHGREQ"; fi
25 ;;
26 'exp_warn' )
27 local EXPWARN=`echoscip-shell system . . echo. $LINE | awkscip-shell system . . awk. -F':' '{print $6}'`
28 if [scip-shell system . . `[`. "${EXPWARN}X" = "X" ]; then echoscip-shell system . . echo. "-1"; else echoscip-shell system . . echo. "$EXPWARN"; fi
29 ;;
30 'exp_inact' )
31 local EXPINACT=`echoscip-shell system . . echo. $LINE | awkscip-shell system . . awk. -F':' '{print $7}'`
32 if [scip-shell system . . `[`. "${EXPINACT}X" = "X" ]; then echoscip-shell system . . echo. "-1"; else echoscip-shell system . . echo. "$EXPINACT"; fi
33 ;;
34 'exp_date' )
35 local EXPDATE=`echoscip-shell system . . echo. $LINE | awkscip-shell system . . awk. -F':' '{print $8}'`
36 if [scip-shell system . . `[`. "${EXPDATE}X" = "X" ]; then echoscip-shell system . . echo. "-1"; else echoscip-shell system . . echo. "$EXPDATE"; fi
37 ;;
38 esac
39 }
40
41 catscip-shell system . . cat. <<EOF
42 <?xml version="1.0"?>
43 <oval_definitions xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ind-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent" xmlns:unix-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" xmlns:lin-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5" xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix unix-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5#independent independent-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5#linux linux-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5 oval-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd">
44
45 <generator>
46 <oval:product_name>shadow</oval:product_name>
47 <oval:product_version>1.0</oval:product_version>
48 <oval:schema_version>5.4</oval:schema_version>
49 <oval:timestamp>2008-03-31T00:00:00-00:00</oval:timestamp>
50 </generator>
51
52 <definitions>
53
54 <definition class="compliance" version="1" id="oval:1:def:1"> <!-- comment="true" -->
55 <metadata>
56 <title></title>
57 <description></description>
58 </metadata>
59 <criteria>
60 <criteria operator="AND">
61 EOF
62 I=1
63 while [scip-shell system . . `[`. $I -le $LINES_COUNT ]; do
64 echoscip-shell system . . echo. "<criterion test_ref=\"oval:1:tst:${I}\"/>"
65 I=$[$I+1]
66 done
67 catscip-shell system . . cat. <<EOF
68 </criteria>
69 </criteria>
70 </definition>
71
72 </definitions>
73
74 <tests>
75
76 EOF
77
78 I=1
79 while [scip-shell system . . `[`. $I -le $LINES_COUNT ]; do
80 catscip-shell system . . cat. <<EOF
81 <shadow_test version="1" id="oval:1:tst:${I}" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix">
82 <object object_ref="oval:1:obj:${I}"/>
83 <state state_ref="oval:1:ste:${I}"/>
84 </shadow_test>
85 EOF
86 I=$[$I+1]
87 done
88
89 catscip-shell system . . cat. <<EOF
90 </tests>
91
92 <objects>
93 EOF
94
95 I=1
96 while [scip-shell system . . `[`. $I -le $LINES_COUNT ]; do
97 catscip-shell system . . cat. <<EOF
98 <shadow_object version="1" id="oval:1:obj:${I}" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix">
99 <username>`getFieldscip-shell shell shell-project 0.0.0 getField(). "username" ${I}`</username>
100 </shadow_object>
101 EOF
102 I=$[$I+1]
103 done
104
105 catscip-shell system . . cat. <<EOF
106 </objects>
107
108 <states>
109 EOF
110
111 I=1
112 while [scip-shell system . . `[`. $I -le $LINES_COUNT ]; do
113 catscip-shell system . . cat. <<EOF
114 <shadow_state version="1" id="oval:1:ste:${I}" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix">
115 <username>`getFieldscip-shell shell shell-project 0.0.0 getField(). 'username' $I`</username>
116 <password>`getFieldscip-shell shell shell-project 0.0.0 getField(). 'password' $I`</password>
117 <chg_lst datatype="int">`getFieldscip-shell shell shell-project 0.0.0 getField(). 'chg_lst' $I`</chg_lst>
118 <chg_allow datatype="int">`getFieldscip-shell shell shell-project 0.0.0 getField(). 'chg_allow' $I`</chg_allow>
119 <chg_req datatype="int">`getFieldscip-shell shell shell-project 0.0.0 getField(). 'chg_req' $I`</chg_req>
120 <exp_warn datatype="int">`getFieldscip-shell shell shell-project 0.0.0 getField(). 'exp_warn' $I`</exp_warn>
121 <exp_inact datatype="int">`getFieldscip-shell shell shell-project 0.0.0 getField(). 'exp_inact' $I`</exp_inact>
122 <exp_date datatype="int">`getFieldscip-shell shell shell-project 0.0.0 getField(). 'exp_date' $I`</exp_date>
123 </shadow_state>
124 EOF
125 I=$[$I+1]
126 done
127
128 catscip-shell system . . cat. <<EOF
129 </states>
130
131 </oval_definitions>
132 EOF