[node-patches] Change in ovirt-node[master]: Manually set a GID for CIM

rbarry at redhat.com rbarry at redhat.com
Fri Oct 18 18:06:29 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: Manually set a GID for CIM
......................................................................

Manually set a GID for CIM

Previously, we added a new group for CIM in %post before creating
the admin user, which creates ownership problems on upgrades.
Instead, see whether or not the cim user exists, and try to take
gid 501. If we can't get 501, create with any GID (plugin being
installed after the fact? Planning for live plugins and users
added).

Change-Id: If5d235093a84c2a8b9a3dfc220e50565b7c7dc62
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1018063
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M ovirt-node.spec.in
1 file changed, 14 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/02/20302/1

diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
index e94ddf9..d7f61f4 100644
--- a/ovirt-node.spec.in
+++ b/ovirt-node.spec.in
@@ -203,7 +203,20 @@
 This package provides a cim plugin for use with%{product_family} image.
 
 %post plugin-cim
-groupadd cim
+# Hack for rhbz#1018063
+# The only time this is a problem is if we're upgrading from a pre-
+# plugin version to a newer node. Manually specify the GID so we don't
+# end up with a different one on the new image
+if [[ ! `egrep '^cim' /etc/group` ]]; then
+    # Create a group
+    if [[ ! `egrep '^.*?:.*?:501:'` /etc/group` ]]; then
+        # gid 501 isn't taken
+        groupadd -g 501 cim
+    else
+        # Take whatever GID we get -- probably no conflicts
+        groupadd cim
+    fi
+fi
 useradd -g cim -G sfcb -s /sbin/nologin cim
 %if ! %{is_systemd}
 /sbin/chkconfig --add ovirt-cim


-- 
To view, visit http://gerrit.ovirt.org/20302
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5d235093a84c2a8b9a3dfc220e50565b7c7dc62
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list