(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:7) command_list: (command.CommandList children:[(C {(id)} {(-u)})]) ) } {(-ne)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:20) ) ] action: [ (C {(echo)} {(DQ ($ Id.VSub_Number '$0') (': must be root to install the selinux policy'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:33) arg_word: {(1)} ) ] spids: [3 22] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SF) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:40) command_list: (command.CommandList children:[(C {(which)} {(setfiles)})]) ) } spids: [39] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_QMark '$?')} {(-eq)} {(1)} {(Id.Lit_RBracket ']')}) terminator: (Token id:Id.Op_Semi val:';' span_id:59) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-f)} {(/sbin/setfiles)} {(Id.Lit_RBracket ']')}) terminator: (Token id:Id.Op_Semi val:';' span_id:73) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SF) op: assign_op.Equal rhs: {(DQ (/usr/setfiles))} spids: [78] ) ] ) ] spids: [64 75] ) ] else_action: [ (C {(echo)} {(DQ ('no selinux tools installed: setfiles'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:94) arg_word: {(1)} ) ] ) ] spids: [48 61] ) ] ) (C {(cd)} {(mdp)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:CP) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:110) command_list: (command.CommandList children:[(C {(which)} {(checkpolicy)})]) ) } spids: [109] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:VERS) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:119) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {($ Id.VSub_DollarName '$CP')} {(-V)}) (C {(awk)} {(SQ (Token id:Id.Lit_Chars val:'{print $1}' span_id:131))}) ] negated: F ) ] ) ) } spids: [118] ) ] ) (C {(./mdp)} {(policy.conf)} {(file_contexts)}) (C {($ Id.VSub_DollarName '$CP')} {(-o)} {(policy.) ($ Id.VSub_DollarName '$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.) ($ Id.VSub_DollarName '$VERS')} {(/etc/selinux/dummy/policy)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:FC_FILE) op: assign_op.Equal rhs: {(/etc/selinux/dummy/contexts/files/file_contexts)} spids: [184] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-d)} {(/etc/selinux)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:199) ) ] action: [(C {(mkdir)} {(-p)} {(/etc/selinux)})] spids: [188 201] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-f)} {(/etc/selinux/config)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:223) ) ] action: [ (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:230) fd: -1 arg_word: {(/etc/selinux/config)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:234) fd: -1 here_begin: {(EOF)} here_end_span_id: 241 stdin_parts: [('SELINUX=enforcing\n') ('SELINUXTYPE=dummy\n')] ) ] ) ] spids: [212 225] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:TYPE) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:246) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(/etc/selinux/config)}) (C {(grep)} {(DQ ('^SELINUXTYPE'))}) (C {(tail)} {(-1)}) (C {(awk)} {(-F) (Id.Lit_Equals '=')} {(SQ (Token id:Id.Lit_Chars val:'{ print $2 ' span_id:275)) (Id.Lit_RBrace '}') } ) ] negated: F ) ] ) ) } spids: [245] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ (eq) ($ Id.VSub_DollarName '$TYPE'))} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ (eqdummy))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:298) ) ] action: [ (C {(selinuxenabled)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_QMark '$?')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:317) ) ] 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.'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:343) arg_word: {(1)} ) ] spids: [306 319] ) ] ) (C {(mv)} {(/etc/selinux/config)} {(/etc/selinux/config.mdpbak)}) (command.Simple words: [{(grep)} {(-v)} {(DQ ('^SELINUXTYPE'))} {(/etc/selinux/config.mdpbak)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_DGreat val:'>>' span_id:368) fd: -1 arg_word: {(/etc/selinux/config)} ) ] ) (command.Simple words: [{(echo)} {(DQ ('SELINUXTYPE=dummy'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_DGreat val:'>>' span_id:379) fd: -1 arg_word: {(/etc/selinux/config)} ) ] ) ] spids: [281 300] ) ] ) ] ) (C {(cd)} {(/etc/selinux/dummy/contexts/files)}) (C {($ Id.VSub_DollarName '$SF')} {(file_contexts)} {(/)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:mounts) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:401) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(/proc/) ($ Id.VSub_Dollar '$$') (/mounts)}) (C {(egrep)} {(DQ ('ext2|ext3|xfs|jfs|ext4|ext4dev|gfs2'))}) (C {(awk)} {(SQ (Token id:Id.Lit_Chars val:'{ print $2 ' span_id:423)) (Id.Lit_RBrace '}') } ) ] negated: F ) ] ) ) } spids: [400] ) ] ) (C {($ Id.VSub_DollarName '$SF')} {(file_contexts)} {($ Id.VSub_DollarName '$mounts')}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:dodev) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:437) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(/proc/) ($ Id.VSub_Dollar '$$') (/mounts)}) (C {(grep)} {(DQ ('/dev '))}) ] negated: F ) ] ) ) } spids: [436] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ (eq) ($ Id.VSub_DollarName '$dodev'))} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ (eq))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:472) ) ] action: [ (C {(mount)} {(--move)} {(/dev)} {(/mnt)}) (C {($ Id.VSub_DollarName '$SF')} {(file_contexts)} {(/dev)}) (C {(mount)} {(--move)} {(/mnt)} {(/dev)}) ] spids: [455 474] ) ] ) ] )