diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-16 22:25:55 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-16 22:25:55 +0200 |
commit | 8426fc4411c9679a10863d7aa3ced077155e0016 (patch) | |
tree | 264e43314c759e8556ec2729fce58de015eeb286 /src | |
parent | 805b421d1880432bd6803a0e069ed10a4b1d53de (diff) | |
download | pies-8426fc4411c9679a10863d7aa3ced077155e0016.tar.gz pies-8426fc4411c9679a10863d7aa3ced077155e0016.tar.bz2 |
Minor fixes.
* grecs: Upgrade.
* lib/parsetime.c: Fix senseless compiler warnings.
* src/acl.c: Fix docstrings.
* src/meta1gram.y (yyerror): Change argument
* src/meta1lex.l: Add flex options
* src/pies.h (meta1error): Change signature.
* src/progman.c (prog_lookup_by_socket): Remove.
* src/sysvinit.c (sysvinit_stop_filter): Remove.
Diffstat (limited to 'src')
-rw-r--r-- | src/acl.c | 8 | ||||
-rw-r--r-- | src/meta1gram.y | 4 | ||||
-rw-r--r-- | src/meta1lex.l | 2 | ||||
-rw-r--r-- | src/pies.h | 2 | ||||
-rw-r--r-- | src/progman.c | 13 | ||||
-rw-r--r-- | src/sysvinit.c | 28 |
6 files changed, 16 insertions, 41 deletions
@@ -134,13 +134,13 @@ create_acl_sockaddr (int family, int len) struct pies_sockaddr *p = xzalloc (sizeof (*p)); p->salen = len; p->sa.sa_family = family; return p; } -/* allow|deny [all|authenticated|group <grp: list>] +/* allow|deny [all|authenticated|group <grp: list>|user <usr: list>] [acl <name: string>] [from <addr: list>] */ static int _parse_token (struct acl_entry *entry, const grecs_value_t *value) { if (strcmp (value->v.string, "all") == 0 @@ -557,27 +557,25 @@ deny_cb (enum grecs_callback_command cmd, parse_acl_line (locus, 0, acl, value); return 0; } struct grecs_keyword acl_keywords[] = { /* TRANSLATORS: only words within angle brackets are translatable */ - { "allow", N_("[all|authenticated|user <usr: list>|group <grp: list>] [from <addr: list>]"), + { "allow", N_("[all|authenticated|user <usr: list>|group <grp: list>] [acl <name: string>] [from <addr: list>]"), N_("Allow access"), grecs_type_string, GRECS_MULT, NULL, 0, allow_cb }, /* TRANSLATORS: only words within angle brackets are translatable */ - { "deny", N_("[all|authenticated|user <usr: list>|group <grp: list>] [from <addr: list>]"), + { "deny", N_("[all|authenticated|user <usr: list>|group <grp: list>] [acl <name: string>] [from <addr: list>]"), N_("Deny access"), grecs_type_string, GRECS_MULT, NULL, 0, deny_cb }, { NULL } }; - - /* ACL verification */ #define S_UN_NAME(sa, salen) \ ((salen < offsetof (struct sockaddr_un,sun_path)) ? "" : (sa)->sun_path) static int diff --git a/src/meta1gram.y b/src/meta1gram.y index a5eb5f3..2f774d2 100644 --- a/src/meta1gram.y +++ b/src/meta1gram.y @@ -20,13 +20,13 @@ configuration statements. */ #include "pies.h" #include "grecs-locus.h" #include "meta1lex.h" #include "meta1gram.h" - + #define META1_QUEUE_DIR() \ (meta1_queue_dir ? meta1_queue_dir : "/var/spool/meta1") enum meta1_stmt_type { meta1_simple, @@ -221,13 +221,13 @@ values : value opt_sc : /* empty */ | ';' ; %% int -yyerror (char *s) +yyerror (char const *s) { grecs_error (&yylloc, 0, "%s", s); return 0; } void diff --git a/src/meta1lex.l b/src/meta1lex.l index bbe54a0..2aca914 100644 --- a/src/meta1lex.l +++ b/src/meta1lex.l @@ -1,7 +1,9 @@ /* MeTA1 configuration lexer for GNU Pies. -*- c -*- */ +%option nounput +%option noinput %top { /* MeTA1 configuration lexer for GNU Pies. Copyright (C) 2008, 2009, 2010, 2011, 2013 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -430,13 +430,13 @@ int parse_limits (limits_record_t *plrec, char *str, char **endp); int set_limits (const char *name, limits_record_t lrec); void free_limits (limits_record_t rec); void meta1_parser_set_debug (void); int meta1lex (void); -int meta1error (char *s); +int meta1error (char const *s); int meta1parse (void); /* diag.c */ #define DIAG_TO_SYSLOG 0x1 #define DIAG_TO_STDERR 0x2 diff --git a/src/progman.c b/src/progman.c index 1ec5a8d..4864531 100644 --- a/src/progman.c +++ b/src/progman.c @@ -65,23 +65,12 @@ prog_lookup_by_pid (pid_t pid) for (prog = proghead; prog; prog = prog->next) if (prog->pid == pid) break; return prog; } -static struct prog * -prog_lookup_by_socket (int fd) -{ - struct prog *prog; - - for (prog = proghead; prog; prog = prog->next) - if (IS_COMPONENT (prog) && prog->v.p.socket == fd) - break; - return prog; -} - struct prog * prog_lookup_by_tag (const char *tag) { struct prog *prog; for (prog = proghead; prog; prog = prog->next) if (strcmp (prog->tag, tag) == 0) @@ -677,13 +666,13 @@ add_env (const char *name, const char *value) if (envsize == 0) { char **new_env; envsize = i + 4; new_env = xcalloc (envsize, sizeof new_env[0]); - for (i = 0; new_env[i] = environ[i]; i++) + for (i = 0; (new_env[i] = environ[i]); i++) ; environ = new_env; } else if (i == envsize) { envsize += 4; diff --git a/src/sysvinit.c b/src/sysvinit.c index 614940c..4fd4559 100644 --- a/src/sysvinit.c +++ b/src/sysvinit.c @@ -21,22 +21,24 @@ enum boot_state { sysinit, boot, single, normal, - max_boot_state }; static char *boot_state_name[] = { - "sysinit", - "boot", - "single", - "normal" + [sysinit] = "sysinit", + [boot] = "boot", + [single] = "single", + [normal] = "normal" }; +#define max_boot_state sizeof(boot_state_name) / sizeof (boot_state_name[0]) + + static char boot_state_str[] = "#*s "; static const char valid_runlevels[] = "0123456789S"; static int boot_trans_tab[max_boot_state][sizeof(valid_runlevels)-1] = { /* 0, 1, 2, 3, 4, */ @@ -397,28 +399,12 @@ sysvinit_setenv (char const *data, int size) } } static void create_fifo (void); static int -sysvinit_stop_filter (struct prog *prog, void *data) -{ - switch (prog->v.p.status) - { - case status_enabled: - case status_listener: - prog_stop (prog, SIGTERM); - prog->v.p.status = status_disabled; /* See FIXME, progman.c:2364 */ - break; - default: - break; - } - return 0; -} - -static int sysvinit_fifo_handler (int fd, void *data) { static size_t size; union { struct sysvinit_request req; |