X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fshellcommands.pm;h=a4eb0a052fab372cf015d14f5da9789d232e75a7;hb=bb70dc0af47c15b8041ebc85b6eff234a26baa14;hp=edc944009e2350e8794448ac675c6753af264fc6;hpb=92b6d3bef27fdcfb22cb67f2c62173cfda246684;p=freeside.git diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm index edc944009..a4eb0a052 100644 --- a/FS/FS/part_export/shellcommands.pm +++ b/FS/FS/part_export/shellcommands.pm @@ -40,6 +40,13 @@ sub _export_command { { no strict 'refs'; ${$_} = $svc_acct->getfield($_) foreach $svc_acct->fields; + + my $count = 1; + foreach my $acct_snarf ( $svc_acct->acct_snarf ) { + ${"snarf_$_$count"} = shell_quote( $acct_snarf->get($_) ) + foreach qw( machine username _password ); + $count++; + } } my $cust_pkg = $svc_acct->cust_svc->cust_pkg; @@ -52,9 +59,15 @@ sub _export_command { $finger = shell_quote $finger; $quoted_password = shell_quote $_password; $domain = $svc_acct->domain; - $crypt_password = ''; #surpress "used only once" warnings - $crypt_password = crypt( $svc_acct->_password, + + #eventually should check a "password-encoding" field + if ( length($svc_acct->_password) == 13 + || $svc_acct->_password =~ /^\$(1|2a?)\$/ ) { + $crypt_password = $svc_acct->_password; + } else { + $crypt_password = crypt( $svc_acct->_password, $saltset[int(rand(64))].$saltset[int(rand(64))] ); + } $self->shellcommands_queue( $svc_acct->svcnum, user => $self->option('user')||'root', @@ -90,6 +103,12 @@ sub _export_replace { if ( $old_domain ne $new_domain ) { $error ||= "can't change domain"; } + if ( $old_uid != $new_uid ) { + $error ||= "can't change uid"; + } + if ( $old_dir ne $new_dir ) { + $error ||= "can't change dir"; + } return $error. ' ('. $self->exporttype. ' to '. $self->machine. ')' if $error; } @@ -112,7 +131,7 @@ sub shellcommands_queue { } sub ssh_cmd { #subroutine, not method - use Net::SSH '0.07'; + use Net::SSH '0.08'; &Net::SSH::ssh_cmd( { @_ } ); }