summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2010-07-28 02:46:39 -0700
committerBob Gilligan <gilligan@vyatta.com>2010-07-28 02:46:39 -0700
commit7c9a042342f6e8d8961391b173655595e25d9ca1 (patch)
tree397c7a18c52c4b27e67f9a7aa0ce855f44ae8980
parentd3bb616ddd7d97455919dcd49e132f8d271bf38b (diff)
parent67718223cb935df4805fa78dc1e92e4a6f8fc2f4 (diff)
downloadvyatta-cfg-quagga-7c9a042342f6e8d8961391b173655595e25d9ca1.tar.gz
vyatta-cfg-quagga-7c9a042342f6e8d8961391b173655595e25d9ca1.zip
Merge branch 'mendocino' of http://git.vyatta.com/vyatta-cfg-system into mendocino
-rw-r--r--debian/changelog6
-rw-r--r--scripts/dns-forwarding/vyatta-dns-forwarding.pl2
-rwxr-xr-xscripts/system/vyatta_update_resolv.pl1
-rwxr-xr-xscripts/vyatta-passwd-sync67
4 files changed, 16 insertions, 60 deletions
diff --git a/debian/changelog b/debian/changelog
index 195e92d8..237f4368 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+vyatta-cfg-system (0.17.77) unstable; urgency=low
+
+ * new API changes
+
+ -- An-Cheng Huang <ancheng@vyatta.com> Fri, 30 Jul 2010 17:26:20 -0700
+
vyatta-cfg-system (0.17.76) unstable; urgency=low
[ Stephen Hemminger ]
diff --git a/scripts/dns-forwarding/vyatta-dns-forwarding.pl b/scripts/dns-forwarding/vyatta-dns-forwarding.pl
index 4334eaaa..60abc53f 100644
--- a/scripts/dns-forwarding/vyatta-dns-forwarding.pl
+++ b/scripts/dns-forwarding/vyatta-dns-forwarding.pl
@@ -68,7 +68,6 @@ sub dnsforwarding_get_values {
$config->setLevel("service dns forwarding");
if ($outside_cli == 1){
- $config->{_active_dir_base} = "/opt/vyatta/config/active/";
@listen_interfaces = $config->returnOrigValues("listen-on");
$cache_size = $config->returnOrigValue("cache-size");
@use_nameservers = $config->returnOrigValues("name-server");
@@ -106,7 +105,6 @@ sub dnsforwarding_get_values {
$sys_config->setLevel("system");
my @system_nameservers;
if ($outside_cli == 1){
- $sys_config->{_active_dir_base} = "/opt/vyatta/config/active/";
@system_nameservers = $sys_config->returnOrigValues("name-server");
} else {
@system_nameservers = $sys_config->returnValues("name-server");
diff --git a/scripts/system/vyatta_update_resolv.pl b/scripts/system/vyatta_update_resolv.pl
index f39dd3e7..041292be 100755
--- a/scripts/system/vyatta_update_resolv.pl
+++ b/scripts/system/vyatta_update_resolv.pl
@@ -39,7 +39,6 @@ my @domains;
my $domain_name = undef;
if ($dhclient_script == 1) {
- $vc->{_active_dir_base} = "/opt/vyatta/config/active/";
@domains = $vc->returnOrigValues('domain-search domain');
$domain_name = $vc->returnOrigValue('domain-name');
} else {
diff --git a/scripts/vyatta-passwd-sync b/scripts/vyatta-passwd-sync
index f8c07a8f..2ad6bd2a 100755
--- a/scripts/vyatta-passwd-sync
+++ b/scripts/vyatta-passwd-sync
@@ -28,64 +28,17 @@ GetOptions(
"check" => \$check,
);
-#
-# These should move to Vyatta::Config.pm??
-#
-
-sub add_node {
- my ( $config, $level ) = @_;
- $level =~ s/\//%2F/g;
- $level =~ s/\s+/\//g;
-
- my $path =
- $config->{_new_config_dir_base}
- . $config->{_current_dir_level} . '/'
- . $level;
- if ( !-d $path ) {
- mkdir $path or die "Can't make directory $path : $!\n";
- }
-}
-
-sub set_node {
- my ( $config, $level, $val ) = @_;
- $level =~ s/\//%2F/g;
- $level =~ s/\s+/\//g;
- my $path =
- $config->{_new_config_dir_base}
- . $config->{_current_dir_level} . '/'
- . $level;
-
- if ( !-d $path ) {
- system("mkdir -p $path");
- }
-
- my $fname = $path . '/node.val';
-
- open my $output, '>', $fname
- or die "Can't open $fname: $!\n";
- print $output "$val\n";
- close $output;
-}
-
-sub delete_node {
- my ( $config, $level ) = @_;
- $level =~ s/\//%2F/g;
- $level =~ s/\s+/\//g;
- my $path =
- $config->{_new_config_dir_base}
- . $config->{_current_dir_level} . '/'
- . $level;
- if ( -d $path ) {
- system("rm -fr $path");
- }
+sub set_user_attr {
+ my $user = shift;
+ system('/opt/vyatta/sbin/my_set', 'system', 'login', 'user', $user, @_);
}
my $members;
( undef, undef, undef, $members ) = getgrnam('operator');
-my @operators = split( / /, $members );
+my @operators = split(/ /, $members );
( undef, undef, undef, $members ) = getgrnam('vyattacfg');
-my @admins = split( / /, $members );
+my @admins = split(/ /, $members );
sub get_user_level {
my $name = shift;
@@ -231,7 +184,7 @@ sub resync_config {
if ( !defined $existing ) {
if ($force) {
print "Adding $user\n" if ($verbose);
- add_node( $config, $user );
+ # user will be added in later "set" operations.
}
else {
print "user: $user does not exist in vyatta config\n";
@@ -253,12 +206,12 @@ sub resync_config {
}
if ( $comment ne '' ) {
- set_node( $config, "$user full-name", $comment );
+ set_user_attr($user, 'full-name', $comment);
}
- set_node( $config, "$user authentication encrypted-password", $passwd );
- set_node( $config, "$user level", $level );
- set_node( $config, "$user home-directory", $home );
+ set_user_attr($user, 'authentication', 'encrypted-password', $passwd);
+ set_user_attr($user, 'level', $level);
+ set_user_attr($user, 'home-directory', $home);
}
}