From a1ba5698f90b646c771a19bc8cca26141862b440 Mon Sep 17 00:00:00 2001 From: hubertf Date: Wed, 21 Jul 1999 04:04:21 +0000 Subject: [PATCH] Drop setgid privs early, via OpenBSD Reported in PR 5970 by Joseph Myers --- caesar/caesar.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/caesar/caesar.c b/caesar/caesar.c index b9c71efc..3359a067 100644 --- a/caesar/caesar.c +++ b/caesar/caesar.c @@ -1,4 +1,4 @@ -/* $NetBSD: caesar.c,v 1.7 1998/09/13 15:27:27 hubertf Exp $ */ +/* $NetBSD: caesar.c,v 1.8 1999/07/21 04:04:21 hubertf Exp $ */ /* * Copyright (c) 1989, 1993 @@ -51,7 +51,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)caesar.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: caesar.c,v 1.7 1998/09/13 15:27:27 hubertf Exp $"); +__RCSID("$NetBSD: caesar.c,v 1.8 1999/07/21 04:04:21 hubertf Exp $"); #endif #endif /* not lint */ @@ -92,6 +92,9 @@ main(argc, argv) char *inbuf; int obs[26], try, winner; + /* revoke setgid privileges */ + setregid(getgid(), getgid()); + winnerdot = 0; if (argc > 1) printit(argv[1]); -- 2.47.1