Merge mainline into bidi
This commit is contained in:
commit
e8d0a8f85c
271 changed files with 14187 additions and 16216 deletions
|
@ -133,25 +133,24 @@ static int
|
|||
is_authenticated (const char *userlist)
|
||||
{
|
||||
const char *superusers;
|
||||
|
||||
auto int hook (grub_list_t item);
|
||||
int hook (grub_list_t item)
|
||||
{
|
||||
const char *name;
|
||||
if (!((struct grub_auth_user *) item)->authenticated)
|
||||
return 0;
|
||||
name = ((struct grub_auth_user *) item)->name;
|
||||
|
||||
return (userlist && grub_strword (userlist, name))
|
||||
|| grub_strword (superusers, name);
|
||||
}
|
||||
struct grub_auth_user *user;
|
||||
|
||||
superusers = grub_env_get ("superusers");
|
||||
|
||||
if (!superusers)
|
||||
return 1;
|
||||
|
||||
return grub_list_iterate (GRUB_AS_LIST (users), hook);
|
||||
FOR_LIST_ELEMENTS (user, users)
|
||||
{
|
||||
if (!(user->authenticated))
|
||||
continue;
|
||||
|
||||
if ((userlist && grub_strword (userlist, user->name))
|
||||
|| grub_strword (superusers, user->name))
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -205,22 +204,7 @@ grub_auth_check_authentication (const char *userlist)
|
|||
grub_err_t err;
|
||||
static unsigned long punishment_delay = 1;
|
||||
char entered[GRUB_AUTH_MAX_PASSLEN];
|
||||
|
||||
auto int hook (grub_list_t item);
|
||||
int hook (grub_list_t item)
|
||||
{
|
||||
if (grub_strcmp (login, ((struct grub_auth_user *) item)->name) == 0)
|
||||
cur = (struct grub_auth_user *) item;
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto int hook_any (grub_list_t item);
|
||||
int hook_any (grub_list_t item)
|
||||
{
|
||||
if (((struct grub_auth_user *) item)->callback)
|
||||
cur = (struct grub_auth_user *) item;
|
||||
return 0;
|
||||
}
|
||||
struct grub_auth_user *user;
|
||||
|
||||
grub_memset (login, 0, sizeof (login));
|
||||
|
||||
|
@ -240,7 +224,11 @@ grub_auth_check_authentication (const char *userlist)
|
|||
if (!grub_password_get (entered, GRUB_AUTH_MAX_PASSLEN))
|
||||
goto access_denied;
|
||||
|
||||
grub_list_iterate (GRUB_AS_LIST (users), hook);
|
||||
FOR_LIST_ELEMENTS (user, users)
|
||||
{
|
||||
if (grub_strcmp (login, user->name) == 0)
|
||||
cur = user;
|
||||
}
|
||||
|
||||
if (!cur || ! cur->callback)
|
||||
goto access_denied;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue