summaryrefslogtreecommitdiff
path: root/sbin/dump/optr.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-07-05 05:36:01 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-07-05 05:36:01 +0000
commit53e2c54ed25403939273b0b08c8322910913f18e (patch)
tree2a87547334463c36a89113d3668e47660d044af3 /sbin/dump/optr.c
parent8b5ae6cd40a8db5e9b98940439c80611746ea22f (diff)
Fix some incorrect strncpy usage.
From NetBSD (luke@netbsd.org) * verbosity additions displaying total & per-volume transfer times and rates * Add the ability to dump specific files & directories of a single filesystem. This uses fts(3) to access the directory structure (and not the raw device), so the standard access permissions are adhered to (unlike dumping an entire filesystem, which just requires read access to the raw disk device). * Support SIGINFO status reporting. * Remove now unused variables that previously stored the (e)uid. * Be more informative in a couple of error messages. From NetBSD (mrg) * fix NetBSD PR#3710, reported by Tatoku Ogaito <tacha@trap.fukui-med.ac.jp>. don't pass pw->pw_name into functions; make a copy.
Diffstat (limited to 'sbin/dump/optr.c')
-rw-r--r--sbin/dump/optr.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index 2c63f065d33..9e4d14373d0 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: optr.c,v 1.13 1997/06/25 18:07:57 kstailey Exp $ */
-/* $NetBSD: optr.c,v 1.4 1996/05/18 16:16:17 jtk Exp $ */
+/* $OpenBSD: optr.c,v 1.14 1997/07/05 05:35:57 millert Exp $ */
+/* $NetBSD: optr.c,v 1.11 1997/05/27 08:34:36 mrg Exp $ */
/*-
* Copyright (c) 1980, 1988, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94";
#else
-static char rcsid[] = "$OpenBSD: optr.c,v 1.13 1997/06/25 18:07:57 kstailey Exp $";
+static char rcsid[] = "$OpenBSD: optr.c,v 1.14 1997/07/05 05:35:57 millert Exp $";
#endif
#endif /* not lint */
@@ -70,7 +70,6 @@ static char rcsid[] = "$OpenBSD: optr.c,v 1.13 1997/06/25 18:07:57 kstailey Exp
void alarmcatch __P((/* int, int */));
int datesort __P((const void *, const void *));
-static void sendmes __P((char *, char *));
/*
* Query the operator; This previously-fascist piece of code
@@ -179,21 +178,20 @@ interrupt(signo)
dumpabort(0);
}
-/*
+/*
* We now use wall(1) to do the actual broadcasting.
- */
+ */
void
broadcast(message)
char *message;
{
FILE *fp;
- char buf[sizeof(_PATH_WALL) + 12];
+ char buf[sizeof(_PATH_WALL) + sizeof(OPGRENT) + 3];
if (!notify)
return;
- (void) strcpy(buf, _PATH_WALL);
- (void) strcpy(buf + sizeof(_PATH_WALL) - 1, " -g operator");
+ (void)snprintf(buf, sizeof(buf), "%s -g %s", _PATH_WALL, OPGRENT);
if ((fp = popen(buf, "w")) == NULL)
return;
@@ -315,7 +313,7 @@ allocfsent(fs)
{
register struct fstab *new;
- new = (struct fstab *)malloc(sizeof (*fs));
+ new = (struct fstab *)malloc(sizeof(*fs));
if (new == NULL ||
(new->fs_file = strdup(fs->fs_file)) == NULL ||
(new->fs_type = strdup(fs->fs_type)) == NULL ||
@@ -353,7 +351,7 @@ getfstab()
strcmp(fs->fs_type, FSTAB_RQ))
continue;
fs = allocfsent(fs);
- if ((pf = (struct pfstab *)malloc(sizeof (*pf))) == NULL)
+ if ((pf = (struct pfstab *)malloc(sizeof(*pf))) == NULL)
quit("%s\n", strerror(errno));
pf->pf_fstab = fs;
pf->pf_next = table;