diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2006-06-14 16:23:02 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2006-06-14 16:23:02 +0000 |
commit | 1024e3943e17bd4407f0cf3a799cfa05d59f1059 (patch) | |
tree | 6f072dad611b3ce7872008bf9d66b23a34c28039 /contrib/sendmail/src/bf.c | |
parent | ef9770707c0f88e94a0c4a409f8fb74cea250716 (diff) | |
download | FreeBSD-src-1024e3943e17bd4407f0cf3a799cfa05d59f1059.zip FreeBSD-src-1024e3943e17bd4407f0cf3a799cfa05d59f1059.tar.gz |
Import sendmail 8.13.7
Security: FreeBSD-SA-06:17.sendmail
Diffstat (limited to 'contrib/sendmail/src/bf.c')
-rw-r--r-- | contrib/sendmail/src/bf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/sendmail/src/bf.c b/contrib/sendmail/src/bf.c index 87bef77..b31ce7e 100644 --- a/contrib/sendmail/src/bf.c +++ b/contrib/sendmail/src/bf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2002, 2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2002, 2004, 2006 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -18,7 +18,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: bf.c,v 8.61 2004/08/03 23:59:02 ca Exp $") +SM_RCSID("@(#)$Id: bf.c,v 8.62 2006/03/31 18:45:56 ca Exp $") #include <sys/types.h> #include <sys/stat.h> @@ -540,13 +540,16 @@ sm_bfwrite(fp, buf, nbytes) if (!bfp->bf_ondisk) { MODE_T omask; + int save_errno; /* Clear umask as bf_filemode are the true perms */ omask = umask(0); retval = OPEN(bfp->bf_filename, O_RDWR | O_CREAT | O_TRUNC | QF_O_EXTRA, bfp->bf_filemode, bfp->bf_flags); + save_errno = errno; (void) umask(omask); + errno = save_errno; /* Couldn't create file: failure */ if (retval < 0) |