diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-07-30 18:11:43 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-07-30 18:11:43 -0700 |
commit | 1c8946a09d1a15a5422177ac4bac4fa4180e0554 (patch) | |
tree | 6d40b7adf40894d8da18614b09aff6d5f9e518df | |
parent | 67718223cb935df4805fa78dc1e92e4a6f8fc2f4 (diff) | |
download | vyatta-cfg-system-1c8946a09d1a15a5422177ac4bac4fa4180e0554.tar.gz vyatta-cfg-system-1c8946a09d1a15a5422177ac4bac4fa4180e0554.zip |
add comments and missing function
-rwxr-xr-x | scripts/vyatta-passwd-sync | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/scripts/vyatta-passwd-sync b/scripts/vyatta-passwd-sync index 2ad6bd2a..4a9127e8 100755 --- a/scripts/vyatta-passwd-sync +++ b/scripts/vyatta-passwd-sync @@ -28,11 +28,27 @@ GetOptions( "check" => \$check, ); +# NOTE: the directory manipulations were changed to simply using "my_set" +# and "my_delete" since the new CLI library no longer expose the +# filesystem directories/paths. this should provide the same +# functionality as the original script, so the original limitations +# still apply: +# 1. the script is supposed to be run manually in config mode. +# 2. when necessary (given the configurations and options), the +# script adds/modifies users in the "working config" (errors +# not checked). +# 3. after running this script, a "commit" will need to be issued +# before any changes will take effect. sub set_user_attr { my $user = shift; system('/opt/vyatta/sbin/my_set', 'system', 'login', 'user', $user, @_); } +sub del_user { + my $user = shift; + system('/opt/vyatta/sbin/my_delete', 'system', 'login', 'user', $user); +} + my $members; ( undef, undef, undef, $members ) = getgrnam('operator'); my @operators = split(/ /, $members ); @@ -164,7 +180,7 @@ sub resync_config { if ( !defined $system_users{$user} ) { if ($force) { print "Deleting user: $user\n" if ($verbose); - del_node( $config, $user ); + del_user($user); } else { print "user: $user does not exist in passwd file\n"; |