mirror of
https://github.com/sheumann/hush.git
synced 2024-08-20 04:28:57 +00:00
restore compare_string_array new interface (make broken by landley)
This commit is contained in:
parent
d4f15e95d6
commit
2f0a5f947a
@ -467,7 +467,7 @@ typedef struct {
|
|||||||
} procps_status_t;
|
} procps_status_t;
|
||||||
|
|
||||||
extern procps_status_t * procps_scan(int save_user_arg0);
|
extern procps_status_t * procps_scan(int save_user_arg0);
|
||||||
extern unsigned short compare_string_array(const char *string_array[], const char *key);
|
extern int compare_string_array(const char * const string_array[], const char *key);
|
||||||
|
|
||||||
extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret);
|
extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret);
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ static void process_config_line (const char *line, unsigned long *event_mask)
|
|||||||
"PERMISSIONS", "MODLOAD", "EXECUTE", "COPY", "IGNORE",
|
"PERMISSIONS", "MODLOAD", "EXECUTE", "COPY", "IGNORE",
|
||||||
"MKOLDCOMPAT", "MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT", 0 };
|
"MKOLDCOMPAT", "MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT", 0 };
|
||||||
|
|
||||||
short int i;
|
int i;
|
||||||
|
|
||||||
debug_msg_logger(LOG_INFO, __FUNCTION__);
|
debug_msg_logger(LOG_INFO, __FUNCTION__);
|
||||||
|
|
||||||
@ -1295,7 +1295,7 @@ static const char *get_variable (const char *variable, void *info)
|
|||||||
const char *field_names[] = { "hostname", "mntpt", "devpath", "devname",
|
const char *field_names[] = { "hostname", "mntpt", "devpath", "devname",
|
||||||
"uid", "gid", "mode", hostname, mount_point,
|
"uid", "gid", "mode", hostname, mount_point,
|
||||||
gv_info->devpath, gv_info->devname, 0 };
|
gv_info->devpath, gv_info->devname, 0 };
|
||||||
short int i;
|
int i;
|
||||||
|
|
||||||
debug_msg_logger(LOG_INFO, __FUNCTION__);
|
debug_msg_logger(LOG_INFO, __FUNCTION__);
|
||||||
|
|
||||||
|
@ -443,7 +443,7 @@ extern int ipaddr_list_or_flush(int argc, char **argv, int flush)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (argc > 0) {
|
while (argc > 0) {
|
||||||
const unsigned short option_num = compare_string_array(option, *argv);
|
const int option_num = compare_string_array(option, *argv);
|
||||||
switch (option_num) {
|
switch (option_num) {
|
||||||
case 0: /* to */
|
case 0: /* to */
|
||||||
NEXT_ARG();
|
NEXT_ARG();
|
||||||
@ -658,7 +658,7 @@ static int ipaddr_modify(int cmd, int argc, char **argv)
|
|||||||
req.ifa.ifa_family = preferred_family;
|
req.ifa.ifa_family = preferred_family;
|
||||||
|
|
||||||
while (argc > 0) {
|
while (argc > 0) {
|
||||||
const unsigned short option_num = compare_string_array(option, *argv);
|
const int option_num = compare_string_array(option, *argv);
|
||||||
switch (option_num) {
|
switch (option_num) {
|
||||||
case 0: /* peer */
|
case 0: /* peer */
|
||||||
case 1: /* remote */
|
case 1: /* remote */
|
||||||
@ -805,7 +805,7 @@ static int ipaddr_modify(int cmd, int argc, char **argv)
|
|||||||
extern int do_ipaddr(int argc, char **argv)
|
extern int do_ipaddr(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *commands[] = { "add", "delete", "list", "show", "lst", "flush", 0 };
|
const char *commands[] = { "add", "delete", "list", "show", "lst", "flush", 0 };
|
||||||
unsigned short command_num = 2;
|
int command_num = 2;
|
||||||
|
|
||||||
if (*argv) {
|
if (*argv) {
|
||||||
command_num = compare_string_array(commands, *argv);
|
command_num = compare_string_array(commands, *argv);
|
||||||
|
@ -654,7 +654,8 @@ static int iproute_get(int argc, char **argv)
|
|||||||
char *odev = NULL;
|
char *odev = NULL;
|
||||||
int connected = 0;
|
int connected = 0;
|
||||||
int from_ok = 0;
|
int from_ok = 0;
|
||||||
const char *options[] = { "from", "iif", "oif", "dev", "notify", "connected", "to", 0 };
|
static const char * const options[] =
|
||||||
|
{ "from", "iif", "oif", "dev", "notify", "connected", "to", 0 };
|
||||||
|
|
||||||
memset(&req, 0, sizeof(req));
|
memset(&req, 0, sizeof(req));
|
||||||
|
|
||||||
@ -813,9 +814,10 @@ static int iproute_get(int argc, char **argv)
|
|||||||
|
|
||||||
int do_iproute(int argc, char **argv)
|
int do_iproute(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *ip_route_commands[] = { "add", "append", "change", "chg",
|
static const char * const ip_route_commands[] =
|
||||||
"delete", "del", "get", "list", "show", "prepend", "replace", "test", "flush", 0 };
|
{ "add", "append", "change", "chg", "delete", "del", "get",
|
||||||
unsigned short command_num = 7;
|
"list", "show", "prepend", "replace", "test", "flush", 0 };
|
||||||
|
int command_num = 7;
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
int cmd = RTM_NEWROUTE;
|
int cmd = RTM_NEWROUTE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user