From 6b4069ad563ce578cbfa6f90e76b462d26483e67 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 13 Jun 2006 13:05:15 +1000 Subject: - markus@cvs.openbsd.org 2006/06/06 10:20:20 [readpass.c sshconnect.c sshconnect.h sshconnect2.c uidswap.c] replace remaining setuid() calls with permanently_set_uid() and check seteuid() return values; report Marcus Meissner; ok dtucker djm --- uidswap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'uidswap.c') diff --git a/uidswap.c b/uidswap.c index 6dc1680db..ba2d20942 100644 --- a/uidswap.c +++ b/uidswap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uidswap.c,v 1.27 2006/04/22 04:06:51 djm Exp $ */ +/* $OpenBSD: uidswap.c,v 1.28 2006/06/06 10:20:20 markus Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -169,6 +169,8 @@ permanently_set_uid(struct passwd *pw) uid_t old_uid = getuid(); gid_t old_gid = getgid(); + if (pw == NULL) + fatal("permanently_set_uid: no user given"); if (temporarily_use_uid_effective) fatal("permanently_set_uid: temporarily_use_uid effective"); debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid, -- cgit v1.2.3