Skip to content

Commit

Permalink
Imported from conserver-7.1.1.tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
bstansell committed Aug 5, 2001
1 parent 4a15f70 commit 03aa79c
Show file tree
Hide file tree
Showing 21 changed files with 291 additions and 129 deletions.
18 changes: 17 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
CHANGES
=======

version 7.1.1 (Aug 4, 2001):
- Now using getlogin() for real username info - suggested by
Dave Stuit <djs@gnac.com>
- gethostbyname() failure for a console now doesn't cause a
shutdown - reported by Todd Stansell <todd@stansell.org>
- Shutdown via client -q/-Q fixed (broken in 7.1.0 because of
master process fork() code)
- Password file parsing fixed to allow for empty passwords -
allowing users to access conserver without a password prompt
- Both the password and configuration files no longer have
line length limitations, they now support comments (`#' lines),
and lines with leading whitespace are continuations of
previous lines
- Client hostname/ip sometimes not printed - reported by Todd
Stansell <todd@stansell.org>

version 7.1.0 (Jul 26, 2001):
- Hostname in access list that began with a digit was treated as
an IP address - only strings using [0-9./] are considered CIDR
Expand Down Expand Up @@ -206,5 +222,5 @@ before version 6.05:
and enhancements of various types were applied.

#
# $Id: CHANGES,v 1.41 2001-07-26 16:42:26-07 bryan Exp $
# $Id: CHANGES,v 1.45 2001-08-04 21:09:12-07 bryan Exp $
#
9 changes: 8 additions & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ Upgrading?
new features added to the client if you're considering *not*
upgrading.

Version 7.1.1

- Both conserver.passwd and conserver.cf file parsing behaves
the same now. Both use leading whitespace as a continuation
line indicator - if you have leading whitespace on a line
(aside from comments) you probably should remove it.

Version 7.1.0

- The client/server protocol has changed. You *MUST* use a
Expand Down Expand Up @@ -112,5 +119,5 @@ Detailed Instructions
- That's it! Just start up the console server and enjoy!

#
# $Id: INSTALL,v 1.17 2001-07-25 17:33:29-07 bryan Exp $
# $Id: INSTALL,v 1.18 2001-08-04 21:11:09-07 bryan Exp $
#
6 changes: 1 addition & 5 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ Bryan Stansell

---------------------------------------------------------------------------

- conserver.passwd parsing needs improvement
- shouldn't use strtok() (bryan::any == bryan:any)
- empty passwords not allowed

- Telnet protocol should be improved
- Not even RFC 854 compliant
- Data sent to terminal server not encapsulated
Expand Down Expand Up @@ -89,5 +85,5 @@ Bryan Stansell
- bios support

#
# $Id: TODO,v 1.11 2001-07-25 17:36:21-07 bryan Exp $
# $Id: TODO,v 1.12 2001-07-30 23:28:56-07 bryan Exp $
#
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
/* Define if you have the `getdtablesize' function. */
#undef HAVE_GETDTABLESIZE

/* Define if you have the `getlogin' function. */
#undef HAVE_GETLOGIN

/* Define if you have the `getopt' function. */
#undef HAVE_GETOPT

Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -3390,7 +3390,7 @@ EOF
fi
for ac_func in getopt strerror getrlimit getsid setsid getuserattr setgroups tcgetpgrp tcsetpgrp tcgetattr tcsetattr tcsendbreak setpgrp getutent setttyent getspnam setlinebuf setvbuf ptsname grantpt unlockpt flock sigaction setsockopt getdtablesize putenv memset memcpy memcmp sysconf getpassphrase
for ac_func in getopt strerror getrlimit getsid setsid getuserattr setgroups tcgetpgrp tcsetpgrp tcgetattr tcsetattr tcsendbreak setpgrp getutent setttyent getspnam setlinebuf setvbuf ptsname grantpt unlockpt flock sigaction setsockopt getdtablesize putenv memset memcpy memcmp sysconf getpassphrase getlogin
do
ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
echo "$as_me:3396: checking for $ac_func" >&5
Expand Down
2 changes: 1 addition & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ AC_CHECK_LIB(crypt,crypt)


dnl ### Check for needed functions. ################################
AC_CHECK_FUNCS(getopt strerror getrlimit getsid setsid getuserattr setgroups tcgetpgrp tcsetpgrp tcgetattr tcsetattr tcsendbreak setpgrp getutent setttyent getspnam setlinebuf setvbuf ptsname grantpt unlockpt flock sigaction setsockopt getdtablesize putenv memset memcpy memcmp sysconf getpassphrase)
AC_CHECK_FUNCS(getopt strerror getrlimit getsid setsid getuserattr setgroups tcgetpgrp tcsetpgrp tcgetattr tcsetattr tcsendbreak setpgrp getutent setttyent getspnam setlinebuf setvbuf ptsname grantpt unlockpt flock sigaction setsockopt getdtablesize putenv memset memcpy memcmp sysconf getpassphrase getlogin)
AC_FUNC_SETPGRP


Expand Down
12 changes: 8 additions & 4 deletions conserver.cf/conserver.cf.man
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $Id: conserver.cf.man,v 1.15 2001-07-26 10:23:16-07 bryan Exp $
.\" $Id: conserver.cf.man,v 1.17 2001-08-04 20:54:25-07 bryan Exp $
.\" @(#)constab.5 01/06/91 OSU CIS; Thomas A. Fine
.TH CONSERVER.CF 5 "Local"
.SH NAME
Expand All @@ -24,10 +24,14 @@ is the configuration file for
.BR conserver (8).
It is read once upon startup;
modifications to the file take effect only upon restarting \fBconserver\fP.
All lines starting with the pound sign `#' are considered comment lines.
Blank lines are ignored.
.PP
The first section of the file has lines that are separated into
Blank lines and comment lines (those beginning with a ``#'' and
optional leading whitespace) are ignored. Non-ignored lines
beginning with whitespace are considered continuations of the
previous line. This allows you to span one logical line over
many physical lines and insert comments wherever appropriate.
.PP
The first section of the file has logical lines that are separated into
five colon-separated fields. Leading and trailing white space in each
field is ignored.
.TP
Expand Down
13 changes: 10 additions & 3 deletions conserver.cf/conserver.passwd.man
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $Id: conserver.passwd.man,v 1.2 2001-07-22 11:48:29-07 bryan Exp $
.\" $Id: conserver.passwd.man,v 1.4 2001-08-04 20:54:25-07 bryan Exp $
.TH CONSERVER.PASSWD 5 "Local"
.SH NAME
conserver.passwd \- user access information for conserver(8)
Expand All @@ -14,8 +14,15 @@ Upon each incoming client connection,
so edits to the file take effect immediately.
It reads only until the first \fIusername\fP match.
.PP
Each line consists of three colon-separated fields,
as follows:
Blank lines and comment lines (those beginning with a ``#'' and
optional leading whitespace) are ignored. Non-ignored lines
beginning with whitespace are considered continuations of the
previous line. This allows you to span one logical line over
many physical lines and insert comments wherever appropriate.
.PP
Each logical line consists of three colon-separated fields.
Leading and trailing white space in each
field is ignored.
.TP
.I username
the login name of the authorized user,
Expand Down
8 changes: 4 additions & 4 deletions conserver.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ <H3>Downloading</H3>

<P>
The current version, released on RELEASE_DATE, is <A
HREF="http://www.conserver.com/7.1.0.tar.gz">
7.1.0.tar.gz</A>. You can get it via <A
HREF="ftp://ftp.conserver.com/conserver/7.1.0.tar.gz">FTP</A>
or <A HREF="http://www.conserver.com/7.1.0.tar.gz">HTTP</A>.
HREF="http://www.conserver.com/7.1.1.tar.gz">
7.1.1.tar.gz</A>. You can get it via <A
HREF="ftp://ftp.conserver.com/conserver/7.1.1.tar.gz">FTP</A>
or <A HREF="http://www.conserver.com/7.1.1.tar.gz">HTTP</A>.
See the <A HREF="http://www.conserver.com/CHANGES">CHANGES</A> file for
information on the latest updates.
</P>
Expand Down
9 changes: 5 additions & 4 deletions conserver/consent.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: consent.c,v 5.68 2001-07-26 11:48:43-07 bryan Exp $
* $Id: consent.c,v 5.69 2001-07-29 22:28:40-07 bryan Exp $
*
* Copyright conserver.com, 2000-2001
*
Expand Down Expand Up @@ -688,9 +688,10 @@ ConsInit(pCE, pfdSet, useHostCache)
#endif

if ((hp = gethostbyname(pCE->networkConsoleHost)) == NULL) {
Error("gethostbyname(%s): %s", pCE->networkConsoleHost,
hstrerror(h_errno));
exit(EX_UNAVAILABLE);
Error("gethostbyname(%s): %s: forcing down",
pCE->networkConsoleHost, hstrerror(h_errno));
ConsDown(pCE, pfdSet);
return;
}
#if HAVE_MEMCPY
(void)memcpy(&port.sin_addr.s_addr, hp->h_addr, hp->h_length);
Expand Down
89 changes: 51 additions & 38 deletions conserver/group.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: group.c,v 5.126 2001-07-26 11:50:13-07 bryan Exp $
* $Id: group.c,v 5.132 2001-08-04 17:03:30-07 bryan Exp $
*
* Copyright conserver.com, 2000-2001
*
Expand Down Expand Up @@ -94,19 +94,14 @@ static sig_atomic_t fSawReOpen = 0, fSawReUp = 0, fSawMark =
* given a special epass try it first.
*/
int
CheckPass(pwd, pcEPass, pcWord)
CheckPass(pwd, pcWord)
struct passwd *pwd;
char *pcEPass, *pcWord;
char *pcWord;
{
#if HAVE_GETSPNAM
struct spwd *spwd;
#endif

if ((char *)0 != pcEPass && '\000' != pcEPass[0]) {
if (0 == strcmp(pcEPass, crypt(pcWord, pcEPass))) {
return 1;
}
}
#if HAVE_GETSPNAM
if ('x' == pwd->pw_passwd[0] && '\000' == pwd->pw_passwd[1]) {
if ((struct spwd *)0 != (spwd = getspnam(pwd->pw_name)))
Expand Down Expand Up @@ -430,8 +425,7 @@ ReapVirt(pGE, prinit)
/* If someone was writing, they fall back to read-only */
if (pCE->pCLwr != (CONSCLIENT *) 0) {
pCE->pCLwr->fwr = 0;
tagLogfile(pCE, "%s detached",
pCE->pCLwr->acid);
tagLogfile(pCE, "%s detached", pCE->pCLwr->acid);
pCE->pCLwr = (CONSCLIENT *) 0;
}

Expand All @@ -451,7 +445,7 @@ CheckPasswd(pCLServing, pw_string)
{
struct passwd *pwd;
FILE *fp;
char buf[BUFSIZ];
int iLine = 0;
char *server, *servers, *this_pw, *user;
char username[64]; /* same as acid */
#if HAVE_GETSPNAM
Expand All @@ -462,31 +456,46 @@ CheckPasswd(pCLServing, pw_string)
if ((user = strchr(username, '@')))
*user = '\000';

if ((fp = fopen(pcPasswd, "r")) == NULL) {
if ((fp = fopen(pcPasswd, "r")) == (FILE *) 0) {
Info("Cannot open passwd file %s: %s", pcPasswd, strerror(errno));

if ((struct passwd *)0 == (pwd = getpwuid(0))) {
fileWrite(pCLServing->fd, "no root passwd?\r\n", -1);
return 0;
}
if (0 != CheckPass(pwd, pw_string, pCLServing->accmd)) {
if (fVerbose) {
Info("User %s logging into server %s via root or console passwd", pCLServing->acid, pCLServing->pCEwant->server);
}
if (0 != CheckPass(pwd, pw_string)) {
if (fVerbose)
Info("User %s logging into server %s via root passwd",
pCLServing->acid, pCLServing->pCEwant->server);
return 1;
}
} else {
while (fgets(buf, sizeof(buf), fp) != NULL) {
user = strtok(buf, ":\n");
if (user == NULL)
char *wholeLine;
STRING saveLine = { (char *)0, 0, 0 };

while ((wholeLine = readLine(fp, &saveLine, &iLine)) != (char *)0) {
pruneSpace(wholeLine);
/*printf("whole=<%s>\n", wholeLine); */
if (wholeLine[0] == '\000')
continue;

if ((char *)0 == (this_pw = strchr(wholeLine, ':')) ||
(char *)0 == (servers = strchr(this_pw + 1, ':'))) {
Error("%s(%d) bad password line `%s'", pcPasswd, iLine,
wholeLine);
continue;
if (!
(strcmp(user, "*any*") == 0 ||
strcmp(user, username) == 0))
}
*this_pw++ = '\000';
*servers++ = '\000';
user = pruneSpace(wholeLine);
this_pw = pruneSpace(this_pw);
servers = pruneSpace(servers);

