]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix: chown invocations
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 14 Dec 2023 16:41:54 +0000 (13:41 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 14 Dec 2023 16:41:54 +0000 (13:41 -0300)
21 files changed:
lib/hydra/deploy
share/hydra/deploy
share/hydra/import-certs
share/hydra/import-keys
share/hydractl/backup-restore-bitcoind
share/hydractl/backup-restore-firma
share/hydractl/backup-restore-git
share/hydractl/backup-restore-hidden
share/hydractl/backup-restore-mail
share/hydractl/backup-restore-mlmmj
share/hydractl/backup-restore-munin
share/hydractl/backup-restore-schleuder
share/hydractl/backup-restore-site
share/hydractl/backup-restore-svn
share/hydractl/backup-restore-sympa
share/hydractl/backup-restore-tahoe
share/hydractl/backup-restore-yacy
share/hydractl/backup-site
share/hydractl/sync-guestfs
share/hydractl/sync-media
share/hydractl/sync-tpc

index 84a9fdacf9b41da92ed0ad39e1f6d84f90c128ab..6990339240edac11bc1f1440415e4f6970d62ff8 100644 (file)
@@ -140,7 +140,7 @@ function hydra_yaml_param {
 function hydra_deploy_mkdirs {
   # Saner defaults
   $DEPLOY_COMMAND mkdir -p       /etc/puppet/keys
-  $DEPLOY_COMMAND chown -R root. /etc/puppet
+  $DEPLOY_COMMAND chown -R root: /etc/puppet
   $DEPLOY_COMMAND chmod -R 640   /etc/puppet
 }
 
index af3d0a2bd82f969e779c55dca6e1fa4b25371c2c..b675577e0c2a5faf85fbd93b4f662d6dca332c6b 100755 (executable)
@@ -149,7 +149,7 @@ for node in $NODES; do
       tee $HYDRA_FOLDER/puppet/logs/$FQDN.`date +%Y%m%d%H%M`.log
 
     # Fix ssl folder ownership
-    $SUDO chown -R `whoami`. $HYDRA_FOLDER/puppet/ssl
+    $SUDO chown -R `whoami`: $HYDRA_FOLDER/puppet/ssl
 
     # Import keys if needed
     if ! $SUDO test -f /root/.ssh/id_rsa     || \
index 9d3cc88f733d880da7b473722fcf86ce9dc23742..e1ceda6b7f30026d1f358770043cfb73972f63e9 100755 (executable)
@@ -48,8 +48,8 @@ for node in $NODES; do
   $HYDRA_CONNECT $hostname <<EOF
   sudo mkdir -p            /etc/ssl/private
   sudo mkdir -p            /etc/ssl/certs
-  sudo chown root.ssl-cert /etc/ssl/private
-  sudo chown root.ssl-cert /etc/ssl/certs
+  sudo chown root:ssl-cert /etc/ssl/private
+  sudo chown root:ssl-cert /etc/ssl/certs
   sudo chmod 750           /etc/ssl/private
   sudo chmod 755           /etc/ssl/certs
 EOF
@@ -62,10 +62,10 @@ EOF
 
     $HYDRA_CONNECT $hostname <<EOF
       sudo touch               /etc/ssl/certs/$cert
-      sudo chown root.ssl-cert /etc/ssl/certs/$cert
+      sudo chown root:ssl-cert /etc/ssl/certs/$cert
       sudo chmod 644           /etc/ssl/certs/$cert
       sudo touch               /etc/ssl/private/$priv
-      sudo chown root.ssl-cert /etc/ssl/private/$priv
+      sudo chown root:ssl-cert /etc/ssl/private/$priv
       sudo chmod 640           /etc/ssl/private/$priv
 EOF
 
index 21fe744271c51eca848789482a3e4bf072ea347b..7339a0d7f6e45bc500ed0594669eb3ab0de920f1 100755 (executable)
@@ -85,7 +85,7 @@ function hydra_import_keys_openssh {
     echo "Creating folder structure at $hostname:/root/.ssh..."
     $HYDRA_CONNECT $hostname <<EOF
     sudo mkdir -p        /root/.ssh
-    sudo chown root.root /root/.ssh
+    sudo chown root:root /root/.ssh
     sudo chmod 700       /root/.ssh
     sudo touch           /root/.ssh/id_rsa
     sudo touch           /root/.ssh/id_rsa.pub
@@ -107,7 +107,7 @@ EOF
 
     echo "Creating folder structure at $hostname:/root/.ssh..."
     sudo mkdir -p        /root/.ssh
-    sudo chown root.root /root/.ssh
+    sudo chown root:root /root/.ssh
     sudo chmod 700       /root/.ssh
     sudo touch           /root/.ssh/id_rsa
     sudo touch           /root/.ssh/id_rsa.pub
@@ -133,8 +133,8 @@ function hydra_import_keys_borg {
     $HYDRA_CONNECT $hostname <<EOF
     sudo rm    -rf       /root/.borg
     sudo mkdir -p        /root/.config/borg/hydra
-    sudo chown root.root /root/.config/borg
-    sudo chown root.root /root/.config/borg/hydra
+    sudo chown root:root /root/.config/borg
+    sudo chown root:root /root/.config/borg/hydra
     sudo chmod 700       /root/.config/borg
     sudo chmod 700       /root/.config/borg/hydra
     sudo touch           /root/.config/borg/hydra/key
@@ -154,8 +154,8 @@ EOF
 
     echo "Creating folder structure at $hostname:/root/.config/borg..."
     sudo mkdir -p        /root/.config/borg/hydra
-    sudo chown root.root /root/.config/borg
-    sudo chown root.root /root/.config/borg/hydra
+    sudo chown root:root /root/.config/borg
+    sudo chown root:root /root/.config/borg/hydra
     sudo chmod 700       /root/.config/borg
     sudo chmod 700       /root/.config/borg/hydra
     sudo touch           /root/.config/borg/hydra/key
index 359492d6e312202a46d60932d3eda843fc68c3e0..9789968d6b8143432d86e690330e09388a18112d 100755 (executable)
@@ -39,4 +39,4 @@ hydra_backup_environment_service
 #cp -a $RESTOREDIR/$SERVICE_DIR $SERVICE_DIR
 #
 # Fix permissions.
-#chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+#chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
index 35b2edb899ea959e806d5e41a449cc6dc7b22e28..c5042a10b8d3496f2773091186fea359e2e4215e 100755 (executable)
@@ -35,4 +35,4 @@ hydra_backup_environment_service
 rsync -av --delete $RESTOREDIR/$SERVICE_DIR/ $SERVICE_DIR/
 
 # Fix permissions.
-chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
index 53f646520c1068f2c891c49de36f793ec78b43ee..a51810a4fde5f0a13e41724009a82f70e2dcf63a 100755 (executable)
@@ -41,7 +41,7 @@ rm -rf $SERVICE_DIR
 cp -a $RESTOREDIR/$SERVICE_DIR $SERVICE_DIR
 
 # Fix permissions.
-chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
 
 # Kick config.
 su $SERVICE_USER -c "gl-setup"
index d439b294b0a96cc4c477608f79ef275f6e5ca199..36fe4f6454e2cafd5025e6f046caae5774711563 100755 (executable)
@@ -53,5 +53,5 @@ for folder in `ls $RESTOREDIR/$SERVICE_DIR`; do
 done
 
 # Fix permissions.
-chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
 
index 6179ad94addd52d218f55a2ffc491e7abd522286..e09077d8b395226d5861f2bd1cea1f078f07ef52 100755 (executable)
@@ -50,4 +50,4 @@ mkdir -p $DATABASE_DIR
 rsync -av $RESTOREDIR/$DATABASE_DIR/ $DATABASE_DIR/
 
 # Fix permissions.
-chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
index fcf1b033029a383dcde74b2e4e45d390fc52e734..7212f67dc99094551fc7303f7f05878bc765c652 100755 (executable)
@@ -35,4 +35,4 @@ hydra_backup_environment_service
 rsync -av --delete $RESTOREDIR/$SERVICE_DIR/ $SERVICE_DIR/
 
 # Fix permissions.
-chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
index 3e5fb30fd1be536af9cad4a35ab36ed9ff5b1142..7b3848cf5cd1260189d70c941b69be44b9582e00 100755 (executable)
@@ -42,4 +42,4 @@ rm -rf $SERVICE_DIR
 cp -a $RESTOREDIR/$SERVICE_DIR $SERVICE_DIR
 
 # Fix permissions.
-chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
index b0a4541eaddbb2df06a9e26ae3187b4b9a573212..72ec65898831b51b8a16f79fed3860dac86b36b7 100755 (executable)
@@ -37,4 +37,4 @@ rsync -av --delete $RESTOREDIR/$SERVICE_DIR/ $SERVICE_DIR/
 rsync -av --delete $RESTOREDIR/$CONF_DIR/ $CONF_DIR/
 
 # Fix permissions.
-chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
index bf4899430811ba627f3ba5b226619e67db81b462..f1def1d16a6aa33b67ab10d4a6cc67bd13eb4c23 100755 (executable)
@@ -104,32 +104,32 @@ if [ "$1" == "localhost" ] || [ "$1" == "backups" ]; then
 fi
 
 # Fix permissions
-chown -R root.root $FOLDER
+chown -R root:root $FOLDER
 
 # Trac
 if [ -e "$FOLDER/trac" ]; then
   # Optionally also: gvcache/ log/
-  ( cd $FOLDER/trac && chown -R $TRAC_USER.$TRAC_GROUP attachments conf db auth plugins .egg-cache )
+  ( cd $FOLDER/trac && chown -R $TRAC_USER:$TRAC_GROUP attachments conf db auth plugins .egg-cache )
 fi
 
 # PmWiki
 if [ -e "$FOLDER/wiki" ]; then
-  ( cd $FOLDER/wiki && chown -R $SITE_USER.$SITE_GROUP wiki.d uploads )
-  chown $SITE.root $FOLDER/wiki/local/config.php
+  ( cd $FOLDER/wiki && chown -R $SITE_USER:$SITE_GROUP wiki.d uploads )
+  chown $SITE:root $FOLDER/wiki/local/config.php
   chmod 660 $FOLDER/wiki/local/config.php
 fi
 
 # Site
 if [ -e "$FOLDER/site" ]; then
-  chown -R $SITE_USER.$SITE_GROUP $FOLDER/site
+  chown -R $SITE_USER:$SITE_GROUP $FOLDER/site
 fi
 
 # Drupal
 if [ -e "$FOLDER/drupal" ]; then
   SERIES="$4"
 
-  chown -R $SITE_USER.$SITE_GROUP $FOLDER/drupal/files
-  chown root.$SITE_GROUP $FOLDER/drupal/settings.php
+  chown -R $SITE_USER:$SITE_GROUP $FOLDER/drupal/files
+  chown root:$SITE_GROUP $FOLDER/drupal/settings.php
   chmod 640 $FOLDER/drupal/settings.php
 
   if [ -e "/etc/apache2/sites-available/$SITE" ]; then
@@ -169,7 +169,7 @@ if [ -e "$FOLDER/ikiwiki" ]; then
     site="`basename $file .setup`"
     git clone file:///var/git/repositories/$SITE /var/sites/$SITE/ikiwiki_src
     ikiwiki --setup $file --rebuild
-    chown -R $SITE_USER.$SITE_GROUP /var/sites/$SITE/ikiwiki*
+    chown -R $SITE_USER:$SITE_GROUP /var/sites/$SITE/ikiwiki*
   else
     echo "Either $file or git repository not found for $SITE ikiwiki instance"
   fi
@@ -178,6 +178,6 @@ fi
 # Moin
 if [ -e "$FOLDER/moin" ]; then
   echo "Restoring moin for $SITE..."
-  chown -R root.root $FOLDER/moin/
-  chown -R $SITE_USER.$SITE_GROUP $FOLDER/moin/{cgi-bin,data,underlay}
+  chown -R root:root $FOLDER/moin/
+  chown -R $SITE_USER:$SITE_GROUP $FOLDER/moin/{cgi-bin,data,underlay}
 fi
index baf13b82204aba65f4cfe98698efc45d7c96c9d6..0829e6949854c4d0b056b58e6db5f103eb59c082 100755 (executable)
@@ -39,5 +39,5 @@ hydractl backup-site svn
 rm -rf /var/svn && cp -a $RESTOREDIR/var/svn /var/svn
 
 # Fix permissions.
-chown root.root /var/svn
-chown -R $SERVICE_USER.$SERVICE_GROUP /var/svn/*
+chown root:root /var/svn
+chown -R $SERVICE_USER:$SERVICE_GROUP /var/svn/*
index 917fdce3d75f17d521a087fd2a3f1c79e5065a00..63ea82ce2c3a95483c2b2275b46c850089584812 100755 (executable)
@@ -41,4 +41,4 @@ rsync -av --delete $RESTOREDIR/$SERVICE_DIR/ $SERVICE_DIR/
 hydra_backup_restore_database sympa
 
 # Fix permissions.
-chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
index e8b78ac8a8de4abbc2e72afc7d5b6eb75b2d1783..a3918d40172a4f34eacbf4527e890f2805b22bfd 100755 (executable)
@@ -39,4 +39,4 @@ hydra_backup_environment_service
 #cp -a $RESTOREDIR/$SERVICE_DIR $SERVICE_DIR
 #
 # Fix permissions.
-#chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+#chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
index 7161756a5b856e656db9d84657c708c42678665b..814177193edbc5d9c1266b4973bb7b077df91db2 100755 (executable)
@@ -38,4 +38,4 @@ hydra_backup_environment_service
 cp -a $RESTOREDIR/$SERVICE_DIR $SERVICE_DIR
 
 # Fix permissions.
-chown -R $SERVICE_USER.$SERVICE_GROUP $SERVICE_DIR
+chown -R $SERVICE_USER:$SERVICE_GROUP $SERVICE_DIR
index e37a611703d84590ec9266ec8f21d0185381796e..ce4a20016d7e2a73ad424ad6e90b8d2165230ed7 100755 (executable)
@@ -88,7 +88,7 @@ cd $DEST
 if [ ! -e "$DEST_BASE_SITE/.htpasswd" ]; then
   touch $DEST_BASE_SITE/.htpasswd
   chmod 640 $DEST_BASE_SITE/.htpasswd
-  chown root.$BACKUPS_GROUP $DEST_BASE_SITE/.htpasswd
+  chown root:$BACKUPS_GROUP $DEST_BASE_SITE/.htpasswd
 fi
 
 # Access setup
@@ -110,7 +110,7 @@ if [ -d "$LOCATION" ]; then
     tar jcvf $PACK $LOCATION
     md5sum $PACK  > $PACK.md5
     sha1sum $PACK > $PACK.sha1
-    chown root.$BACKUPS_GROUP $PACK*
+    chown root:$BACKUPS_GROUP $PACK*
     chmod 640 $PACK*
     echo "Saved $DEST/$PACK"
   fi
@@ -127,7 +127,7 @@ if [ -d "/var/lib/mysql/$DATABASE" ]; then
     rm -f $DATABASE.sql
     md5sum $DATABASE.sql.bz2 > $DATABASE.sql.bz2.md5
     sha1sum $DATABASE.sql.bz2 > $DATABASE.sql.bz2.sha1
-    chown root.$BACKUPS_GROUP $DATABASE.sql*
+    chown root:$BACKUPS_GROUP $DATABASE.sql*
     chmod 640 $DATABASE.sql*
     echo "Saved $DEST/$DATABASE.sql.bz2"
   fi
index dce2f2bbba601da56356715c4fc68126e8d8a73d..c2852e11d27b13a0bd29898b90d714841637baa3 100755 (executable)
@@ -40,7 +40,7 @@ if [ ! -d "$DEST" ]; then
   GROUP="$(stat -c %G $ORIG)"
 
   # With the right permissions
-  $SUDO chown $OWNER.$GROUP $DEST
+  $SUDO chown $OWNER:$GROUP $DEST
 fi
 
 # First sync the folder structure
index f3cd9733b9ac51e9f8f5544d0ff0060378cd2b16..bf95678e4e5293a821f6b5d4648bee6f364e82da 100755 (executable)
@@ -75,7 +75,7 @@ function sync_media_add_metadata {
 function sync_media_playlist_perms {
   if [ -d "playlists" ]; then
     $sudo chmod 775 playlists
-    $sudo chown -R mpd.audio playlists
+    $sudo chown -R mpd:audio playlists
     find playlists -type f -exec sudo chmod 664 {} \;
     find playlists -type d -exec sudo chmod 775 {} \;
   fi
@@ -87,7 +87,7 @@ function sync_media_incoming_perms {
     echo "Fixing $INCOMING permissions..."
     $sudo find $INCOMING -type f -exec chmod 664 {} \;
     $sudo find $INCOMING -type d -exec chmod 775 {} \;
-    $sudo chown -R $WHOAMI.incoming $INCOMING
+    $sudo chown -R $WHOAMI:incoming $INCOMING
   fi
 }
 
@@ -187,8 +187,8 @@ mkdir -p $CACHE
 #echo "Fixing $CACHE permissions..."
 #$sudo find $CACHE -type f -exec chmod 644 {} \;
 #$sudo find $CACHE -type d -exec chmod 755 {} \;
-$sudo chown $WHOAMI. $CACHE
-$sudo chown $WHOAMI. $CACHE/*
+$sudo chown $WHOAMI: $CACHE
+$sudo chown $WHOAMI: $CACHE/*
 
 # Check if a specific repository was passed via the command line
 if [ ! -z "$REPOSITORY" ] && [ -d "$CACHE/$REPOSITORY" ] && ! echo "$REPOSITORY" | grep -q -- '--'; then
index 0c8b177b27d21210558d27ac79bb0d4af233b257..c739c5adaa5ff906a3d730631f9aa86a6dd27f50 100755 (executable)
@@ -69,7 +69,7 @@ if [ ! -d "$MEDIA" ]; then
   GROUP="$(stat -c %G /var/cache/`hostname -s`/media)"
 
   # With the right permissions
-  $SUDO chown $OWNER.$GROUP $MEDIA
+  $SUDO chown $OWNER:$GROUP $MEDIA
 fi
 
 # Guest images were previously synced using rsync