From 6cfe7be80e7eb2153d7fb503076d84177da7ad4c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 Sep 2006 01:16:01 +0000 Subject: r18241: If replacing the krb5.conf, ensure it's readable. Jeremy. (This used to be commit dfd93a30311ff0e57ef23ae1f1cb58d4019a3eee) --- source3/libads/kerberos.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/libads') diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index 7eb0bdc145..6374c515ad 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -580,6 +580,16 @@ BOOL create_local_private_krb5_conf_for_domain(const char *realm, const char *do tmpname, strerror(errno) )); } + if (fchmod(fd, 0644)==-1) { + DEBUG(0,("create_local_private_krb5_conf_for_domain: fchmod failed for %s." + " Errno %s\n", + tmpname, strerror(errno) )); + unlink(tmpname); + close(fd); + TALLOC_FREE(dname); + return False; + } + ret = write(fd, file_contents, flen); if (flen != ret) { DEBUG(0,("create_local_private_krb5_conf_for_domain: write failed," -- cgit