4 | 4 |
issue.
|
5 | 5 |
Author: Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C, heroxbd <heroxbd@gentoo.org>
|
6 | 6 |
Origin: upstream
|
7 | |
Date: 2014-01-21
|
|
7 |
Date: 2014-02-09
|
8 | 8 |
|
9 | 9 |
--- a/sh/gendepends.sh.in
|
10 | 10 |
+++ b/sh/gendepends.sh.in
|
|
246 | 246 |
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
247 | 247 |
+
|
248 | 248 |
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
249 |
--- a/src/rc/rc-misc.c
|
|
250 |
+++ b/src/rc/rc-misc.c
|
|
251 |
@@ -296,7 +296,7 @@
|
|
252 |
sigprocmask(SIG_SETMASK, &old, NULL);
|
|
253 |
|
|
254 |
/* Safe to run now */
|
|
255 |
- execl(file, file, "--lockfd", sfd, arg, (char *) NULL);
|
|
256 |
+ execl("/sbin/openrc-run", "/sbin/openrc-run", file, "--lockfd", sfd, arg, (char *) NULL);
|
|
257 |
fprintf(stderr, "unable to exec `%s': %s\n",
|
|
258 |
file, strerror(errno));
|
|
259 |
svc_unlock(basename_c(service), fd);
|
|
260 |
--- /dev/null
|
|
261 |
+++ b/src/lsb2rcconf/tests/run.sh
|
|
262 |
@@ -0,0 +1,3 @@
|
|
263 |
+#!/bin/sh
|
|
264 |
+
|
|
265 |
+exit 0
|
249 | 266 |
--- /dev/null
|
250 | 267 |
+++ b/src/lsb2rcconf/main.c
|
251 | |
@@ -0,0 +1,640 @@
|
|
268 |
@@ -0,0 +1,654 @@
|
252 | 269 |
+/*
|
253 | 270 |
+ lsb2rcconf - prints configuration for openrc's rc.conf based on LSB
|
254 | 271 |
+
|
|
301 | 318 |
+#include <unistd.h> /* access() */
|
302 | 319 |
+
|
303 | 320 |
+#include "../includes/helpers.h"
|
|
321 |
+
|
|
322 |
+
|
|
323 |
+#define SERVICENAME_ALL "_all"
|
304 | 324 |
+
|
305 | 325 |
+/* === portability hacks === */
|
306 | 326 |
+
|
|
403 | 423 |
+ int *relation_count_p;
|
404 | 424 |
+ int relation_max;
|
405 | 425 |
+ hsearch_data_t *relation_ht_p;
|
|
426 |
+ char relation_has_all; /* did we met "$all" virtual services or not */
|
406 | 427 |
+};
|
407 | 428 |
+
|
408 | 429 |
+#define RELATION(relation_name)\
|
|
469 | 490 |
+ switch (*service) {
|
470 | 491 |
+ case '$': {
|
471 | 492 |
+ service++;
|
|
493 |
+
|
|
494 |
+ if (!arg_p->relation_has_all)
|
|
495 |
+ arg_p->relation_has_all = (strcmp(service, "all") == 0);
|
|
496 |
+
|
472 | 497 |
+ const char *const services = lsb_v2s(service);
|
473 | 498 |
+ if (services != NULL) {
|
474 | 499 |
+ void relation_add_mark_real_service(char *service, void *arg) {
|
|
625 | 650 |
+{
|
626 | 651 |
+ /* Hardcoded: */
|
627 | 652 |
+ ENTRY entries_v2s[] = {
|
628 | |
+ {"all", "+*"},
|
629 | |
+ {NULL, NULL},
|
|
653 |
+ {"all", "+"SERVICENAME_ALL},
|
|
654 |
+ {NULL, NULL},
|
630 | 655 |
+ };
|
631 | 656 |
+ ENTRY entries_s2v[] = {
|
632 | |
+ {"*", "all"},
|
633 | |
+ {NULL, NULL},
|
|
657 |
+ {SERVICENAME_ALL, "all"},
|
|
658 |
+ {NULL, NULL},
|
634 | 659 |
+ };
|
635 | 660 |
+
|
636 | 661 |
+
|
|
684 | 709 |
+ return lsb_x2x(lsb_virtual, &ht_lsb_s2v);
|
685 | 710 |
+}
|
686 | 711 |
+#endif
|
687 | |
+
|
688 | |
+char *lsb_expand(const char *const _services)
|
|
712 |
+#if 0
|
|
713 |
+char *lsb_expand(const char *const _services, int *has_Sall)
|
689 | 714 |
+{
|
690 | 715 |
+ char *ret = xmalloc(BUFSIZ);
|
691 | 716 |
+ char *ptr = ret, *ret_end = &ret[BUFSIZ];
|
|
696 | 721 |
+ switch (*service) {
|
697 | 722 |
+ case '$': {
|
698 | 723 |
+ const char * const service_expanded = lsb_v2s(&service[1]);
|
|
724 |
+ if (has_Sall != NULL)
|
|
725 |
+ has_Sall = (strcmp(&service[1], "all") == 0);
|
699 | 726 |
+
|
700 | 727 |
+ if (service_expanded == NULL)
|
701 | 728 |
+ return;
|
|
723 | 750 |
+ free(services);
|
724 | 751 |
+ return ret;
|
725 | 752 |
+}
|
726 | |
+
|
|
753 |
+#endif
|
727 | 754 |
+static void lsb_header_parse(const char *const header, char *value)
|
728 | 755 |
+{
|
729 | 756 |
+ if (!strcmp(header, "provides")) {
|
|
820 | 847 |
+
|
821 | 848 |
+l_lsb_parse_end:
|
822 | 849 |
+
|
|
850 |
+ if (state == LP_COMPLETE)
|
|
851 |
+ if (! (use_arg.relation_has_all || need_arg.relation_has_all))
|
|
852 |
+ PROVIDE(SERVICENAME_ALL);
|
|
853 |
+
|
823 | 854 |
+ fclose(file_initdscript);
|
824 | 855 |
+ return state;
|
825 | 856 |
+}
|
|
889 | 920 |
+
|
890 | 921 |
+ exit(0);
|
891 | 922 |
+}
|
892 | |
--- a/src/rc/rc-misc.c
|
893 | |
+++ b/src/rc/rc-misc.c
|
894 | |
@@ -296,7 +296,7 @@
|
895 | |
sigprocmask(SIG_SETMASK, &old, NULL);
|
896 | |
|
897 | |
/* Safe to run now */
|
898 | |
- execl(file, file, "--lockfd", sfd, arg, (char *) NULL);
|
899 | |
+ execl("/sbin/openrc-run", "/sbin/openrc-run", file, "--lockfd", sfd, arg, (char *) NULL);
|
900 | |
fprintf(stderr, "unable to exec `%s': %s\n",
|
901 | |
file, strerror(errno));
|
902 | |
svc_unlock(basename_c(service), fd);
|
903 | |
--- /dev/null
|
904 | |
+++ b/src/lsb2rcconf/tests/run.sh
|
905 | |
@@ -0,0 +1,3 @@
|
906 | |
+#!/bin/sh
|
907 | |
+
|
908 | |
+exit 0
|