if (strcmp(user, "*any*") != 0 && strcmp(user, username) != 0)
continue;
this_pw = strtok(NULL, ":\n");

if (strcmp(this_pw, "*passwd*") == 0) {
this_pw = NULL;
this_pw = (char *)0;
if ((struct passwd *)0 != (pwd = getpwnam(username))) {
#if HAVE_GETSPNAM
if ('x' == pwd->pw_passwd[0] &&
Expand All @@ -503,19 +512,23 @@ CheckPasswd(pCLServing, pw_string)
#endif
}
}
if (this_pw == NULL)
break;
servers = strtok(NULL, ":\n");
if (servers == NULL)
if (this_pw == (char *)0)
break;

/*
printf("Got servers <%s> passwd <%s> user <%s>, want <%s>\n",
servers, this_pw, user,
pCLServing->pCEwant->server);
printf
("Got servers <%s> passwd <%s> user <%s>, want <%s>\n",
servers, this_pw, user, pCLServing->pCEwant->server);
*/

if (strcmp(this_pw, crypt(pCLServing->accmd, this_pw)) == 0) {
/* If one is empty and the other isn't, instant failure */
if ((*this_pw == '\000' && *pw_string != '\000') ||
(*this_pw != '\000' && *pw_string == '\000')) {
break;
}

if ((*this_pw == '\000' && *pw_string == '\000') ||
(strcmp(this_pw, crypt(pw_string, this_pw)) == 0)) {
server = strtok(servers, ", \t\n");
while (server) { /* For each server */
if (strcmp(server, "any") == 0) {
Expand Down Expand Up @@ -555,8 +568,7 @@ CheckPasswd(pCLServing, pw_string)
server = strtok(NULL, ", \t\n");
}
}
fclose(fp);
return 0;
break;
}
fclose(fp);
}
Expand Down Expand Up @@ -1025,8 +1037,7 @@ Kiddie(pGE, sfd)
for (j = 0;
pCLServing->icursor <
(sizeof(pCLServing->acid) - 1) &&
pCLServing->peername[iConsole] !=
'\000';) {
pCLServing->peername[j] != '\000';) {
pCLServing->acid[pCLServing->icursor++] =
pCLServing->peername[j++];
}
Expand Down Expand Up @@ -1095,7 +1106,8 @@ Kiddie(pGE, sfd)
goto drop;
}

