Basic installation updates

This commit is contained in:
Michiel Broek 2004-09-27 11:41:03 +00:00
parent 6f89414c80
commit 1ef0643fcc
3 changed files with 132 additions and 96 deletions

View File

@ -5,6 +5,12 @@ v0.61.5 25-Sep-2004
general: general:
In SETUP.sh better xinetd.d system detection. In SETUP.sh better xinetd.d system detection.
On Linux SETUP.sh adds user mbse to group wheel and uucp.
SETUP.sh adds disabled telnet service to inetd.conf or xinetd.
mbsetup:
In user setup, if user gets a new security level, his timelimit
is updated with your permission.
v0.61.4 11-Aug-2004 - 25-Sep-2004 v0.61.4 11-Aug-2004 - 25-Sep-2004

View File

@ -245,7 +245,11 @@ log "+" "[$?] Added group bbs"
echo -n ", user 'mbse'" echo -n ", user 'mbse'"
if [ "$OSTYPE" = "Linux" ]; then if [ "$OSTYPE" = "Linux" ]; then
useradd -c "MBSE BBS Admin" -d $MHOME -g bbs -G uucp -m -s /bin/bash mbse if [ "`grep wheel /etc/group`" = "" ]; then
useradd -c "MBSE BBS Admin" -d $MHOME -g bbs -G uucp -m -s /bin/bash mbse
else
useradd -c "MBSE BBS Admin" -d $MHOME -g bbs -G wheel,uucp -m -s /bin/bash mbse
fi
fi fi
if [ "$OSTYPE" = "FreeBSD" ]; then if [ "$OSTYPE" = "FreeBSD" ]; then
pw useradd mbse -c "MBSE BBS Admin" -d $MHOME -g bbs -G wheel,dialer -m -s /usr/local/bin/bash pw useradd mbse -c "MBSE BBS Admin" -d $MHOME -g bbs -G wheel,dialer -m -s /usr/local/bin/bash
@ -445,6 +449,7 @@ cat << EOF >>/etc/inetd.conf
binkp stream tcp nowait mbse $MHOME/bin/mbcico mbcico -t ibn binkp stream tcp nowait mbse $MHOME/bin/mbcico mbcico -t ibn
fido stream tcp nowait mbse $MHOME/bin/mbcico mbcico -t ifc fido stream tcp nowait mbse $MHOME/bin/mbcico mbcico -t ifc
tfido stream tcp nowait mbse $MHOME/bin/mbcico mbcico -t itn tfido stream tcp nowait mbse $MHOME/bin/mbcico mbcico -t itn
#telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd -L $MHOME/bin/mblogin
EOF EOF
chmod 644 /etc/inetd.conf chmod 644 /etc/inetd.conf
@ -459,8 +464,8 @@ EOF
fi fi
fi fi
if [ -f /etc/xinetd.conf ] || [ -d /etc/xinetd.d ]; then if [ -f /etc/xinetd.conf ]; then
log "+" "/etc/xinetd.conf or /etc/xinetd.d found, xinetd system" log "+" "/etc/xinetd.conf found, xinetd system"
if [ -d /etc/xinetd.d ]; then if [ -d /etc/xinetd.d ]; then
log "+" "has xinetd.d subdir, writing files" log "+" "has xinetd.d subdir, writing files"
XINET="/etc/xinetd.d/mbsebbs" XINET="/etc/xinetd.d/mbsebbs"
@ -471,7 +476,7 @@ if [ -f /etc/xinetd.conf ] || [ -d /etc/xinetd.d ]; then
cat << EOF >> $XINET cat << EOF >> $XINET
#:MBSE BBS services are defined here. #:MBSE BBS services are defined here.
# #
# Author: Michiel Broek <mbse@mbse.dds.nl>, 01-Feb-2004 # Author: Michiel Broek <mbse@mbse.dds.nl>, 27-Sep-2004
service binkp service binkp
{ {
@ -505,6 +510,24 @@ service tfido
server = $MHOME/bin/mbcico server = $MHOME/bin/mbcico
server_args = -t itn server_args = -t itn
} }
disable=yes
# Telnet to the bbs using mblogin, disabled by default.
#
service telnet
{
disable = yes
protocol = tcp
instances = 10
flags = REUSE
log_on_failure += USERID
socket_type = stream
user = root
server = /usr/sbin/telnetd
server_args = -L $MHOME/bin/mblogin
wait = no
}
EOF EOF
fi fi

