|
|
523624 |
diff -up sudo-1.8.6p7/plugins/sudoers/match.c.constwarnfix sudo-1.8.6p7/plugins/sudoers/match.c
|
|
|
523624 |
--- sudo-1.8.6p7/plugins/sudoers/match.c.constwarnfix 2014-09-29 15:55:50.996485025 +0200
|
|
|
523624 |
+++ sudo-1.8.6p7/plugins/sudoers/match.c 2014-09-29 15:55:51.002484954 +0200
|
|
|
523624 |
@@ -599,7 +599,7 @@ command_matches_dir(char *sudoers_dir, s
|
|
|
523624 |
* Returns true if the hostname matches the pattern, else false
|
|
|
523624 |
*/
|
|
|
523624 |
bool
|
|
|
523624 |
-hostname_matches(char *shost, char *lhost, char *pattern)
|
|
|
523624 |
+hostname_matches(const char *shost, const char *lhost, const char *pattern)
|
|
|
523624 |
{
|
|
|
523624 |
debug_decl(hostname_matches, SUDO_DEBUG_MATCH)
|
|
|
523624 |
|
|
|
523624 |
@@ -621,7 +621,7 @@ hostname_matches(char *shost, char *lhos
|
|
|
523624 |
* else returns false.
|
|
|
523624 |
*/
|
|
|
523624 |
bool
|
|
|
523624 |
-userpw_matches(char *sudoers_user, char *user, struct passwd *pw)
|
|
|
523624 |
+userpw_matches(const char *sudoers_user, const char *user, const struct passwd *pw)
|
|
|
523624 |
{
|
|
|
523624 |
debug_decl(userpw_matches, SUDO_DEBUG_MATCH)
|
|
|
523624 |
if (pw != NULL && *sudoers_user == '#') {
|
|
|
523624 |
@@ -640,7 +640,7 @@ userpw_matches(char *sudoers_user, char
|
|
|
523624 |
* else returns false.
|
|
|
523624 |
*/
|
|
|
523624 |
bool
|
|
|
523624 |
-group_matches(char *sudoers_group, struct group *gr)
|
|
|
523624 |
+group_matches(const char *sudoers_group, const struct group *gr)
|
|
|
523624 |
{
|
|
|
523624 |
debug_decl(group_matches, SUDO_DEBUG_MATCH)
|
|
|
523624 |
if (*sudoers_group == '#') {
|
|
|
523624 |
@@ -659,7 +659,7 @@ group_matches(char *sudoers_group, struc
|
|
|
523624 |
* else returns false.
|
|
|
523624 |
*/
|
|
|
523624 |
bool
|
|
|
523624 |
-usergr_matches(char *group, char *user, struct passwd *pw)
|
|
|
523624 |
+usergr_matches(const char *group, const char *user, const struct passwd *pw)
|
|
|
523624 |
{
|
|
|
523624 |
int matched = false;
|
|
|
523624 |
struct passwd *pw0 = NULL;
|
|
|
523624 |
@@ -707,7 +707,7 @@ done:
|
|
|
523624 |
* XXX - swap order of host & shost
|
|
|
523624 |
*/
|
|
|
523624 |
bool
|
|
|
523624 |
-netgr_matches(char *netgr, char *lhost, char *shost, char *user)
|
|
|
523624 |
+netgr_matches(const char *netgr, const char *lhost, const char *shost, const char *user)
|
|
|
523624 |
{
|
|
|
523624 |
static char *domain;
|
|
|
523624 |
#ifdef HAVE_GETDOMAINNAME
|
|
|
523624 |
diff -up sudo-1.8.6p7/plugins/sudoers/parse.h.constwarnfix sudo-1.8.6p7/plugins/sudoers/parse.h
|
|
|
523624 |
--- sudo-1.8.6p7/plugins/sudoers/parse.h.constwarnfix 2014-09-29 15:55:50.992485072 +0200
|
|
|
523624 |
+++ sudo-1.8.6p7/plugins/sudoers/parse.h 2014-09-29 15:55:51.002484954 +0200
|
|
|
523624 |
@@ -188,11 +188,11 @@ bool addr_matches(char *n);
|
|
|
523624 |
|
|
|
523624 |
/* match.c */
|
|
|
523624 |
bool command_matches(char *sudoers_cmnd, char *sudoers_args);
|
|
|
523624 |
-bool group_matches(char *sudoers_group, struct group *gr);
|
|
|
523624 |
-bool hostname_matches(char *shost, char *lhost, char *pattern);
|
|
|
523624 |
-bool netgr_matches(char *netgr, char *lhost, char *shost, char *user);
|
|
|
523624 |
-bool usergr_matches(char *group, char *user, struct passwd *pw);
|
|
|
523624 |
-bool userpw_matches(char *sudoers_user, char *user, struct passwd *pw);
|
|
|
523624 |
+bool group_matches(const char *sudoers_group, const struct group *gr);
|
|
|
523624 |
+bool hostname_matches(const char *shost, const char *lhost, const char *pattern);
|
|
|
523624 |
+bool netgr_matches(const char *netgr, const char *lhost, const char *shost, const char *user);
|
|
|
523624 |
+bool usergr_matches(const char *group, const char *user, const struct passwd *pw);
|
|
|
523624 |
+bool userpw_matches(const char *sudoers_user, const char *user, const struct passwd *pw);
|
|
|
523624 |
int cmnd_matches(struct member *m);
|
|
|
523624 |
int cmndlist_matches(struct member_list *list);
|
|
|
523624 |
int hostlist_matches(struct member_list *list);
|
|
|
523624 |
diff -up sudo-1.8.6p7/plugins/sudoers/pwutil.c.constwarnfix sudo-1.8.6p7/plugins/sudoers/pwutil.c
|
|
|
523624 |
--- sudo-1.8.6p7/plugins/sudoers/pwutil.c.constwarnfix 2013-02-25 20:42:44.000000000 +0100
|
|
|
523624 |
+++ sudo-1.8.6p7/plugins/sudoers/pwutil.c 2014-09-29 15:55:51.003484942 +0200
|
|
|
523624 |
@@ -841,7 +841,7 @@ sudo_endgrent(void)
|
|
|
523624 |
}
|
|
|
523624 |
|
|
|
523624 |
struct group_list *
|
|
|
523624 |
-sudo_get_grlist(struct passwd *pw)
|
|
|
523624 |
+sudo_get_grlist(const struct passwd *pw)
|
|
|
523624 |
{
|
|
|
523624 |
struct cache_item key, *item;
|
|
|
523624 |
struct rbnode *node;
|
|
|
523624 |
@@ -905,7 +905,7 @@ done:
|
|
|
523624 |
}
|
|
|
523624 |
|
|
|
523624 |
bool
|
|
|
523624 |
-user_in_group(struct passwd *pw, const char *group)
|
|
|
523624 |
+user_in_group(const struct passwd *pw, const char *group)
|
|
|
523624 |
{
|
|
|
523624 |
struct group_list *grlist;
|
|
|
523624 |
struct group *grp = NULL;
|
|
|
523624 |
diff -up sudo-1.8.6p7/plugins/sudoers/sudoers.h.constwarnfix sudo-1.8.6p7/plugins/sudoers/sudoers.h
|
|
|
523624 |
--- sudo-1.8.6p7/plugins/sudoers/sudoers.h.constwarnfix 2013-02-25 20:49:09.000000000 +0100
|
|
|
523624 |
+++ sudo-1.8.6p7/plugins/sudoers/sudoers.h 2014-09-29 15:55:51.003484942 +0200
|
|
|
523624 |
@@ -288,9 +288,9 @@ __dso_public struct group *sudo_getgrgid
|
|
|
523624 |
__dso_public struct group *sudo_getgrnam(const char *);
|
|
|
523624 |
__dso_public void sudo_gr_addref(struct group *);
|
|
|
523624 |
__dso_public void sudo_gr_delref(struct group *);
|
|
|
523624 |
-bool user_in_group(struct passwd *, const char *);
|
|
|
523624 |
+bool user_in_group(const struct passwd *, const char *);
|
|
|
523624 |
struct group *sudo_fakegrnam(const char *);
|
|
|
523624 |
-struct group_list *sudo_get_grlist(struct passwd *pw);
|
|
|
523624 |
+struct group_list *sudo_get_grlist(const struct passwd *pw);
|
|
|
523624 |
struct passwd *sudo_fakepwnam(const char *, gid_t);
|
|
|
523624 |
struct passwd *sudo_fakepwnamid(const char *user, uid_t uid, gid_t gid);
|
|
|
523624 |
struct passwd *sudo_getpwnam(const char *);
|