Commit 8f6c0613 authored by Niels Möller's avatar Niels Möller

*** empty log message ***

Rev: src/client_userauth.c:1.4
Rev: src/configure.in:1.7
Rev: src/password.h:1.5
Rev: src/reaper.c:1.2
Rev: src/reaper.h:1.2
Rev: src/server.h:1.9
parent 675007ef
......@@ -94,8 +94,9 @@ static int send_passwd(struct client_userauth *userauth,
struct ssh_connection *connection)
{
struct lsh_string *passwd
= read_password(MAX_PASSWD, ssh_format("Password for %lS: ",
userauth->username));
= read_password(MAX_PASSWD,
ssh_format("Password for %lS: ",
userauth->username), 1);
if (!passwd)
return LSH_FAIL | LSH_DIE;
......
......@@ -44,7 +44,8 @@ AC_HEADER_TIME
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
dnl FIXME: We should check that a pid_t fits in an int
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
......
......@@ -35,7 +35,7 @@
#include <unistd.h>
struct lsh_string *
read_password(int max_length, struct lsh_string *prompt);
read_password(int max_length, struct lsh_string *prompt, int free);
struct unix_user
{
......
......@@ -68,7 +68,6 @@ static void do_reap(struct reap *c,
ALIST_SET(closure->children, pid, callback);
}
/* FIXME: Use an alist of pids->callbacks */
static void reap(struct reaper *r)
{
pid_t pid;
......@@ -137,7 +136,7 @@ static void reap(struct reaper *r)
}
}
struct reaper *make_reaper(void)
struct reap *make_reaper(void)
{
struct reaper *closure;
......@@ -145,15 +144,19 @@ struct reaper *make_reaper(void)
closure->super.reap = do_reap;
closure->children = make_linked_alist(0, -1);
return closure;
return &closure->super;
}
/* FIXME: Prehaps this function should return a suitable exit code? */
void reaper_run(struct reaper *r, struct io_backend *b)
void reaper_run(struct reap *r, struct io_backend *b)
{
struct reaper *self = (struct reaper *) r;
struct sigaction pipe;
struct sigaction chld;
MDEBUG(self);
pipe.sa_handler = SIG_IGN;
sigemptyset(&pipe.sa_mask);
pipe.sa_flags = 0;
......@@ -172,5 +175,5 @@ void reaper_run(struct reaper *r, struct io_backend *b)
halloween = 0;
while(io_iter(b))
if (halloween)
reap(r);
reap(self);
}
......@@ -48,7 +48,7 @@ struct reap
#define REAP(r, p, c) ((r)->reap((r), (p), (c)))
struct reaper *make_reaper(void);
void reaper_run(struct reaper *r, struct io_backend *b);
struct reap *make_reaper(void);
void reaper_run(struct reap *r, struct io_backend *b);
#endif /* LSH_REAPER_H_INCLUDED */
......@@ -29,6 +29,7 @@
#include "io.h"
#include "keyexchange.h"
#include "password.h"
#include "reaper.h"
struct fd_callback *
make_server_callback(struct io_backend *b,
......@@ -51,6 +52,11 @@ struct unix_service *make_server_session_service(struct alist *global_requests,
struct channel_open *make_open_session(struct unix_user *user,
struct alist *session_requests);
struct channel_request *make_shell_handler(struct io_backend *backend);
struct channel_request *make_shell_handler(struct io_backend *backend,
struct reap *reap);
struct lsh_string *format_exit_signal(struct ssh_channel *channel,
int core, int signal);
struct lsh_string *format_exit(struct ssh_channel *channel, int value);
#endif /* LSH_SERVER_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