2
* lib/krb5/os/krbfileio.c
4
* Copyright (c) Hewlett-Packard Company 1991
5
* Released to the Massachusetts Institute of Technology for inclusion
6
* in the Kerberos source code distribution.
8
* Copyright 1991 by the Massachusetts Institute of Technology.
11
* Export of this software from the United States of America may
12
* require a specific license from the United States Government.
13
* It is the responsibility of any person or organization contemplating
14
* export to obtain such a license before exporting.
16
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
17
* distribute this software and its documentation for any purpose and
18
* without fee is hereby granted, provided that the above copyright
19
* notice appear in all copies and that both that copyright notice and
20
* this permission notice appear in supporting documentation, and that
21
* the name of M.I.T. not be used in advertising or publicity pertaining
22
* to distribution of the software without specific, written prior
23
* permission. Furthermore if you modify this software you must label
24
* your software as modified software and not distribute it in such a
25
* fashion that it might be confused with the original M.I.T. software.
26
* M.I.T. makes no representations about the suitability of
27
* this software for any purpose. It is provided "as is" without express
28
* or implied warranty.
31
* krb5_create_secure_file
35
#ifdef MODULE_VERSION_ID
36
static char *VersionID = "@(#)krbfileio.c 2 - 08/22/91";
41
#ifdef HAVE_SYS_FILE_H
51
# define OPEN_MODE_NOT_TRUSTWORTHY
55
krb5_create_secure_file(krb5_context context, const char *pathname)
60
* Create the file with access restricted to the owner
62
fd = THREEPARAMOPEN(pathname, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600);
64
#ifdef OPEN_MODE_NOT_TRUSTWORTHY
66
* Some systems that support default acl inheritance do not
67
* apply ownership information from the process - force the file
68
* to have the proper info.
81
#endif /* OPEN_MODE_NOT_TRUSTWORTHY */
92
krb5_sync_disk_file(krb5_context context, FILE *fp)
95
#if !defined(MSDOS_FILESYSTEM)
96
if (fsync(fileno(fp))) {