Skip to content

Commit 69bd945

Browse files
authored
Merge pull request #6910 from jsquyres/pr/orterun-remove-duplicate-code
orterun: remove duplicate code
2 parents 4e06be1 + 197beb3 commit 69bd945

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

orte/tools/orterun/orterun.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -137,37 +137,6 @@ int orterun(int argc, char *argv[])
137137
exit(1);
138138
}
139139

140-
/* check if we are running as root - if we are, then only allow
141-
* us to proceed if the allow-run-as-root flag was given. Otherwise,
142-
* exit with a giant warning flag
143-
*/
144-
if (0 == geteuid() && !orte_cmd_options.run_as_root) {
145-
char *r1, *r2;
146-
if (NULL != (r1 = getenv("OMPI_ALLOW_RUN_AS_ROOT")) &&
147-
NULL != (r2 = getenv("OMPI_ALLOW_RUN_AS_ROOT_CONFIRM"))) {
148-
if (0 == strcmp(r1, "1") && 0 == strcmp(r2, "1")) {
149-
goto moveon;
150-
}
151-
}
152-
153-
fprintf(stderr, "--------------------------------------------------------------------------\n");
154-
if (NULL != orte_cmd_options.help) {
155-
fprintf(stderr, "%s cannot provide the help message when run as root.\n", orte_basename);
156-
} else {
157-
/* show_help is not yet available, so print an error manually */
158-
fprintf(stderr, "%s has detected an attempt to run as root.\n", orte_basename);
159-
}
160-
fprintf(stderr, "Running at root is *strongly* discouraged as any mistake (e.g., in\n");
161-
fprintf(stderr, "defining TMPDIR) or bug can result in catastrophic damage to the OS\n");
162-
fprintf(stderr, "file system, leaving your system in an unusable state.\n\n");
163-
fprintf(stderr, "You can override this protection by adding the --allow-run-as-root\n");
164-
fprintf(stderr, "option to your cmd line. However, we reiterate our strong advice\n");
165-
fprintf(stderr, "against doing so - please do so at your own risk.\n");
166-
fprintf(stderr, "--------------------------------------------------------------------------\n");
167-
exit(1);
168-
}
169-
170-
moveon:
171140
/* setup to listen for commands sent specifically to me, even though I would probably
172141
* be the one sending them! Unfortunately, since I am a participating daemon,
173142
* there are times I need to send a command to "all daemons", and that means *I* have

0 commit comments

Comments
 (0)