chiark / gitweb /
really: Support REALLY_CHECK_FILE_2 for checking multiple files
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 12 Aug 2019 09:52:28 +0000 (10:52 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 12 Aug 2019 09:55:40 +0000 (10:55 +0100)
Only works if REALLY_CHECK_FILE is defined too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
cprogs/really.c

index b79da8f9c02b8be1f95ca32178f9cbab36c12de7..3183e500746d9196c428f639e56a6a823df62d9e 100644 (file)
@@ -103,6 +103,11 @@ static int checkroot(void) {
   int r;
   r= access(REALLY_CHECK_FILE,   W_OK);
   if (!r) return 0;
+#ifdef REALLY_CHECK_FILE_2
+  r= access(REALLY_CHECK_FILE_2, W_OK);
+  if (!r) return 0;
+  /* If all fails we return the errno from file _2 */
+#endif REALLY_CHECK_FILE_2
   return -1;
 }
 #endif