if ('t' == pCLServing->caccess) {
if (('t' == pCLServing->caccess) ||
(0 != CheckPasswd(pCLServing, ""))) {
goto shift_console;
}
fileWrite(pCLServing->fd, "passwd:\r\n", -1);
Expand Down Expand Up @@ -1126,7 +1138,8 @@ Kiddie(pGE, sfd)
}
pCLServing->icursor = 0;

if (0 == CheckPasswd(pCLServing, pGE->passwd)) {
if (0 ==
CheckPasswd(pCLServing, pCLServing->accmd)) {
fileWrite(pCLServing->fd, "Sorry.\r\n", -1);
Info("%s: %s: bad passwd",
pCLServing->pCEwant->server,
Expand Down
3 changes: 1 addition & 2 deletions conserver/group.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: group.h,v 5.17 2001-07-11 12:48:01-07 bryan Exp $
* $Id: group.h,v 5.18 2001-07-30 01:57:42-07 bryan Exp $
*
* Copyright conserver.com, 2000-2001
*
Expand Down Expand Up @@ -42,7 +42,6 @@ typedef struct grpent { /* group info */
int imembers; /* number of consoles in this group */
CONSENT *pCElist; /* list of consoles in this group */
CONSCLIENT *pCLall; /* all clients to scan after select */
char passwd[MAXPSWDLEN]; /* encrypted password for this group */
} GRPENT;


Expand Down
Loading

0 comments on commit 03aa79c

Please sign in to comment.