Revert "Use root as a default username when clients do not specify any"
This reverts commit 4f8c061f53.
This commit is contained in:
parent
4f8c061f53
commit
268008e499
1 changed files with 5 additions and 11 deletions
|
|
@ -12,8 +12,6 @@ import pwd
|
|||
|
||||
print("Starting up")
|
||||
|
||||
default_username='root'
|
||||
|
||||
loop = GLib.MainLoop()
|
||||
|
||||
usb.quit = lambda e: loop.quit()
|
||||
|
|
@ -23,7 +21,7 @@ def uname2identity(uname):
|
|||
# For some reason Gnome enrollment UI does not send the user name
|
||||
# (it also ignores our num-enroll-stages attribute). I probably should upgrade Gnome
|
||||
print('No username specified. ')
|
||||
uname = default_username
|
||||
uname = 'unicorn'
|
||||
pw=pwd.getpwnam(uname)
|
||||
sidstr='S-1-5-21-111111111-1111111111-1111111111-%d' % pw.pw_uid
|
||||
return sid_from_string(sidstr)
|
||||
|
|
@ -41,12 +39,10 @@ class Device():
|
|||
|
||||
def Claim(self, usr):
|
||||
print('In Claim %s' % usr)
|
||||
self.claim_user = usr
|
||||
|
||||
def Release(self):
|
||||
print('In Release')
|
||||
self.caimed = False
|
||||
self.claim_user = None
|
||||
|
||||
def ListEnrolledFingers(self, usr):
|
||||
try:
|
||||
|
|
@ -99,13 +95,11 @@ class Device():
|
|||
|
||||
db.del_record(usr.dbid)
|
||||
|
||||
def do_enroll(self, finger_name, user):
|
||||
def do_enroll(self, finger_name):
|
||||
# it is pointless to try and remember username passed in claim as Gnome does not seem to be passing anything useful anyway
|
||||
try:
|
||||
if not user:
|
||||
print('Warning: Username was not passed, using a hardcoded username "%s"' % user)
|
||||
# TODO Convert fingername to WINBIO finger id e.g 0xf5
|
||||
z=enroll(uname2identity(user), 0xf5)
|
||||
# hardcode the username and finger for now
|
||||
z=enroll(uname2identity('unicorn'), 0xf5)
|
||||
print('Enroll was successfull')
|
||||
self.EnrollStatus('enroll-completed', True)
|
||||
except Exception as e:
|
||||
|
|
@ -115,7 +109,7 @@ class Device():
|
|||
|
||||
def EnrollStart(self, finger_name):
|
||||
print('In EnrollStart %s' % finger_name)
|
||||
Thread(target=lambda: self.do_enroll(finger_name, self.claim_user)).start()
|
||||
Thread(target=lambda: self.do_enroll(finger_name)).start()
|
||||
|
||||
|
||||
def EnrollStop(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue