Change in vdsm[master]: net: set netconf/* owner to 'vdsm'

edwardh at redhat.com edwardh at redhat.com
Wed Dec 23 14:24:09 UTC 2015


Edward Haas has uploaded a new change for review.

Change subject: net: set netconf/* owner to 'vdsm'
......................................................................

net: set netconf/* owner to 'vdsm'

On rhev-h netconf/* has umask of 660 with root as
owner. Accessing the folders and files by vdsm
is denied.
Resolved by changing the owner of the files and
folders to 'vdsm'

Change-Id: I65725c698bdd3cd3a51a3327b33ce9b16292820a
Bug-Url: https://bugzilla.redhat.com/1293617
Signed-off-by: Edward Haas <edwardh at redhat.com>
---
M lib/vdsm/netconfpersistence.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/84/50984/1

diff --git a/lib/vdsm/netconfpersistence.py b/lib/vdsm/netconfpersistence.py
index c705a4d..9247f6c 100644
--- a/lib/vdsm/netconfpersistence.py
+++ b/lib/vdsm/netconfpersistence.py
@@ -23,6 +23,7 @@
 import json
 import logging
 import os
+import pwd
 
 from .config import config
 from .tool.restore_nets import restore
@@ -164,6 +165,11 @@
         with open(path, 'w') as configurationFile:
             json.dump(config, configurationFile, indent=4)
 
+        # Set owner to vdsm (required by RHEV-H)
+        vdsm_uid = pwd.getpwnam('vdsm').pw_uid
+        os.chown(dirPath, vdsm_uid, 0)
+        os.chown(path, vdsm_uid, 0)
+
     @staticmethod
     def _removeConfig(path):
         utils.rmFile(path)


-- 
To view, visit https://gerrit.ovirt.org/50984
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65725c698bdd3cd3a51a3327b33ce9b16292820a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh at redhat.com>


More information about the vdsm-patches mailing list