diff --git a/usr.bin/msgs/msgs.1 b/usr.bin/msgs/msgs.1 index 9bc857f8ca99..2efddec4372e 100644 --- a/usr.bin/msgs/msgs.1 +++ b/usr.bin/msgs/msgs.1 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)msgs.1 8.2 (Berkeley) 4/28/95 -.\" $Id$ +.\" $Id: msgs.1,v 1.6 1999/07/12 20:23:47 nik Exp $ .\" .Dd April 28, 1995 .Dt MSGS 1 @@ -118,7 +118,16 @@ is incorrect it can be fixed by removing it; .Nm will make a new .Pa bounds -file the next time it is run. +file the next time it is run with the +.Fl s +option. +If +.Nm +is run with any option other than +.Fl s , +an error will be displayed if +.Pa /var/msgs/bounds +does not exist. .Pp The .Fl s diff --git a/usr.bin/msgs/msgs.c b/usr.bin/msgs/msgs.c index 74aa339c6662..ff09c9e07248 100644 --- a/usr.bin/msgs/msgs.c +++ b/usr.bin/msgs/msgs.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)msgs.c 8.2 (Berkeley) 4/28/95"; #endif static const char rcsid[] = - "$Id: msgs.c,v 1.12 1998/07/09 14:06:54 ghelmer Exp $"; + "$Id: msgs.c,v 1.13 1998/07/14 19:07:30 ghelmer Exp $"; #endif /* not lint */ /* @@ -246,8 +246,23 @@ int argc; char *argv[]; * determine current message bounds */ snprintf(fname, sizeof(fname), "%s/%s", _PATH_MSGS, BOUNDS); - if (stat(fname, &buf) < 0) - err(errno, "%s", fname); + + /* + * Test access rights to the bounds file + * This can be a little tricky. if(send_msg), then + * we will create it. We assume that if(send_msg), + * then you have write permission there. + * Else, it better be there, or we bail. + */ + if (send_msg != YES) { + if (stat(fname, &buf) < 0) { + if (hush != YES) { + err(errno, "%s", fname); + } else { + exit(1); + } + } + } bounds = fopen(fname, "r"); if (bounds != NULL) {