Module Name:    src
Committed By:   riastradh
Date:           Sat Aug  5 13:29:57 UTC 2023

Modified Files:
        src/tests/crypto/opencrypto: h_ioctl.c

Log Message:
tests/crypto/opencrypto: test_asymfeat requires privileges.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/crypto/opencrypto/h_ioctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/crypto/opencrypto/h_ioctl.c
diff -u src/tests/crypto/opencrypto/h_ioctl.c:1.5 src/tests/crypto/opencrypto/h_ioctl.c:1.6
--- src/tests/crypto/opencrypto/h_ioctl.c:1.5	Sat May 21 20:38:34 2022
+++ src/tests/crypto/opencrypto/h_ioctl.c	Sat Aug  5 13:29:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_ioctl.c,v 1.5 2022/05/21 20:38:34 riastradh Exp $	*/
+/*	$NetBSD: h_ioctl.c,v 1.6 2023/08/05 13:29:57 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -32,6 +32,7 @@
 #include <poll.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <sys/errno.h>
 #include <sys/ioctl.h>
@@ -450,9 +451,11 @@ main(void)
 	if (ret < 0)
 		err(1, "test_ncryptret");
 
-	ret = test_asymfeat(fd);
-	if (ret < 0)
-		err(1, "test_asymfeat");
+	if (getuid() == 0) {
+		ret = test_asymfeat(fd);
+		if (ret < 0)
+			err(1, "test_asymfeat");
+	}
 
 	return 0;
 }

Reply via email to