Disable talk/write to terminal and comsat messages during ICB session;

Do not delete ${PREFIX}/lib/icbserverdb during pkg_delete,
notify user to do it manually instead;
Do not overwrite ${PREFIX}/lib/icbserverdb if already exists.
This commit is contained in:
form 1998-10-22 06:31:47 +00:00
parent 345f7a96f0
commit 2a5fa4e4b8
3 changed files with 81 additions and 18 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.7 1998/10/20 08:39:47 form Exp $
# $OpenBSD: Makefile,v 1.8 1998/10/22 06:31:47 form Exp $
# NetBSD: Makefile,v 1.6 1998/04/15 11:15:34 frueauf Exp
#
@ -20,7 +20,12 @@ do-configure:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/icb/icb ${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/icbserverdb ${PREFIX}/lib
@if [ -f ${PREFIX}/lib/icbserverdb ]; then \
${ECHO} "*** Found ${PREFIX}/lib/icbserverdb - not replacing"; \
else \
${ECHO} "Installing default ${PREFIX}/lib/icbserverdb."; \
${INSTALL_DATA} ${WRKSRC}/icbserverdb ${PREFIX}/lib; \
fi
${INSTALL} -d ${PREFIX}/lib/icb
${INSTALL_DATA} ${WRKSRC}/sample.icbrc \
${WRKSRC}/contrib/bartender \

View File

@ -1,7 +1,11 @@
*** icb/unix.c.orig Wed Jul 15 20:39:27 1998
--- icb/unix.c Wed Jul 15 20:44:24 1998
*** icb/unix.c.orig Sat Feb 25 03:20:31 1995
--- icb/unix.c Thu Oct 22 12:47:12 1998
***************
*** 13,19 ****
*** 9,19 ****
#include "externs.h"
#include <pwd.h>
#include <sys/dir.h>
#undef stty
#undef gtty
@ -9,7 +13,14 @@
#ifdef linux
#include <bsd/sgtty.h>
--- 13,40 ----
--- 9,43 ----
#include "externs.h"
#include <pwd.h>
#include <sys/dir.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
#undef stty
#undef gtty
@ -39,7 +50,7 @@
#ifdef linux
#include <bsd/sgtty.h>
***************
*** 22,35 ****
*** 22,39 ****
#endif
#define TTYSTRUCT sgttyb
@ -54,7 +65,11 @@
char *getlogin();
--- 43,51 ----
struct TTYSTRUCT origtty; /* holds the user's original term settings */
int badttyinfo = 0; /* used when running under some weird modes */
--- 46,60 ----
#endif
#define TTYSTRUCT sgttyb
@ -64,6 +79,12 @@
char *getlogin();
struct TTYSTRUCT origtty; /* holds the user's original term settings */
+ struct stat origtty_stats; /* holds termainal stats */
+ char *mytty = NULL; /* holds terminal name */
int badttyinfo = 0; /* used when running under some weird modes */
***************
*** 79,91 ****
pushback(c)
@ -79,7 +100,7 @@
}
--- 95,107 ----
--- 100,112 ----
pushback(c)
char c;
{
@ -120,10 +141,15 @@
/* get local special chars */
if (ioctl(0, TIOCGLTC, &lt) < 0) {
ttyinfo.redraw = '\022'; /* ^R */
--- 110,134 ----
--- 115,144 ----
getterm()
{
! /* get terminal stats */
! if ((mytty = ttyname(STDERR_FILENO))) {
! if (stat(mytty, &origtty_stats)) mytty = NULL;
! }
!
! #ifndef USE_TERMIO
struct ltchars lt;
! #endif /* USE_TERMIO */
@ -158,7 +184,7 @@
/* get the current window size */
getwinsize();
--- 137,146 ----
--- 147,156 ----
ttyinfo.redraw = lt.t_rprntc;
ttyinfo.werase = lt.t_werasc;
}
@ -170,7 +196,14 @@
/* get the current window size */
getwinsize();
***************
*** 145,158 ****
*** 138,158 ****
{
struct TTYSTRUCT tty;
if (badttyinfo)
return;
-
bcopy((char *)&origtty, (char *)&tty, (unsigned)sizeof(struct TTYSTRUCT));
/* turn on cbreak - turn off echo */
@ -185,7 +218,17 @@
echomode = 0;
/* set the new flags */
--- 161,174 ----
--- 164,187 ----
{
struct TTYSTRUCT tty;
+ /* disable biff/mesg */
+ if (mytty)
+ chmod(mytty, origtty_stats.st_mode & ~(S_IXUSR | S_IWGRP));
+
if (badttyinfo)
return;
bcopy((char *)&origtty, (char *)&tty, (unsigned)sizeof(struct TTYSTRUCT));
/* turn on cbreak - turn off echo */
@ -201,6 +244,19 @@
echomode = 0;
/* set the new flags */
***************
*** 167,172 ****
--- 196,205 ----
restoreterm()
{
+ /* restore terminal stats */
+ if (mytty)
+ chmod(mytty, origtty_stats.st_mode);
+
if (badttyinfo)
return;
***************
*** 258,268 ****
}
@ -213,7 +269,7 @@
echomode = 1;
--- 274,284 ----
--- 291,301 ----
}
/* turn on echo */
@ -238,7 +294,7 @@
echomode = 0;
--- 303,313 ----
--- 320,330 ----
}
/* turn off echo */
@ -249,3 +305,4 @@
! #endif /* USE_TERMIO */
echomode = 0;

View File

@ -1,9 +1,10 @@
@cwd /usr/local
@name icb-5.0.9
bin/icb
lib/icb/sample.icbrc
lib/icb/bartender
lib/icb/confuse
lib/icb/echofile
lib/icbserverdb
@dirrm lib/icb
@unexec echo "***"
@unexec echo "*** Leaving %D/lib/icbserverdb. You should delete it"
@unexec echo "*** manually if you don't want to keep ICB servers database."
@unexec echo "***"