diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2013-12-11 17:39:38 -0600 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2013-12-12 18:31:29 -0600 |
commit | 7b5fa011ac7a9544fe68a9abb2f8ef940d9845f7 (patch) | |
tree | b8c99079eac82e8c3a7c43b8d65585eb3b9a1f7f /src/rc/rc-applets.c | |
parent | 09733d3fae77265263b1e918b9fce66a1c7a519a (diff) |
Rename the rc binary to openrc
Debian requested this rename due to the "rc" binary conflicting with the
"rc" binary from the plan 9 shell.
We also add a deprecation warning to the binary when it is run as rc to
encourage users to switch to openrc instead.
X-Gentoo-Bug: 493958
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493958
Diffstat (limited to 'src/rc/rc-applets.c')
-rw-r--r-- | src/rc/rc-applets.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rc/rc-applets.c b/src/rc/rc-applets.c index 64b6e888..8431eea3 100644 --- a/src/rc/rc-applets.c +++ b/src/rc/rc-applets.c @@ -533,11 +533,18 @@ run_applets(int argc, char **argv) { size_t i; + /* + * The "rc" applet is deprecated and should be referred to as + * "openrc", so output a warning. + */ + if (strcmp(applet, "rc") == 0) + ewarn("The 'rc' applet is deprecated; please use 'openrc' instead."); /* Bug 351712: We need an extra way to explicitly select an applet OTHER * than trusting argv[0], as argv[0] is not going to be the applet value if * we are doing SELinux context switching. For this, we allow calls such as * 'rc --applet APPLET', and shift ALL of argv down by two array items. */ - if (strcmp(applet, "rc") == 0 && argc >= 3 && + if ((strcmp(applet, "rc") == 0 || strcmp(applet, "openrc") == 0) && + argc >= 3 && (strcmp(argv[1],"--applet") == 0 || strcmp(argv[1], "-a") == 0)) { applet = argv[2]; argv += 2; @@ -557,6 +564,6 @@ run_applets(int argc, char **argv) if (strncmp(applet, "mark_service_", strlen("mark_service_")) == 0) exit(do_mark_service(argc, argv)); - if (strcmp(applet, "rc") != 0) + if (strcmp(applet, "rc") != 0 && strcmp(applet, "openrc") != 0) eerrorx("%s: unknown applet", applet); } |