Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] bug (?) opal_path_access incorrect call
From: marco atzeri (marco.atzeri_at_[hidden])
Date: 2012-10-31 04:56:19


looking on a solution for
http://www.open-mpi.org/community/lists/users/2012/10/20495.php

I noticed that the issue disappears on 1.6.2 with the patch:

----------------------------------------------------------------
--- opal/util/path.c~ 2012-04-03 16:29:52.000000000 +0200
+++ opal/util/path.c 2012-10-30 20:31:43.772749400 +0100
@@ -82,7 +82,7 @@

      /* If absolute path is given, return it without searching. */
      if( opal_path_is_absolute(fname) ) {
- return opal_path_access(fname, "", mode);
+ return opal_path_access(fname, NULL , mode);
      }

      /* Initialize. */
----------------------------------------------------------------

For what I can see on the function body, the test on path
is expecting path to be a null pointer and not a
pointer to an empty strings

----------------------------------------------------------------
char *opal_path_access(char *fname, char *path, int mode)
{
     char *fullpath = NULL;
     struct stat buf;

     /* Allocate space for the full pathname. */
     if (NULL == path) {
         fullpath = opal_os_path(false, fname, NULL);
     } else {
         fullpath = opal_os_path(false, path, fname, NULL);
     }
     if (NULL == fullpath)
         return NULL;
----------------------------------------------------------------

Regards
Marco