Bläddra i källkod

Fix syscall usage for keygen application

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1523 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 18 år sedan
förälder
incheckning
70f19eb335
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      exec/keygen.c

+ 2 - 2
exec/keygen.c

@@ -72,7 +72,7 @@ int main (void) {
 	/*
 	/*
 	 * Open key
 	 * Open key
 	 */
 	 */
-	authkey_fd = open ("/etc/ais/authkey", O_CREAT|O_WRONLY);
+	authkey_fd = open ("/etc/ais/authkey", O_CREAT|O_WRONLY, 600);
 	if (authkey_fd == -1) {
 	if (authkey_fd == -1) {
 		perror ("Could not create /etc/ais/authkey");
 		perror ("Could not create /etc/ais/authkey");
 		exit (1);
 		exit (1);
@@ -80,7 +80,7 @@ int main (void) {
 	/*
 	/*
 	 * Set security of authorization key to uid = 0 uid = 0 mode = 0400
 	 * Set security of authorization key to uid = 0 uid = 0 mode = 0400
 	 */
 	 */
-	fchown (authkey_fd, 0, 0);
+	res = fchown (authkey_fd, 0, 0);
 	fchmod (authkey_fd, 0400);
 	fchmod (authkey_fd, 0400);
 
 
 	printf ("Writing openais key to /etc/ais/authkey.\n");
 	printf ("Writing openais key to /etc/ais/authkey.\n");