From 5195b668cdf00c8ae03b182fde24e1ddaa082995 Mon Sep 17 00:00:00 2001
From: scientes <instigatorirc@gmail.com>
Date: Sun, 21 Dec 2008 07:45:30 -0800
Subject: [PATCH] if no auth file checks if that user has log in capabilities against pam on server machine
requires gem at http://atlee.ca/software/pam/
---
deluge/core/authmanager.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/deluge/core/authmanager.py b/deluge/core/authmanager.py
index 6b6347e..1b4eeb7 100644
a
|
b
|
|
25 | 25 | import os.path |
26 | 26 | import random |
27 | 27 | import stat |
| 28 | from pam import authenticate as pam_authenticate |
28 | 29 | |
29 | 30 | import deluge.component as component |
30 | 31 | import deluge.configmanager as configmanager |
… |
… |
class AuthManager(component.Component):
|
58 | 59 | # Let's try to re-load the file.. Maybe it's been updated |
59 | 60 | self.__load_auth_file() |
60 | 61 | if username not in self.auth: |
61 | | return False |
| 62 | if username == os.getlogin(): |
| 63 | if pam_authenticate(os.getlogin(), password, service='login'): |
| 64 | return True |
| 65 | else: |
| 66 | return False |
62 | 67 | |
63 | 68 | if self.auth[username] == password: |
64 | 69 | return True |