(CommandList children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} { (CommandSubPart command_list: (CommandList children:[(C {(id)} {(-u)})]) left_token: <Left_Backtick '`'> spids: [7 11] ) } {(-ne)} {(0)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ($ VSub_Number '$0') (': must be root to install the selinux policy'))}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 20] ) ] spids: [16777215 35] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SF) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(which)} {(setfiles)})]) left_token: <Left_Backtick '`'> spids: [38 42] ) } spids: [37] ) ] spids: [37] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(-eq)} {(1)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-f)} {(/sbin/setfiles)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SF) op: Equal rhs: {(DQ (/usr/setfiles))} spids: [74] ) ] spids: [74] ) ] spids: [16777215 71] ) ] else_action: [ (C {(echo)} {(DQ ('no selinux tools installed: setfiles'))}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [80 95] ) ] spids: [16777215 57] ) ] spids: [16777215 97] ) (C {(cd)} {(mdp)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CP) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(which)} {(checkpolicy)})]) left_token: <Left_Backtick '`'> spids: [106 110] ) } spids: [105] ) ] spids: [105] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:VERS) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {($ VSub_Name '$CP')} {(-V)}) (C {(awk)} {(SQ <'{print $1}'>)})] negated: F ) ] ) left_token: <Left_Backtick '`'> spids: [113 125] ) } spids: [112] ) ] spids: [112] ) (C {(./mdp)} {(policy.conf)} {(file_contexts)}) (C {($ VSub_Name '$CP')} {(-o)} {(policy.) ($ VSub_Name '$VERS')} {(policy.conf)}) (C {(mkdir)} {(-p)} {(/etc/selinux/dummy/policy)}) (C {(mkdir)} {(-p)} {(/etc/selinux/dummy/contexts/files)}) (C {(cp)} {(file_contexts)} {(/etc/selinux/dummy/contexts/files)}) (C {(cp)} {(dbus_contexts)} {(/etc/selinux/dummy/contexts)}) (C {(cp)} {(policy.) ($ VSub_Name '$VERS')} {(/etc/selinux/dummy/policy)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:FC_FILE) op: Equal rhs: {(/etc/selinux/dummy/contexts/files/file_contexts)} spids: [176] ) ] spids: [176] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-d)} {(/etc/selinux)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(mkdir)} {(-p)} {(/etc/selinux)})] spids: [16777215 193] ) ] spids: [16777215 202] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-f)} {(/etc/selinux/config)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/etc/selinux/config)} ) (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 233 stdin_parts: [('SELINUX=enforcing\n') ('SELINUXTYPE=dummy\n')] ) ] ) ] spids: [16777215 217] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TYPE) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/etc/selinux/config)}) (C {(grep)} {(DQ ('^SELINUXTYPE'))}) (C {(tail)} {(-1)}) (C {(awk)} {(-F) (Lit_Other '=')} {(SQ <'{ print $2 '>) (Lit_RBrace '}')}) ] negated: F ) ] ) left_token: <Left_Backtick '`'> spids: [238 268] ) } spids: [237] ) ] spids: [237] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ (eq) ($ VSub_Name '$TYPE'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ (eqdummy))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(selinuxenabled)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(-eq)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ('SELinux already enabled with a non-dummy policy.'))}) (C {(echo)} {(DQ ('Exiting. Please install policy by hand if that'))}) (C {(echo)} {(DQ ('is what you REALLY want.'))}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] spids: [16777215 309] ) ] spids: [16777215 338] ) (C {(mv)} {(/etc/selinux/config)} {(/etc/selinux/config.mdpbak)}) (SimpleCommand words: [{(grep)} {(-v)} {(DQ ('^SELINUXTYPE'))} {(/etc/selinux/config.mdpbak)}] redirects: [ (Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(/etc/selinux/config)} ) ] ) (SimpleCommand words: [{(echo)} {(DQ ('SELINUXTYPE=dummy'))}] redirects: [ (Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(/etc/selinux/config)} ) ] ) ] spids: [16777215 290] ) ] spids: [16777215 374] ) ] spids: [234 376] ) (C {(cd)} {(/etc/selinux/dummy/contexts/files)}) (C {($ VSub_Name '$SF')} {(file_contexts)} {(/)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:mounts) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/proc/) ($ VSub_Dollar '$$') (/mounts)}) (C {(egrep)} {(DQ ('ext2|ext3|xfs|jfs|ext4|ext4dev|gfs2'))}) (C {(awk)} {(SQ <'{ print $2 '>) (Lit_RBrace '}')}) ] negated: F ) ] ) left_token: <Left_Backtick '`'> spids: [391 414] ) } spids: [390] ) ] spids: [390] ) (C {($ VSub_Name '$SF')} {(file_contexts)} {($ VSub_Name '$mounts')}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:dodev) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/proc/) ($ VSub_Dollar '$$') (/mounts)}) (C {(grep)} {(DQ ('/dev '))}) ] negated: F ) ] ) left_token: <Left_Backtick '`'> spids: [425 439] ) } spids: [424] ) ] spids: [424] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ (eq) ($ VSub_Name '$dodev'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ (eq))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(mount)} {(--move)} {(/dev)} {(/mnt)}) (C {($ VSub_Name '$SF')} {(file_contexts)} {(/dev)}) (C {(mount)} {(--move)} {(/mnt)} {(/dev)}) ] spids: [16777215 460] ) ] spids: [16777215 487] ) ] )