Index: openmpi-5.0.6/3rd-party/prrte/src/mca/ess/base/ess_base_std_prted.c
===================================================================
--- openmpi-5.0.6.orig/3rd-party/prrte/src/mca/ess/base/ess_base_std_prted.c
+++ openmpi-5.0.6/3rd-party/prrte/src/mca/ess/base/ess_base_std_prted.c
@@ -97,7 +97,7 @@ int prte_ess_base_prted_setup(void)
 {
     int ret = PRTE_ERROR;
     int fd;
-    char log_file[PATH_MAX];
+    char *log_file;
     char *error = NULL;
     char *uri = NULL;
     char *tmp = NULL;
@@ -273,10 +273,11 @@ int prte_ess_base_prted_setup(void)
          */
 
         /* define a log file name in the session directory */
-        snprintf(log_file, PATH_MAX, "output-prted-%s-%s.log",
+        pmix_asprintf(&log_file, "output-prted-%s-%s.log",
                  prte_process_info.myproc.nspace,
                  prte_process_info.nodename);
         log_path = pmix_os_path(false, prte_process_info.top_session_dir, log_file, NULL);
+        free(log_file);
 
         fd = open(log_path, O_RDWR | O_CREAT | O_TRUNC, 0640);
         if (fd < 0) {
Index: openmpi-5.0.6/3rd-party/prrte/src/mca/odls/base/odls_base_default_fns.c
===================================================================
--- openmpi-5.0.6.orig/3rd-party/prrte/src/mca/odls/base/odls_base_default_fns.c
+++ openmpi-5.0.6/3rd-party/prrte/src/mca/odls/base/odls_base_default_fns.c
@@ -87,6 +87,10 @@
 
 #include "src/mca/odls/base/base.h"
 
+#ifndef MAXPATHLEN /* Hurd */
+#define MAXPATHLEN 65535
+#endif
+
 typedef struct {
     prte_job_t *jdata;
     pmix_info_t *info;
Index: openmpi-5.0.6/3rd-party/prrte/src/mca/filem/raw/filem_raw_module.c
===================================================================
--- openmpi-5.0.6.orig/3rd-party/prrte/src/mca/filem/raw/filem_raw_module.c
+++ openmpi-5.0.6/3rd-party/prrte/src/mca/filem/raw/filem_raw_module.c
@@ -847,7 +847,7 @@ static int link_archive(prte_filem_raw_i
 {
     FILE *fp;
     char *cmd;
-    char path[MAXPATHLEN];
+    char path[PRTE_PATH_MAX];
 
     PMIX_OUTPUT_VERBOSE((1, prte_filem_base_framework.framework_output,
                          "%s filem:raw: identifying links for archive %s",
@@ -1064,7 +1064,7 @@ static void write_handler(int fd, short
     prte_filem_raw_output_t *output;
     int num_written;
     char *dirname, *cmd;
-    char homedir[MAXPATHLEN];
+    char homedir[PRTE_PATH_MAX];
     int rc;
     PRTE_HIDE_UNUSED_PARAMS(fd, event);
 
Index: openmpi-5.0.6/3rd-party/prrte/src/mca/odls/default/odls_default_module.c
===================================================================
--- openmpi-5.0.6.orig/3rd-party/prrte/src/mca/odls/default/odls_default_module.c
+++ openmpi-5.0.6/3rd-party/prrte/src/mca/odls/default/odls_default_module.c
@@ -292,7 +292,7 @@ static void do_child(prte_odls_spawn_cad
 {
     int i;
     sigset_t sigs;
-    char dir[MAXPATHLEN];
+    char dir[PRTE_PATH_MAX];
 
 #if HAVE_SETPGID
     /* Set a new process group for this child, so that any
Index: openmpi-5.0.6/3rd-party/romio341/mpi-io/mpir_cst_filesys.c
===================================================================
--- openmpi-5.0.6.orig/3rd-party/romio341/mpi-io/mpir_cst_filesys.c
+++ openmpi-5.0.6/3rd-party/romio341/mpi-io/mpir_cst_filesys.c
@@ -13,6 +13,10 @@
 #include <dirent.h>
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 #ifdef MPICH
 
 static int comm_split_filesystem_exhaustive(MPI_Comm comm, int key,
Index: openmpi-5.0.6/3rd-party/romio341/mpl/src/str/mpl_str.c
===================================================================
--- openmpi-5.0.6.orig/3rd-party/romio341/mpl/src/str/mpl_str.c
+++ openmpi-5.0.6/3rd-party/romio341/mpl/src/str/mpl_str.c
@@ -22,6 +22,10 @@
 #include <time.h>
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 #if !defined MPL_HAVE_SNPRINTF
 int MPL_snprintf(char *str, size_t size, const char *format, ...)
 {
