2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
17 krb5_create_secure_file(krb5_context context
, const char *pathname
)
22 open_flag
= O_CREAT
|O_EXCL
|O_TRUNC
|O_RDWR
;
25 * Make sure file name is reserved.
26 * The O_BINARY flag is not a supported flag in the Solaris
27 * open(2) system call, but it is included here to be consistent
28 * with other open calls in the Kerberos library code.
31 fd
= open(pathname
, open_flag
| O_BINARY
, 0600);
41 krb5_sync_disk_file(krb5_context context
, FILE *fp
)
47 if ((fflush(fp
) == EOF
) || ferror(fp
) || (fsync(fileno(fp
)) == -1)) {