From b9ea01d83fc29c8a2d3fdae6d31bdc0a524a91e8 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 19 Nov 2007 21:04:31 +0000 Subject: [PATCH 1/1] don't fatal() if cannot create a root account Organization: Straylight/Edgeware From: Richard Kettlewell --- server/setup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/setup.c b/server/setup.c index 47cbc87..4ccb00e 100644 --- a/server/setup.c +++ b/server/setup.c @@ -66,8 +66,10 @@ void make_root_login(void) { gcry_randomize(pwbin, sizeof pwbin, GCRY_STRONG_RANDOM); pwhex = hex(pwbin, sizeof pwbin); /* Create the file */ - if((fd = open(privconfignew, O_WRONLY|O_CREAT, 0600)) < 0) - fatal(errno, "error creating %s", privconfignew); + if((fd = open(privconfignew, O_WRONLY|O_CREAT, 0600)) < 0) { + error(errno, "error creating %s", privconfignew); + return; /* not fatal! */ + } /* Fix permissions */ if(pw) { if(fchown(fd, 0, pw->pw_gid) < 0) -- [mdw]