[Ovirt-devel] [PATCH ovirt-node-image] alias vi to vi + restorecon

David Huff dhuff at redhat.com
Wed Jul 22 21:17:11 UTC 2009


fixes a problem with editing a bindmounted file with vi.  The file will not
retain the same selinux context due to the way vi copies files around.

Resolves rhbz#509082
---
 common-post.ks |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/common-post.ks b/common-post.ks
index 8a4940a..c85be15 100644
--- a/common-post.ks
+++ b/common-post.ks
@@ -131,6 +131,11 @@ sed -i 's/node\.session\.initial_login_retry_max.*/node.session.initial_login_re
 # root's bash profile
 cat >> /root/.bashrc <<EOF
 # aliases used for the temporary
+function mod_vi() {
+  vi $@
+  restorecon -v $@
+}
+alias vi="mod_vi"
 alias ping='ping -c 3'
 EOF
 
-- 
1.6.0.6




More information about the ovirt-devel mailing list