Fix crash in visudo introduced in sudo 1.8.9 when an IP address or
network is used in a host-based Defaults entry. Bug #766
This commit is contained in:
2
MANIFEST
2
MANIFEST
@@ -472,6 +472,8 @@ plugins/sudoers/regress/visudo/test7.sh
|
||||
plugins/sudoers/regress/visudo/test8.err.ok
|
||||
plugins/sudoers/regress/visudo/test8.out.ok
|
||||
plugins/sudoers/regress/visudo/test8.sh
|
||||
plugins/sudoers/regress/visudo/test9.out.ok
|
||||
plugins/sudoers/regress/visudo/test9.sh
|
||||
plugins/sudoers/set_perms.c
|
||||
plugins/sudoers/solaris_audit.c
|
||||
plugins/sudoers/solaris_audit.h
|
||||
|
@@ -43,7 +43,7 @@
|
||||
# define INADDR_NONE ((unsigned int)-1)
|
||||
#endif
|
||||
|
||||
static struct interface_list interfaces;
|
||||
static struct interface_list interfaces = SLIST_HEAD_INITIALIZER(interfaces);
|
||||
|
||||
/*
|
||||
* Parse a space-delimited list of IP address/netmask pairs and
|
||||
|
1
plugins/sudoers/regress/visudo/test9.out.ok
Normal file
1
plugins/sudoers/regress/visudo/test9.out.ok
Normal file
@@ -0,0 +1 @@
|
||||
stdin: parsed OK
|
12
plugins/sudoers/regress/visudo/test9.sh
Executable file
12
plugins/sudoers/regress/visudo/test9.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Test IP and network address in host-based Defaults statements
|
||||
# Bugzilla #766
|
||||
#
|
||||
|
||||
./visudo -cf - <<-EOF
|
||||
Defaults@127.0.0.1 !authenticate
|
||||
Defaults@10.0.0.0/8 !always_set_home
|
||||
EOF
|
||||
|
||||
exit 0
|
@@ -61,6 +61,7 @@
|
||||
#endif
|
||||
|
||||
#include "sudoers.h"
|
||||
#include "interfaces.h"
|
||||
#include "parse.h"
|
||||
#include "redblack.h"
|
||||
#include "sudoers_version.h"
|
||||
@@ -815,9 +816,11 @@ group_plugin_query(const char *user, const char *group, const struct passwd *pw)
|
||||
}
|
||||
|
||||
/* STUB */
|
||||
struct interface *get_interfaces(void)
|
||||
struct interface_list *
|
||||
get_interfaces(void)
|
||||
{
|
||||
return NULL;
|
||||
static struct interface_list dummy = SLIST_HEAD_INITIALIZER(interfaces);
|
||||
return &dummy;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user