summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-09-02 04:50:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:39:46 -0500
commitd31ee84d888145ca0c89a201befb32def65c5995 (patch)
treecb93bd107358370e43e6163dff0c9cb6232bc1de
parente05728b6693fb5dcac946e2f278dd09193a680c6 (diff)
downloadsamba-d31ee84d888145ca0c89a201befb32def65c5995.tar.gz
samba-d31ee84d888145ca0c89a201befb32def65c5995.tar.bz2
samba-d31ee84d888145ca0c89a201befb32def65c5995.zip
r18001: Proper error reporting on write/close fail.
Jeremy. (This used to be commit ba311ac4eac060c12cafeeb8e458f45c2927aabf)
-rw-r--r--source3/libads/kerberos.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index 41c1dc00f5..fa07602c58 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -478,6 +478,7 @@ BOOL create_local_private_krb5_conf_for_domain(const char *realm, const char *do
char *fname = NULL;
char *file_contents = NULL;
size_t flen = 0;
+ size_t ret;
char *realm_upper = NULL;
int loopcount = 0;
@@ -548,13 +549,18 @@ BOOL create_local_private_krb5_conf_for_domain(const char *realm, const char *do
break;
}
- if (x_fwrite(file_contents, 1, flen, xfp) != flen) {
+ ret = x_fwrite(file_contents, 1, flen, xfp);
+ if (flen != ret) {
+ DEBUG(0,("create_local_private_krb5_conf_for_domain: x_fwrite failed,"
+ " returned %u. Errno %s\n", (unsigned int)ret, strerror(errno) ));
unlink(fname);
x_fclose(xfp);
TALLOC_FREE(dname);
return False;
}
if (x_fclose(xfp)==-1) {
+ DEBUG(0,("create_local_private_krb5_conf_for_domain: x_fclose failed."
+ " Errno %s\n", strerror(errno) ));
unlink(fname);
TALLOC_FREE(dname);
return False;