From ee82f4834590d07562f655d34030a23671ea46d4 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Fri, 10 Apr 2009 02:44:51 +0000 Subject: [PATCH] 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 --- tools/corosync-keygen.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/corosync-keygen.c b/tools/corosync-keygen.c index 73678210..5b70d521 100644 --- a/tools/corosync-keygen.c +++ b/tools/corosync-keygen.c @@ -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");