[ARVADOS-DEV] created: b6488e3814aea0a97a6912ffb92327030df69e63

Git user git at public.curoverse.com
Fri Feb 26 18:13:35 EST 2016


        at  b6488e3814aea0a97a6912ffb92327030df69e63 (commit)


commit b6488e3814aea0a97a6912ffb92327030df69e63
Author: Brett Smith <brett at curoverse.com>
Date:   Fri Feb 26 18:13:19 2016 -0500

    8413: Rails postinst doesn't chgrp root /etc/arvados.
    
    Non-sensitive Rails configuration files can be 0644 root:root.
    Porting those permissions is fine for the individual configuration
    file, but not the parent directory tree.  Don't change the group of
    the directory tree in this case.

diff --git a/jenkins/rails-package-scripts/postinst.sh b/jenkins/rails-package-scripts/postinst.sh
index 5ff2a9b..6fac26b 100644
--- a/jenkins/rails-package-scripts/postinst.sh
+++ b/jenkins/rails-package-scripts/postinst.sh
@@ -94,11 +94,13 @@ setup_conffile() {
         # If there's a config file in /var/www identical to the one in /etc,
         # overwrite it with a symlink after porting its permissions.
         elif cmp --quiet "$release_conffile" "$etc_conffile"; then
-            local ownership="$(stat -c "%U:%G" "$release_conffile")"
+            local ownership="$(stat -c "%u:%g" "$release_conffile")"
+            local owning_group="${ownership#*:}"
+            if [ 0 != "$owning_group" ]; then
+                chgrp "$owning_group" "$CONFIG_PATH" /etc/arvados
+            fi
             chown "$ownership" "$etc_conffile"
             chmod --reference="$release_conffile" "$etc_conffile"
-            chgrp "${ownership#*:}" "$CONFIG_PATH" /etc/arvados
-            chmod g+rx "$CONFIG_PATH" /etc/arvados
             ln --force -s "$etc_conffile" "$release_conffile"
         fi
     fi

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list