Browse Source

__user: only set password if it changed

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
1.2
Steven Armstrong 12 years ago
parent
commit
4432b476d0
  1. 27
      conf/type/__user/explorer/shadow
  2. 4
      conf/type/__user/gencode

27
conf/type/__user/explorer/shadow

@ -0,0 +1,27 @@
#!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
#
# Get an existing users shadow entry.
#
name=$__object_id
grep "^$name" /etc/shadow || true

4
conf/type/__user/gencode

@ -37,6 +37,10 @@ get_current_value() {
local key="$1"
local index
case "$key" in
password)
cut -d':' -f 2 "$__object/explorer/shadow"
break
;;
uid) index=3;;
gid) index=4;;
comment) index=5;;

Loading…
Cancel
Save