chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25e870b
)
main: refuse excess command line arguments
author
Lennart Poettering
<lennart@poettering.net>
Sat, 24 Apr 2010 03:16:50 +0000
(
05:16
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Sat, 24 Apr 2010 03:16:50 +0000
(
05:16
+0200)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index d2721fd0996ea975a17b4a4d328fecedd21263eb..0128787d1471db38ae1c5d61d5abc0e0f55fbbdb 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-463,6
+463,15
@@
static int parse_argv(int argc, char *argv[]) {
return -EINVAL;
}
+ /* PID 1 will get the kernel arguments as parameters, which we
+ * ignore and unconditionally read from
+ * /proc/cmdline. However, we need to ignore those arguments
+ * here. */
+ if (running_as != MANAGER_INIT && optind < argc) {
+ log_error("Excess arguments.");
+ return -EINVAL;
+ }
+
return 0;
}