Changeset 844 for server/common/oursrc


Ignore:
Timestamp:
Oct 2, 2008, 3:33:27 PM (16 years ago)
Author:
andersk
Message:
`getent passwd 2011` doesn’t work.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/common/oursrc/accountadm/vhostadd

    r833 r844  
    2020fi
    2121
    22 pw=$(getent passwd "$user")
     22pw=$(perl -e '$, = ":"; print getpwnam($ARGV[0]);' -- "$user")
    2323if [ $? -ne 0 ]; then
    2424    echo "User not found." >&2
    2525    exit $?
    2626fi
    27 IFS=: read user x uid gid x home x <<< "$pw"
     27IFS=: read user x uid gid x x x home x <<< "$pw"
    2828
    2929user_dn=$(ldapsearch -LLL -x -b ou=People,dc=scripts,dc=mit,dc=edu "(uid=$user)" dn | perl -0pe 's/\n //g; s/^dn: //')
Note: See TracChangeset for help on using the changeset viewer.