- (stevesk) more sync for session.c
This commit is contained in:
parent
08ccf9d08c
commit
8f63caa197
|
@ -133,6 +133,7 @@
|
||||||
- (bal) forget a few new files in sync up.
|
- (bal) forget a few new files in sync up.
|
||||||
- (bal) Makefile fix up requires scard.c
|
- (bal) Makefile fix up requires scard.c
|
||||||
- (stevesk) sync misc.h
|
- (stevesk) sync misc.h
|
||||||
|
- (stevesk) more sync for session.c
|
||||||
|
|
||||||
20010629
|
20010629
|
||||||
- (bal) Removed net_aton() since we don't use it any more
|
- (bal) Removed net_aton() since we don't use it any more
|
||||||
|
@ -5960,4 +5961,4 @@
|
||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1379 2001/07/04 17:25:54 stevesk Exp $
|
$Id: ChangeLog,v 1.1380 2001/07/04 18:23:03 stevesk Exp $
|
||||||
|
|
70
session.c
70
session.c
|
@ -121,20 +121,21 @@ struct Session {
|
||||||
/* func */
|
/* func */
|
||||||
|
|
||||||
Session *session_new(void);
|
Session *session_new(void);
|
||||||
void session_set_fds(Session *, int, int, int);
|
void session_set_fds(Session *, int, int, int);
|
||||||
static void session_pty_cleanup(void *);
|
static void session_pty_cleanup(void *);
|
||||||
void session_proctitle(Session *);
|
void session_proctitle(Session *);
|
||||||
int session_setup_x11fwd(Session *);
|
int session_setup_x11fwd(Session *);
|
||||||
void do_exec_pty(Session *, const char *);
|
void do_exec_pty(Session *, const char *);
|
||||||
void do_exec_no_pty(Session *, const char *);
|
void do_exec_no_pty(Session *, const char *);
|
||||||
void do_exec(Session *, const char *);
|
void do_exec(Session *, const char *);
|
||||||
void do_login(Session *, const char *);
|
void do_login(Session *, const char *);
|
||||||
void do_child(Session *, const char *);
|
void do_child(Session *, const char *);
|
||||||
void do_motd(void);
|
void do_motd(void);
|
||||||
|
int check_quietlogin(Session *, const char *);
|
||||||
|
|
||||||
static void do_authenticated1(Authctxt *);
|
static void do_authenticated1(Authctxt *);
|
||||||
static void do_authenticated2(Authctxt *);
|
static void do_authenticated2(Authctxt *);
|
||||||
|
|
||||||
static void session_close(Session *);
|
static void session_close(Session *);
|
||||||
static int session_pty_req(Session *);
|
static int session_pty_req(Session *);
|
||||||
|
|
||||||
|
@ -670,30 +671,6 @@ do_exec(Session *s, const char *command)
|
||||||
original_command = NULL;
|
original_command = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Check for quiet login, either .hushlogin or command given.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
check_quietlogin(Session *s, const char *command)
|
|
||||||
{
|
|
||||||
char buf[256];
|
|
||||||
struct passwd *pw = s->pw;
|
|
||||||
struct stat st;
|
|
||||||
|
|
||||||
/* Return 1 if .hushlogin exists or a command given. */
|
|
||||||
if (command != NULL)
|
|
||||||
return 1;
|
|
||||||
snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
|
|
||||||
#ifdef HAVE_LOGIN_CAP
|
|
||||||
if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0)
|
|
||||||
return 1;
|
|
||||||
#else
|
|
||||||
if (stat(buf, &st) >= 0)
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* administrative, login(1)-like work */
|
/* administrative, login(1)-like work */
|
||||||
void
|
void
|
||||||
do_login(Session *s, const char *command)
|
do_login(Session *s, const char *command)
|
||||||
|
@ -792,6 +769,31 @@ do_motd(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check for quiet login, either .hushlogin or command given.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
check_quietlogin(Session *s, const char *command)
|
||||||
|
{
|
||||||
|
char buf[256];
|
||||||
|
struct passwd *pw = s->pw;
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
/* Return 1 if .hushlogin exists or a command given. */
|
||||||
|
if (command != NULL)
|
||||||
|
return 1;
|
||||||
|
snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
|
||||||
|
#ifdef HAVE_LOGIN_CAP
|
||||||
|
if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0)
|
||||||
|
return 1;
|
||||||
|
#else
|
||||||
|
if (stat(buf, &st) >= 0)
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sets the value of the given variable in the environment. If the variable
|
* Sets the value of the given variable in the environment. If the variable
|
||||||
* already exists, its value is overriden.
|
* already exists, its value is overriden.
|
||||||
|
|
Loading…
Reference in New Issue