(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:PIDDIR spids:[42]) op: Equal rhs: {(/var/run/samba)} spids: [42] ) ] spids: [42] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:SAMBAPID spids:[45]) op: Equal rhs: {($ VSub_DollarName '$PIDDIR') (/samba.pid)} spids: [45] ) ] spids: [45] ) (C {(unset)} {(TMPDIR)}) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-x)} {(/usr/sbin/samba)} {(-a)} {(-r)} {(/etc/samba/smb.conf)}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] ) (C {(.)} {(/lib/lsb/init-functions)}) (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(start)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:SERVER_ROLE spids:[98]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.SimpleCommand words: [ {(samba-tool)} {(testparm)} {(--parameter-name) (Lit_Other '=') (DQ ('server role'))} ] redirects: [ (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(tail)} {(-1)}) ] negated: F ) ] ) left_token: <Left_Backtick '`'> spids: [99 118] ) } spids: [98] ) ] spids: [98] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$SERVER_ROLE'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ ('active directory domain controller'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [16777215 139] ) ] spids: [16777215 147] ) (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(init_is_upstart)}) terminator:<Op_Semi ';'>)] action: [(command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] spids: [16777215 156] ) ] spids: [16777215 164] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:KEYFILE spids:[172]) op: Equal rhs: {(/var/lib/samba/private/tls/key.pem)} spids: [172] ) ] spids: [172] ) (command.If arms: [ (if_arm cond: [ (C {(Lit_Other '[')} {(-e)} {($ VSub_DollarName '$KEYFILE')} {(Lit_Other ']')}) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:KEYPERMS spids:[190]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(stat)} {(-c)} {(Lit_Other '%') (a)} {($ VSub_DollarName '$KEYFILE')} ) ] ) left_token: <Left_Backtick '`'> spids: [191 200] ) } spids: [190] ) ] spids: [190] ) (command.If arms: [ (if_arm cond: [ (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$KEYPERMS'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ (600))} {(Lit_Other ']')} ) ] action: [ (C {(echo)} { (DQ ('wrong permission on ') ($ VSub_DollarName '$KEYFILE') (', must be 600') ) } ) (C {(echo)} {(DQ ('samba will not start (CVE-2013-4475)'))}) (C {(echo)} { (DQ ( 'Removing all tls .pem files will cause an auto-regeneration with the correct permissions.' ) ) } ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] spids: [16777215 221] ) ] spids: [16777215 252] ) ] spids: [16777215 187] ) ] spids: [16777215 255] ) (C {(log_daemon_msg)} {(DQ ('Starting Samba AD DC daemon'))} {(DQ (samba))}) (C {(install)} {(-o)} {(root)} {(-g)} {(root)} {(-m)} {(755)} {(-d)} {($ VSub_DollarName '$PIDDIR')} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(start-stop-daemon)} {(--start)} {(--quiet)} {(--oknodo)} {(--exec)} {(/usr/sbin/samba)} {(--)} {(-D)} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(log_end_msg)} {(1)}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] spids: [16777215 315] ) ] spids: [16777215 328] ) (C {(log_end_msg)} {(0)}) ] spids: [94 95 337 16777215] ) (case_arm pat_list: [{(stop)}] action: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(init_is_upstart)}) terminator:<Op_Semi ';'>)] action: [(command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [16777215 349] ) ] spids: [16777215 357] ) (C {(log_daemon_msg)} {(DQ ('Stopping Samba AD DC daemon'))} {(DQ (samba))}) (C {(start-stop-daemon)} {(--stop)} {(--quiet)} {(--pidfile)} {($ VSub_DollarName '$SAMBAPID')} ) (C {(sleep)} {(1)}) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {(-f)} {($ VSub_DollarName '$SAMBAPID')} {(Lit_Other ']')}) (command.Pipeline children: [ (command.SimpleCommand words: [ {(ps)} {(h)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(cat)} {($ VSub_DollarName '$SAMBAPID')})] ) left_token: <Left_Backtick '`'> spids: [410 414] ) } ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) ] negated: T ) ] ) ] action: [(C {(rm)} {(-f)} {($ VSub_DollarName '$SAMBAPID')})] spids: [16777215 421] ) ] spids: [16777215 439] ) (C {(log_end_msg)} {(0)}) ] spids: [340 341 449 16777215] ) (case_arm pat_list: [{(restart)} {(force-reload)}] action: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(init_is_upstart)}) terminator:<Op_Semi ';'>)] action: [(command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] spids: [16777215 463] ) ] spids: [16777215 471] ) (C {($ VSub_Number '$0')} {(stop)}) (C {(sleep)} {(1)}) (C {($ VSub_Number '$0')} {(start)}) ] spids: [452 455 489 16777215] ) (case_arm pat_list: [{(status)}] action: [ (C {(status_of_proc)} {(-p)} {($ VSub_DollarName '$SAMBAPID')} {(/usr/sbin/samba)} {(samba)}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_QMark '$?')} ) ] spids: [492 493 512 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(echo)} {(DQ ('Usage: /etc/init.d/samba-ad-dc {start|stop|restart|force-reload|status}'))} ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [515 516 531 16777215] ) ] spids: [85 91 533] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] )