Commit 1b56a36c authored by Niels Möller's avatar Niels Möller
Browse files

* src/userauth.h (user): Added uid attribute, and a bunch of

methods.

Rev: src/userauth.h:1.20
parent d24614da
...@@ -28,6 +28,12 @@ ...@@ -28,6 +28,12 @@
#include "lsh.h" #include "lsh.h"
#include "exception.h" #include "exception.h"
/* For pid_t and uid_t */
#include <unistd.h>
/* Forward declaration */
struct env_value;
#define GABA_DECLARE #define GABA_DECLARE
#include "userauth.h.x" #include "userauth.h.x"
#undef GABA_DECLARE #undef GABA_DECLARE
...@@ -40,16 +46,59 @@ ...@@ -40,16 +46,59 @@
(reply string))) (reply string)))
*/ */
struct exception *make_userauth_special_exception(struct lsh_string *reply, struct env_value
const char *msg); {
const char *name;
struct lsh_string *value;
};
struct exception *
make_userauth_special_exception(struct lsh_string *reply,
const char *msg);
/* GABA: /* GABA:
(class (class
(name user) (name user)
(vars (vars
; These string include a terminating NUL-character, for ; This string include a terminating NUL-character, for
; compatibility with library and system calls. ; compatibility with library and system calls.
(name string))) (name string)
(uid . uid_t)
; Verify a password
(verify_password method int "struct lsh_string *pw" "int free")
; Check if a file in the user's home directory exists.
; Used by the current publickey userauth method.
(file_exists method int "struct lsh_string *name" "int free")
; chdir to the user's home directory
(chdir_home method int)
; Fork a user process.
; FIXME: For non-UN*X-systems, we need a method
; that combines fork() and exec(). It would have lots of
; input arguments, perhaps a tag list, and return
; an object containing the stdin file objects and perhaps some
; other info.
(fork_process method int "pid_t *")
; This modifies the argv vector, in particular its first
; element. So the vector must have at least two elements,
; (argv[0], NULL).
(exec_shell method void "int login"
"char **argv"
"unsigned env_length"
"const struct env_value *env")))
*/ */
#define USER_VERIFY_PASSWORD(u, p, f) ((u)->verify_password((u), (p), (f)))
#define USER_FILE_EXISTS(u, n, f) ((u)->file_exists((u), (n), (f)))
#define USER_CHDIR_HOME(u) ((u)->chdir_home((u)))
#define USER_FORK(u, c) ((u)->fork_process((u), (c)))
#define USER_EXEC(u, m, a, l, e) ((u)->exec_shell((u), (m), (a), (l), (e)))
#endif /* LSH_USERAUTH_H_INCLUDED */ #endif /* LSH_USERAUTH_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