Commit 294d3e10 authored by Niels Möller's avatar Niels Möller

Added type unix_Service, with a login-method.

Rev: src/password.h:1.2
parent f27800d3
......@@ -27,23 +27,41 @@
#include "lsh_types.h"
#include "alist.h"
#include <sys/types.h>
#include <unistd.h>
struct lsh_string *
read_password(int max_length, char *format, ...) PRINTF_STYLE(1,2);
read_password(int max_length, struct lsh_string *prompt);
struct unix_user
{
struct lsh_object header;
uid_t uid;
#if 0
struct lsh_string *username;
#endif
struct lsh_string *passwd; /* Crypted passwd */
struct lsh_string *home;
};
struct unix_user *lookup_user(lsh_string *name);
int verify_passwd(struct unix_user *user, lsh_string *password);
struct unix_user *lookup_user(struct lsh_string *name);
int verify_password(struct unix_user *user, struct lsh_string *password);
struct userauth *make_password_userauth(void);
struct unix_service
{
struct lsh_object header;
struct ssh_service * (*login)(struct unix_service *closure,
struct unix_user *user);
};
#define LOGIN(s, u) ((s)->login((s), (u)))
struct userauth *make_unix_userauth(struct alist *services);
#endif /* LSH_PASSWORD_H_INCLUDED */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment