You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[tilde TODO] If a username is being registered that is also a member of /home/, do not allow the client to register it unless the logged in user matches the name
#9
Open
desvox opened this issue
Oct 11, 2017
· 6 comments
importpwd, os""'ReturnsTrueifuserexistsonsystem."""def is_user(username): try: pwd.getpwnam('someusr') return True except KeyError: return False"""Returnsusernameofuserthatownsthisprocess."""def get_username(): return pwd.getpwuid(os.getuid()).pw_name"""ReturnsTrueifusernamemayberegisteredbythisuser.
IfFalseisreturned, areasonisalsoreturned, tobeshowntotheuser."""
def validate_username(username_choice):
if is_user(username_choice):
if username_choice!=get_username():
return False,"User exists on server, and is not you."
returnTrueelse:
returnTrue
While this does not work in the API case, I'd like to remind you that in the API case, we have no way to verify the user's identity anyways (as they can lie).
No description provided.
The text was updated successfully, but these errors were encountered: