From ee1b77e264df413f18145415f838bdd11913b9fe Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 1 Jul 1998 06:34:39 +0000 Subject: [PATCH] lilypond-1.0.1 --- stepmake/bin/ntpwd.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 stepmake/bin/ntpwd.py diff --git a/stepmake/bin/ntpwd.py b/stepmake/bin/ntpwd.py new file mode 100644 index 0000000000..a656a8dc4f --- /dev/null +++ b/stepmake/bin/ntpwd.py @@ -0,0 +1,29 @@ +"""Winnt access into /etc/passwd via account name""" + +import sys +import string + +def getpwname( name, pwfile='/etc/passwd' ): + "Get password record that matches the specified name" + try: + _fd = open( pwfile, 'r' ) + except: + sys.stderr.write("Error unable to locate" + pwfile + "\n") + sys.stderr.write("Consult gnu-win32 command mkpasswd\n") + sys.exit(1) + + _data = _fd.read() + _fd.close() + + for _line in string.split(_data, '\n'): + _record=string.split( _line, ':' ); + if _record[0] == name: + return _record + return () + +def _test(): + pw = getpwname( 'jeff' ) + print pw[4] + +if __name__ == '__main__': + _test() -- 2.39.5