- (stevesk) more sync for session.c

This commit is contained in:
Kevin Steves 2001-07-04 18:23:02 +00:00
parent 08ccf9d08c
commit 8f63caa197
2 changed files with 38 additions and 35 deletions

View File

@ -133,6 +133,7 @@
- (bal) forget a few new files in sync up.
- (bal) Makefile fix up requires scard.c
- (stevesk) sync misc.h
- (stevesk) more sync for session.c
20010629
- (bal) Removed net_aton() since we don't use it any more
@ -5960,4 +5961,4 @@
- Wrote replacements for strlcpy and mkdtemp
- 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 $

View File

@ -131,6 +131,7 @@ void do_exec(Session *, const char *);
void do_login(Session *, const char *);
void do_child(Session *, const char *);
void do_motd(void);
int check_quietlogin(Session *, const char *);
static void do_authenticated1(Authctxt *);
static void do_authenticated2(Authctxt *);
@ -670,30 +671,6 @@ do_exec(Session *s, const char *command)
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 */
void
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
* already exists, its value is overriden.