Skip to content

Commit e471d23

Browse files
committed
pci: do not probe PCI topology on Solaris unless effective uid is root
Otherwise libpciaccess sends a big error message to stderr: Error opening /devices/pci@0,0:reg: Permission denied (cherry picked from commit open-mpi/hwloc@d93c7c0) (cherry picked from commit open-mpi/ompi@2ac09d5)
1 parent 1b6740a commit e471d23

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

opal/mca/hwloc/hwloc1110/hwloc/src/topology-pci.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/*
22
* Copyright © 2009 CNRS
3-
* Copyright © 2009-2014 Inria. All rights reserved.
3+
* Copyright © 2009-2015 Inria. All rights reserved.
44
* Copyright © 2009-2011, 2013 Université Bordeaux
55
* Copyright © 2014 Cisco Systems, Inc. All rights reserved.
6+
* Copyright © 2015 Research Organization for Information Science
7+
* and Technology (RIST). All rights reserved.
68
* See COPYING in top-level directory.
79
*/
810

@@ -305,7 +307,12 @@ hwloc_pci_component_instantiate(struct hwloc_disc_component *component,
305307
if (!backend)
306308
return NULL;
307309
backend->flags = HWLOC_BACKEND_FLAG_NEED_LEVELS;
308-
backend->discover = hwloc_look_pci;
310+
#ifdef HWLOC_SOLARIS_SYS
311+
if ((uid_t)0 != geteuid())
312+
backend->discover = NULL;
313+
else
314+
#endif
315+
backend->discover = hwloc_look_pci;
309316
return backend;
310317
}
311318

0 commit comments

Comments
 (0)