more error testing from Love Hörnquist-Åstrand <e96_lho@elixir.e.kth.se>

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4180 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-12-10 02:56:11 +00:00
parent c9d8aadbba
commit 84e37f1aef
2 changed files with 14 additions and 5 deletions

View File

@@ -264,11 +264,13 @@ create_and_write_cookie (char *xauthfile,
auth.data = (char*)cookie;
des_rand_data (cookie, sz);
strncpy(xauthfile, "/tmp/AXXXXX", size);
strncpy(xauthfile, "/tmp/AXXXXXX", size);
xauthfile[size-1] = 0;
fd = mkstemp(xauthfile);
if(fd < 0)
return 1;
if(fd < 0) {
syslog(LOG_ERR, "create_and_write_cookie: mkstemp: %m");
return 1;
}
f = fdopen(fd, "r+");
if(f == NULL){
close(fd);