summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-09-08 01:16:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:51:18 -0500
commit6cfe7be80e7eb2153d7fb503076d84177da7ad4c (patch)
treedfec93fa0b8c4525f306f2c6eb3199a1fb7a1da8 /source3/libads
parent01285feba19b2e29ea7c36c24837e4f634bbcf72 (diff)
downloadsamba-6cfe7be80e7eb2153d7fb503076d84177da7ad4c.tar.gz
samba-6cfe7be80e7eb2153d7fb503076d84177da7ad4c.tar.bz2
samba-6cfe7be80e7eb2153d7fb503076d84177da7ad4c.zip
r18241: If replacing the krb5.conf, ensure it's readable.
Jeremy. (This used to be commit dfd93a30311ff0e57ef23ae1f1cb58d4019a3eee)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/kerberos.c10
1 files changed, 10 insertions, 0 deletions
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,"