Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-6983

[RFE] Avoid using sudo when using katello-backup

XMLWordPrintable

    • None

      Description of problem:
      In some companies that sudo rule is forbidden.

      /usr/bin/katello-backup
      ~~~
      ...
      def validate_directory
      unless system("sudo -u postgres test -w #

      {@dir}")
      puts "***cancelled***"
      puts "Postgres user needs write access to the backup directory"
      puts "Please select a directory, such as /tmp or /var/tmp which allows Postgres write access"
      cleanup
      end
      end
      ...
      ~~~

      Version-Release number of selected component (if applicable):


      Would also resolve the issue for:
      https://bugzilla.redhat.com/show_bug.cgi?id=1540382

      Proposed patch:
      ~~~
      # gendiff /usr/bin/ .bkp
      diff -up /usr/bin/katello-backup.bkp /usr/bin/katello-backup
      — /usr/bin/katello-backup.bkp 2018-04-26 15:25:34.514218862 +0100
      +++ /usr/bin/katello-backup 2018-04-26 15:27:36.528155663 +0100
      @@ -286,7 +286,7 @@ def backup_config_files
      end

      def validate_directory
      - unless system("sudo -u postgres test -w #{@dir}

      ")
      + unless system("su - postgres -c 'test -w #

      {@dir}

      '")
      puts "***cancelled***"
      puts "Postgres user needs write access to the backup directory"
      puts "Please select a directory, such as /tmp or /var/tmp which allows Postgres write access"
      ~~~

              jira-bugzilla-migration RH Bugzilla Integration
              jira-bugzilla-migration RH Bugzilla Integration
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: