diff --git a/pym/bob/input.py b/pym/bob/input.py index d61ee67b..a40ae7bd 100644 --- a/pym/bob/input.py +++ b/pym/bob/input.py @@ -687,11 +687,6 @@ def __init__(self, coreStep, env, enabled, spec): } self.user = recipeSet.getSandboxUser() or spec.get('user', "nobody") - self.user = { - k : env.substitute(v, "providedSandbox::user") - for (k, v) in spec.get('user', {}).items() - } - # Calculate a "resultId" so that only identical sandboxes match h = hashlib.sha1() h.update(self.coreStep.variantId) @@ -708,7 +703,6 @@ def __init__(self, coreStep, env, enabled, spec): h.update(struct.pack(" set host name\n" - " -U set custom uid\n" - " -G set custom gid\n" " -D if set, debug info will be printed\n" " -l redirect stdout to a file\n" " -L redirect stderr to a file\n" @@ -246,20 +242,6 @@ static void ParseOptionsFile(const char *filename, struct Options *opt) { ParseCommandLine(sub_argc, sub_argv, opt); } -// Function to check if a string is a numeric string -bool IsNumeric(const char *str) { - if (str == NULL || *str == '\0') { - return false; - } - while (*str) { - if (*str < '0' || *str > '9') { - return false; - } - str++; - } - return true; -} - // Parse the command line flags and return the result in an Options structure // passed as argument. static void ParseCommandLine(int argc, char *const *argv, struct Options *opt) { @@ -268,7 +250,6 @@ static void ParseCommandLine(int argc, char *const *argv, struct Options *opt) { int c; while ((c = getopt(argc, argv, ":CDd:il:L:m:M:nrS:W:w:H:")) != -1) { - switch (c) { case 'C': // Shortcut for the "does this system support sandboxing" check. @@ -350,20 +331,6 @@ static void ParseCommandLine(int argc, char *const *argv, struct Options *opt) { case 'H': opt->host_name = optarg; break; - case 'U': - if (IsNumeric(optarg)) { - opt->custom_uid = atoi(optarg); - } else { - Usage(argc, argv, "The -U option must be a numeric string."); - } - break; - case 'G': - if (IsNumeric(optarg)) { - opt->custom_gid = atoi(optarg); - } else { - Usage(argc, argv, "The -G option must be a numeric string."); - } - break; case 'D': global_debug = true; break; @@ -719,8 +686,6 @@ static void ExecCommand(char *const *argv) { int main(int argc, char *const argv[]) { struct Options opt; - opt.custom_uid = kNobodyUid; - opt.custom_gid = kNobodyGid; memset(&opt, 0, sizeof(opt)); opt.uid = kNobodyUid; opt.gid = kNobodyGid; @@ -759,10 +724,8 @@ int main(int argc, char *const argv[]) { // outside environment. CHECK_CALL(mount("none", "/", NULL, MS_REC | MS_PRIVATE, NULL)); - SetupDirectories(&opt, opt.uid); SetupUserNamespace(uid, gid, opt.uid, opt.gid); - if (opt.host_name) { CHECK_CALL(sethostname(opt.host_name, strlen(opt.host_name))); }