=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ktrace/ktrace.c,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -c -r1.8 -r1.8.4.1 *** src/usr.bin/ktrace/ktrace.c 1999/08/17 09:13:15 1.8 --- src/usr.bin/ktrace/ktrace.c 2000/10/06 21:16:13 1.8.4.1 *************** *** 1,4 **** ! /* $OpenBSD: ktrace.c,v 1.8 1999/08/17 09:13:15 millert Exp $ */ /* $NetBSD: ktrace.c,v 1.4 1995/08/31 23:01:44 jtc Exp $ */ /*- --- 1,4 ---- ! /* $OpenBSD: ktrace.c,v 1.8.4.1 2000/10/06 21:16:13 jason Exp $ */ /* $NetBSD: ktrace.c,v 1.4 1995/08/31 23:01:44 jtc Exp $ */ /*- *************** *** 44,50 **** #if 0 static char sccsid[] = "@(#)ktrace.c 8.2 (Berkeley) 4/28/95"; #endif ! static char *rcsid = "$OpenBSD: ktrace.c,v 1.8 1999/08/17 09:13:15 millert Exp $"; #endif /* not lint */ #include --- 44,50 ---- #if 0 static char sccsid[] = "@(#)ktrace.c 8.2 (Berkeley) 4/28/95"; #endif ! static char *rcsid = "$OpenBSD: ktrace.c,v 1.8.4.1 2000/10/06 21:16:13 jason Exp $"; #endif /* not lint */ #include *************** *** 136,149 **** ops |= pid ? KTROP_CLEAR : KTROP_CLEARFILE; if (ktrace(tracefile, ops, trpoints, pid) < 0) ! err(1, tracefile); exit(0); } omask = umask(S_IRWXG|S_IRWXO); if (append) { if ((fd = open(tracefile, O_CREAT | O_WRONLY, DEFFILEMODE)) < 0) ! err(1, tracefile); if (fstat(fd, &sb) != 0 || sb.st_uid != getuid()) errx(1, "Refuse to append to %s: not owned by you.", tracefile); --- 136,149 ---- ops |= pid ? KTROP_CLEAR : KTROP_CLEARFILE; if (ktrace(tracefile, ops, trpoints, pid) < 0) ! err(1, "%s", tracefile); exit(0); } omask = umask(S_IRWXG|S_IRWXO); if (append) { if ((fd = open(tracefile, O_CREAT | O_WRONLY, DEFFILEMODE)) < 0) ! err(1, "%s", tracefile); if (fstat(fd, &sb) != 0 || sb.st_uid != getuid()) errx(1, "Refuse to append to %s: not owned by you.", tracefile); *************** *** 152,170 **** err(1, "unlink %s", tracefile); if ((fd = open(tracefile, O_CREAT | O_EXCL | O_WRONLY, DEFFILEMODE)) < 0) ! err(1, tracefile); } (void)umask(omask); (void)close(fd); if (*argv) { if (ktrace(tracefile, ops, trpoints, getpid()) < 0) ! err(1, tracefile); execvp(argv[0], &argv[0]); err(1, "exec of '%s' failed", argv[0]); } else if (ktrace(tracefile, ops, trpoints, pid) < 0) ! err(1, tracefile); exit(0); } --- 152,170 ---- err(1, "unlink %s", tracefile); if ((fd = open(tracefile, O_CREAT | O_EXCL | O_WRONLY, DEFFILEMODE)) < 0) ! err(1, "%s", tracefile); } (void)umask(omask); (void)close(fd); if (*argv) { if (ktrace(tracefile, ops, trpoints, getpid()) < 0) ! err(1, "%s", tracefile); execvp(argv[0], &argv[0]); err(1, "exec of '%s' failed", argv[0]); } else if (ktrace(tracefile, ops, trpoints, pid) < 0) ! err(1, "%s", tracefile); exit(0); }