/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
struct grub_auth_user
{
char *name;
void *arg;
int authenticated;
};
void *arg)
{
if (!cur)
if (!cur)
return grub_errno;
{
{
return grub_errno;
}
}
return GRUB_ERR_NONE;
}
{
if (!cur)
if (!cur->authenticated)
{
}
else
{
}
return GRUB_ERR_NONE;
}
{
if (!cur)
if (!cur)
return grub_errno;
{
{
return grub_errno;
}
}
return GRUB_ERR_NONE;
}
{
if (!cur)
{
}
else
cur->authenticated = 0;
return GRUB_ERR_NONE;
}
static int
{
const char *superusers;
if (!superusers)
return 1;
{
if (!(user->authenticated))
continue;
return 1;
}
return 0;
}
static int
{
unsigned cur_len = 0;
int key;
while (1)
{
key = grub_getkey ();
break;
if (key == '\e')
{
cur_len = 0;
break;
}
if (key == '\b')
{
cur_len--;
grub_printf ("\b");
continue;
}
if (!grub_isprint (key))
continue;
{
}
}
grub_xputs ("\n");
grub_refresh ();
return (key != '\e');
}
{
if (is_authenticated (userlist))
{
punishment_delay = 1;
return GRUB_ERR_NONE;
}
goto access_denied;
goto access_denied;
{
}
goto access_denied;
if (is_authenticated (userlist))
{
punishment_delay = 1;
return GRUB_ERR_NONE;
}
punishment_delay *= 2;
return GRUB_ACCESS_DENIED;
}
static grub_err_t
{
}
void
grub_normal_auth_init (void)
{
}
void
grub_normal_auth_fini (void)
{
}