mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
assorted fixes for bugs found with randomconfig
This commit is contained in:
parent
e968fcd562
commit
4c97863109
@ -316,12 +316,15 @@ static int find_type(const char *type)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLE_FEATURE_FIND_PERM || ENABLE_FEATURE_FIND_MTIME \
|
||||||
|
|| ENABLE_FEATURE_FIND_MMIN
|
||||||
static const char* plus_minus_num(const char* str)
|
static const char* plus_minus_num(const char* str)
|
||||||
{
|
{
|
||||||
if (*str == '-' || *str == '+')
|
if (*str == '-' || *str == '+')
|
||||||
str++;
|
str++;
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static action*** parse_params(char **argv)
|
static action*** parse_params(char **argv)
|
||||||
{
|
{
|
||||||
@ -486,7 +489,7 @@ static action*** parse_params(char **argv)
|
|||||||
ap->subst_count[i] = count_subst(ap->exec_argv[i]);
|
ap->subst_count[i] = count_subst(ap->exec_argv[i]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_FEATURE_FIND_USER
|
#if ENABLE_FEATURE_FIND_USER
|
||||||
else if (strcmp(arg, "-user") == 0) {
|
else if (strcmp(arg, "-user") == 0) {
|
||||||
action_user *ap;
|
action_user *ap;
|
||||||
if (!*++argv)
|
if (!*++argv)
|
||||||
|
@ -122,7 +122,7 @@ static struct init_action *init_action_list = NULL;
|
|||||||
static char console[CONSOLE_BUFF_SIZE] = CONSOLE_DEV;
|
static char console[CONSOLE_BUFF_SIZE] = CONSOLE_DEV;
|
||||||
|
|
||||||
#if !ENABLE_SYSLOGD
|
#if !ENABLE_SYSLOGD
|
||||||
static char *log_console = VC_5;
|
static const char *log_console = VC_5;
|
||||||
#endif
|
#endif
|
||||||
#if !ENABLE_DEBUG_INIT
|
#if !ENABLE_DEBUG_INIT
|
||||||
static sig_atomic_t got_cont = 0;
|
static sig_atomic_t got_cont = 0;
|
||||||
|
@ -107,7 +107,8 @@ static inline int get_wol_pw(const char *ethoptarg, unsigned char *wol_passwd);
|
|||||||
|
|
||||||
int ether_wake_main(int argc, char *argv[])
|
int ether_wake_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char *ifname = "eth0", *pass = NULL;
|
const char *ifname = "eth0";
|
||||||
|
char *pass = NULL;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned char wol_passwd[6];
|
unsigned char wol_passwd[6];
|
||||||
int wol_passwd_sz = 0;
|
int wol_passwd_sz = 0;
|
||||||
|
@ -190,7 +190,7 @@ int ping_main(int argc, char **argv)
|
|||||||
len_and_sockaddr *lsa;
|
len_and_sockaddr *lsa;
|
||||||
#if ENABLE_PING6
|
#if ENABLE_PING6
|
||||||
sa_family_t af = AF_UNSPEC;
|
sa_family_t af = AF_UNSPEC;
|
||||||
while (++argv[0][0]) == '-') {
|
while (++argv[0][0] == '-') {
|
||||||
if (argv[0][1] == '4') {
|
if (argv[0][1] == '4') {
|
||||||
af = AF_INET;
|
af = AF_INET;
|
||||||
continue;
|
continue;
|
||||||
|
@ -2795,8 +2795,8 @@ int hush_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
debug_printf("\nrunning script '%s'\n", argv[optind]);
|
debug_printf("\nrunning script '%s'\n", argv[optind]);
|
||||||
global_argv = argv+optind;
|
global_argv = argv + optind;
|
||||||
global_argc = argc-optind;
|
global_argc = argc - optind;
|
||||||
input = xfopen(argv[optind], "r");
|
input = xfopen(argv[optind], "r");
|
||||||
opt = parse_file_outer(input);
|
opt = parse_file_outer(input);
|
||||||
|
|
||||||
@ -2809,8 +2809,8 @@ int hush_main(int argc, char **argv)
|
|||||||
for (cur = top_vars; cur; cur = tmp) {
|
for (cur = top_vars; cur; cur = tmp) {
|
||||||
tmp = cur->next;
|
tmp = cur->next;
|
||||||
if (!cur->flg_read_only) {
|
if (!cur->flg_read_only) {
|
||||||
free(cur->name);
|
free((char*)cur->name);
|
||||||
free(cur->value);
|
free((char*)cur->value);
|
||||||
free(cur);
|
free(cur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user