WiP: fix resource confict. (get the 00_angr_find.c.template to build + test it, then update other XX_angr_.* to use same pattern).

This commit is contained in:
thomashaw
2018-10-29 21:43:31 +00:00
committed by ts
parent 700ca0d437
commit 67de44a660
5 changed files with 142 additions and 24 deletions

View File

@@ -15,11 +15,13 @@ define secgen_functions::install_setgid_binary (
if $account {
$username = $account['username']
::accounts::user { $username:
shell => '/bin/bash',
password => pw_hash($account['password'], 'SHA-512', 'mysalt'),
managehome => true,
home_mode => '0755',
if ! User[$username] {
::accounts::user { $username:
shell => '/bin/bash',
password => pw_hash($account['password'], 'SHA-512', 'mysalt'),
managehome => true,
home_mode => '0755',
}
}
$storage_directory = "/home/$username"
@@ -43,11 +45,11 @@ define secgen_functions::install_setgid_binary (
# Create challenge directory
::secgen_functions::create_directory { "create_$challenge_directory":
path => $challenge_directory,
notify => File["create_$compile_directory"],
notify => File["create-$compile_directory-$challenge_name"],
}
# Move contents of the module's files directory into compile directory
file { "create_$compile_directory":
file { "create-$compile_directory-$challenge_name":
path => $compile_directory,
ensure => directory,
recurse => true,
@@ -58,7 +60,7 @@ define secgen_functions::install_setgid_binary (
exec { "gcc_$challenge_name-$compile_directory":
cwd => $compile_directory,
command => "/usr/bin/make",
require => File["create_$compile_directory"]
require => File["create-$compile_directory-$challenge_name"]
}
# Move the compiled binary into the challenge directory