[openib-general] [PATCH] opensm: permissions of db files directory

Sasha Khapyorsky sashak at voltaire.com
Mon Nov 6 16:55:04 PST 2006


When creating directory for db files (guid2lid) storing create it with
reasonable permissions (current 777 decimal = octal 01411) and don't do
it world writable.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 osm/opensm/osm_db_files.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/osm/opensm/osm_db_files.c b/osm/opensm/osm_db_files.c
index 7539afd..dd0a8df 100644
--- a/osm/opensm/osm_db_files.c
+++ b/osm/opensm/osm_db_files.c
@@ -194,7 +194,7 @@ osm_db_init(
   /* make sure the directory exists */
   if (lstat(p_db_imp->db_dir_name, &dstat))
   {
-    if (mkdir(p_db_imp->db_dir_name, 777))
+    if (mkdir(p_db_imp->db_dir_name, 0755))
     {
       osm_log( p_log, OSM_LOG_ERROR,
                "osm_db_init: ERR 6101: "
-- 
1.4.3.3.g8387





More information about the general mailing list