2022-01-17 07:01:36 +00:00
|
|
|
--- sntp/libopts/init.c.orig
|
|
|
|
|
+++ sntp/libopts/init.c
|
2023-06-07 16:38:34 +00:00
|
|
|
@@ -28,6 +28,8 @@
|
|
|
|
|
* 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
|
|
|
|
|
*/
|
2022-01-17 07:01:36 +00:00
|
|
|
|
|
|
|
|
+#define PROC_BINARY "/proc/self/exe"
|
|
|
|
|
+
|
|
|
|
|
/**
|
|
|
|
|
* Make sure the option descriptor is there and that we understand it.
|
|
|
|
|
* This should be called from any user entry point where one needs to
|
2023-06-07 16:38:34 +00:00
|
|
|
@@ -100,7 +102,13 @@ validate_struct(tOptions * opts, char co
|
2022-01-17 07:01:36 +00:00
|
|
|
else
|
|
|
|
|
*pp = pname;
|
|
|
|
|
|
2023-06-07 16:38:34 +00:00
|
|
|
- pz = pathfind(getenv("PATH"), (char *)pname, "rx");
|
2022-01-17 07:01:36 +00:00
|
|
|
+#if defined(HAVE_CANONICALIZE_FILE_NAME)
|
|
|
|
|
+ pz = canonicalize_file_name(PROC_BINARY);
|
|
|
|
|
+#elif defined(HAVE_REALPATH)
|
|
|
|
|
+ pz = realpath(PROC_BINARY, NULL);
|
|
|
|
|
+#else
|
|
|
|
|
+ pz = pathfind(getenv("PATH"), pp, "rx");
|
|
|
|
|
+#endif
|
|
|
|
|
if (pz != NULL)
|
|
|
|
|
pname = VOIDP(pz);
|
|
|
|
|
|