diff options
Diffstat (limited to 'usr.bin/cvs/sock.c')
-rw-r--r-- | usr.bin/cvs/sock.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/cvs/sock.c b/usr.bin/cvs/sock.c index 7c948fe1f66..e543e0154f5 100644 --- a/usr.bin/cvs/sock.c +++ b/usr.bin/cvs/sock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sock.c,v 1.5 2004/09/24 14:28:07 jfb Exp $ */ +/* $OpenBSD: sock.c,v 1.6 2004/09/24 15:51:07 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -130,7 +130,9 @@ cvsd_sock_close(void) if (close(cvsd_sock) == -1) { cvs_log(LP_ERRNO, "failed to close local socket"); } - if (unlink(cvsd_sock_path) == -1) + if (seteuid(0) == -1) + cvs_log(LP_ERRNO, "failed to regain privileges"); + else if (unlink(cvsd_sock_path) == -1) cvs_log(LP_ERRNO, "failed to unlink local socket `%s'", cvsd_sock_path); } |