[freeside-users] patch bind.export to rsync/ssh as non-root user

Luke S Crawford lsc at prgmr.com
Fri Mar 24 03:07:59 PST 2006



I dono if there is a better way to do this or not, but I was trying to 
run bind.export as user 'export' (that has permissions to write to the named 
files and rndc)  but logging in as user 'root' is hard-coded into the 
bind.export file.  This is a quick hack to make it login as '$user' (the 
first argument to bind.export) rather than 'root'.

let me know if this is the wrong place to send patches.


--
Luke Crawford
http://prgmr.com/
-------------- next part --------------
*** bind.export.orig	Fri Mar 24 02:35:37 2006
--- bind.export	Fri Mar 24 02:35:56 2006
***************
*** 114,131 ****
    $rsync->exec( {
      src       => "$prefix/",
      recursive => 1,
!     dest      => "root\@$machine:$zonepath/",
      exclude   => [qw( *.import named.conf.HEADER named.conf )],
    } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
   # warn $rsync->out;
  
    $rsync->exec( {
      src     => "$prefix/named.conf",
!     dest    => "root\@$machine:". $export->option('named_conf'),
    } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
  #  warn $rsync->out;
  
!   ssh("root\@$machine", "$ndc_cmd reload");
  
  }
  
--- 114,131 ----
    $rsync->exec( {
      src       => "$prefix/",
      recursive => 1,
!     dest      => "$user\@$machine:$zonepath/",
      exclude   => [qw( *.import named.conf.HEADER named.conf )],
    } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
   # warn $rsync->out;
  
    $rsync->exec( {
      src     => "$prefix/named.conf",
!     dest    => "$user\@$machine:". $export->option('named_conf'),
    } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
  #  warn $rsync->out;
  
!   ssh("$user\@$machine", "$ndc_cmd reload");
  
  }
  
***************
*** 178,188 ****
  
    $rsync->exec( {
      src     => "$prefix/named.conf",
!     dest    => "root\@$machine:". $sexport->option('named_conf'),
    } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
  #  warn $rsync->out;
  
!   ssh("root\@$machine", "$ndc_cmd reload");
  
  }
  close NAMED_CONF;
--- 178,188 ----
  
    $rsync->exec( {
      src     => "$prefix/named.conf",
!     dest    => "$user\@$machine:". $sexport->option('named_conf'),
    } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
  #  warn $rsync->out;
  
!   ssh("$user\@$machine", "$ndc_cmd reload");
  
  }
  close NAMED_CONF;


More information about the freeside-users mailing list