|
|
@ -10,7 +10,6 @@ from __future__ import print_function
|
|
|
|
import hashlib
|
|
|
|
import hashlib
|
|
|
|
import io
|
|
|
|
import io
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import spwd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import mitogen.core
|
|
|
|
import mitogen.core
|
|
|
|
import mitogen.master
|
|
|
|
import mitogen.master
|
|
|
@ -57,21 +56,6 @@ def streamy_download_file(context, path):
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_password_hash(username):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
Fetch a user's password hash.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
h = spwd.getspnam(username)
|
|
|
|
|
|
|
|
except KeyError:
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# mitogen.core.Secret() is a Unicode subclass with a repr() that hides the
|
|
|
|
|
|
|
|
# secret data. This keeps secret stuff out of logs. Like blobs, secrets can
|
|
|
|
|
|
|
|
# also be serialized.
|
|
|
|
|
|
|
|
return mitogen.core.Secret(h)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def md5sum(path):
|
|
|
|
def md5sum(path):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Return the MD5 checksum for a file.
|
|
|
|
Return the MD5 checksum for a file.
|
|
|
|