Remove warning in keygen and report error on fchown appropriately.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2052 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2009-04-10 02:44:51 +00:00
parent 2827180b36
commit ee82f48345

View File

@ -83,9 +83,13 @@ int main (void) {
exit (1);
}
/*
* Set security of authorization key to uid = 0 uid = 0 mode = 0400
* Set security of authorization key to uid = 0 gid = 0 mode = 0400
*/
fchown (authkey_fd, 0, 0);
res = fchown (authkey_fd, 0, 0);
if (res == -1) {
perror ("Could not fchown key to uid 0 and gid 0\n");
exit (1);
}
fchmod (authkey_fd, 0400);
printf ("Writing corosync key to " KEYFILE ".\n");