Add a sequence number in the aliases for loop detection. If we find

an alias with the seqno already set to the current (global) value we
know we've visited it before so ignore it.
This commit is contained in:
Todd C. Miller
2007-09-15 11:24:54 +00:00
parent 4f5e88532f
commit 76e5eb434b
4 changed files with 98 additions and 35 deletions

View File

@@ -119,6 +119,7 @@ struct member {
struct alias {
char *name; /* alias name */
int type; /* {USER,HOST,RUNAS,CMND}ALIAS */
unsigned int seqno; /* sequence number */
struct member_list members; /* list of alias members */
};
@@ -140,6 +141,11 @@ struct defaults {
extern struct userspec_list userspecs;
extern struct defaults_list defaults;
/*
* Alias sequence number to avoid loops.
*/
extern unsigned int alias_seqno;
/*
* Prototypes
*/