View File

@ -451,28 +451,28 @@ int EditUsrRec2(void)
void Reset_Time(void); void Reset_Time(void);
void Reset_Time(void) void Reset_Time(void)
{ {
char *temp; char *temp;
FILE *pLimits; FILE *pLimits;
temp = calloc(PATH_MAX, sizeof(char)); temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/limits.data", getenv("MBSE_ROOT")); sprintf(temp, "%s/etc/limits.data", getenv("MBSE_ROOT"));
if ((pLimits = fopen(temp,"r")) == NULL) { if ((pLimits = fopen(temp,"r")) == NULL) {
WriteError("$Can't open %s", temp); WriteError("$Can't open %s", temp);
} else { } else {
fread(&LIMIThdr, sizeof(LIMIThdr), 1, pLimits); fread(&LIMIThdr, sizeof(LIMIThdr), 1, pLimits);
while (fread(&LIMIT, sizeof(LIMIT), 1, pLimits) == 1) { while (fread(&LIMIT, sizeof(LIMIT), 1, pLimits) == 1) {
if (LIMIT.Security == usrconfig.Security.level) { if (LIMIT.Security == usrconfig.Security.level) {
if (LIMIT.Time) if (LIMIT.Time)
usrconfig.iTimeLeft = LIMIT.Time; usrconfig.iTimeLeft = LIMIT.Time;
else else
usrconfig.iTimeLeft = 86400; usrconfig.iTimeLeft = 86400;
usrconfig.iTimeUsed = 0; usrconfig.iTimeUsed = 0;
break; break;
} }
} }
fclose(pLimits); fclose(pLimits);
} }
free(temp); free(temp);
} }
@ -482,85 +482,92 @@ free(temp);
*/ */
int EditUsrRec(int Area) int EditUsrRec(int Area)
{ {
FILE *fil; FILE *fil;
char mfile[PATH_MAX]; char mfile[PATH_MAX];
long offset; long offset;
int j = 0; int j = 0;
unsigned long crc, crc1; unsigned long crc, crc1, level;
clr_index(); clr_index();
working(1, 0, 0); working(1, 0, 0);
IsDoing("Edit Users"); IsDoing("Edit Users");
sprintf(mfile, "%s/etc/users.temp", getenv("MBSE_ROOT")); sprintf(mfile, "%s/etc/users.temp", getenv("MBSE_ROOT"));
if ((fil = fopen(mfile, "r")) == NULL) { if ((fil = fopen(mfile, "r")) == NULL) {
working(2, 0, 0); working(2, 0, 0);
return -1; return -1;
} }
offset = sizeof(usrconfighdr) + ((Area -1) * sizeof(usrconfig)); offset = sizeof(usrconfighdr) + ((Area -1) * sizeof(usrconfig));
if (fseek(fil, offset, 0) != 0) { if (fseek(fil, offset, 0) != 0) {
working(2, 0, 0); working(2, 0, 0);
return -1; return -1;
} }
fread(&usrconfig, sizeof(usrconfig), 1, fil); fread(&usrconfig, sizeof(usrconfig), 1, fil);
fclose(fil); fclose(fil);
crc = 0xffffffff; crc = 0xffffffff;
crc = upd_crc32((char *)&usrconfig, crc, sizeof(usrconfig)); crc = upd_crc32((char *)&usrconfig, crc, sizeof(usrconfig));
Screen1(); Screen1();
for (;;) { for (;;) {
Fields1(); Fields1();
j = select_menu(16); j = select_menu(16);
switch(j) { switch(j) {
case 0: case 0: crc1 = 0xffffffff;
crc1 = 0xffffffff; crc1 = upd_crc32((char *)&usrconfig, crc1, sizeof(usrconfig));
crc1 = upd_crc32((char *)&usrconfig, crc1, sizeof(usrconfig)); if (crc != crc1) {
if (crc != crc1) { if (yes_no((char *)"Record is changed, save") == 1) {
if (yes_no((char *)"Record is changed, save") == 1) { working(1, 0, 0);
working(1, 0, 0); if ((fil = fopen(mfile, "r+")) == NULL) {
if ((fil = fopen(mfile, "r+")) == NULL) { working(2, 0, 0);
working(2, 0, 0); return -1;
return -1;
}
fseek(fil, offset, 0);
fwrite(&usrconfig, sizeof(usrconfig), 1, fil);
fclose(fil);
UsrUpdated = 1;
working(6, 0, 0);
}
} }
IsDoing("Browsing Menu"); fseek(fil, offset, 0);
return 0; fwrite(&usrconfig, sizeof(usrconfig), 1, fil);
case 1: E_STR( 6,17,35,usrconfig.sUserName, "The ^First and Last name^ of this user") fclose(fil);
case 2: E_USEC( 7,17, usrconfig.Security, "15.2 EDIT USER SECURITY", Screen1) UsrUpdated = 1;
break; working(6, 0, 0);
case 3 :E_STR( 8,17,10,usrconfig.sExpiryDate, "The ^Expiry Date^ in DD-MM-YYYY format, 00-00-0000 is no expire") }
case 4 :E_INT( 9,17, usrconfig.ExpirySec.level,"The ^Expiry Level^ for this user")
case 5 :E_STR( 10,17,8, usrconfig.Name, "The ^Unix username^ for this user")
case 6 :E_INT( 14,17, usrconfig.Credit, "Users ^Credit^")
case 7 :E_BOOL(15,17, usrconfig.Hidden, "Is user ^hidden^ on the BBS")
case 8 :E_BOOL(16,17, usrconfig.Deleted, "Is user marked for ^deletion^")
case 9 :E_BOOL(17,17, usrconfig.NeverDelete, "^Never delete^ this user")
case 10:E_STR( 18,17,62,usrconfig.sComment, "A ^Comment^ for this user")
case 11:E_BOOL( 6,68, usrconfig.LockedOut, "User is ^Locked Out^ of this BBS")
case 12:E_BOOL( 7,68, usrconfig.Guest, "This is a ^Guest^ account")
case 13:E_BOOL( 8,68, usrconfig.OL_ExtInfo, "Add ^Extended Message Info^ in OLR download")
case 14:E_BOOL( 9,68, usrconfig.Email, "User has a ^private email^ mailbox")
case 15:if (yes_no((char *)"Reset time left for today") == 1) {
Reset_Time();
}
break;
case 16:EditUsrRec2();
clr_index();
Screen1();
Fields1();
break;
} }
IsDoing("Browsing Menu");
return 0;
case 1: E_STR( 6,17,35,usrconfig.sUserName, "The ^First and Last name^ of this user")
case 2: level = usrconfig.Security.level;
usrconfig.Security = edit_usec(7,17,usrconfig.Security, (char *)"15.2 EDIT USER SECURITY");
Screen1();
Fields1();
if (level != usrconfig.Security.level) {
if (yes_no((char *)"Set time left for new level") == 1) {
Reset_Time();
}
}
break;
case 3 :E_STR( 8,17,10,usrconfig.sExpiryDate, "The ^Expiry Date^ in DD-MM-YYYY format, 00-00-0000 is no expire")
case 4 :E_INT( 9,17, usrconfig.ExpirySec.level,"The ^Expiry Level^ for this user")
case 5 :E_STR( 10,17,8, usrconfig.Name, "The ^Unix username^ for this user")
case 6 :E_INT( 14,17, usrconfig.Credit, "Users ^Credit^")
case 7 :E_BOOL(15,17, usrconfig.Hidden, "Is user ^hidden^ on the BBS")
case 8 :E_BOOL(16,17, usrconfig.Deleted, "Is user marked for ^deletion^")
case 9 :E_BOOL(17,17, usrconfig.NeverDelete, "^Never delete^ this user")
case 10:E_STR( 18,17,62,usrconfig.sComment, "A ^Comment^ for this user")
case 11:E_BOOL( 6,68, usrconfig.LockedOut, "User is ^Locked Out^ of this BBS")
case 12:E_BOOL( 7,68, usrconfig.Guest, "This is a ^Guest^ account")
case 13:E_BOOL( 8,68, usrconfig.OL_ExtInfo, "Add ^Extended Message Info^ in OLR download")
case 14:E_BOOL( 9,68, usrconfig.Email, "User has a ^private email^ mailbox")
case 15:if (yes_no((char *)"Reset time left for today") == 1) {
Reset_Time();
}
break;
case 16:EditUsrRec2();
clr_index();
Screen1();
Fields1();
break;
} }
return 0; }
return 0;
} }