aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
Commit message (Expand)AuthorAgeFilesLines
* gpio-button-hotplug: remove duplicate logging textPetr Štetiar2020-03-081-3/+3
* gpio-button-hotplug: add volume button handlingChuanhong Guo2019-08-081-0/+2
* gpio-button-hotplug: unify polled and interrupt codeDavid Bauer2019-07-141-65/+76
* gpio-button-hotplug: fix 4.19 build breakage on malta/be64Petr Štetiar2019-06-171-0/+1
* gpio-button-hotplug: gpio-keys: fix always missing first eventPetr Štetiar2019-06-091-9/+2
* gpio-button-hotplug: fix wrong initial seen valuePetr Štetiar2019-06-091-0/+3
* gpio-button-hotplug: use pr_debug and pr_errPetr Štetiar2019-06-091-17/+6
* gpio-button-hotplug: support interrupt propertiesChristian Lamparter2019-05-311-21/+93
* gpio-button-hotplug: add KEY_POWER2 handlingAlan Swanson2019-05-301-0/+1
* gpio-button-hotplug: leave platform_device.dev.platform_data untouchedFurong Xu2017-08-211-2/+1
* gpio-button-hotplug: add more buttonsMathias Kresin2016-11-271-15/+24
* treewide: replace nbd@openwrt.org with nbd@nbd.nameFelix Fietkau2016-06-071-3/+3
* kernel: gpio-button-hotplug: Add missing ONESHOT flag to threaded IRQ requestJohn Crispin2016-03-031-1/+1
* kernel: gpio-button-hotplug: update to use threaded irq'sJohn Crispin2016-02-121-8/+5
* gpio-button-hotplug: handle EPROBE_DEFER and other errorsHauke Mehrtens2015-07-261-5/+15
* gpio-button-hotplug: remove #ifdef CONFIG_HOTPLUG, it is gone in newer kernel...Felix Fietkau2014-05-231-7/+0
* gpio-button-hotplug: add wwan buttonHauke Mehrtens2014-01-141-0/+1
* gpio-button-hotplug: fix crash on removeJonas Gorski2013-12-171-1/+1
* gpio-button-hotplug: add irq mode to driverJohn Crispin2013-12-091-94/+176
* gpio-button-hotplug: add support for sliding switchesJohn Crispin2013-11-111-12/+8
* gpio-button-hotplug: add support for power buttonsJohn Crispin2013-10-281-0/+1
* gpio-button-hotplug: debounce the initial button state, the first reads at bo...Felix Fietkau2013-08-051-2/+4
* gpio-button-hotplug: cleanup, fix compiler warningFelix Fietkau2013-08-031-4/+2
* gpio-button-hotplug: fix active_low handling, possibly broken in r37643Felix Fietkau2013-08-031-8/+9
* gpio-button-hotplug: use gpio_button_get_value() to initialize last_state.John Crispin2013-08-011-1/+1
* gpio-button-hotplug: use gpio_button_get_value() to fetch state.John Crispin2013-08-011-4/+1
* gpio-button-hotplug: add inline function gpio_button_get_value().John Crispin2013-08-011-0/+9
* gpio-button-hotplug: add support for EV_SWLuka Perkov2013-07-021-7/+21
* gpio-button-hotplug: improve gpio button debouncing, verify state changes ove...Felix Fietkau2013-06-291-6/+8
* packages: clean up the package folderJohn Crispin2013-06-211-0/+564
d"> @rtype: string @return: Session UUID """ if self.is_authorized(username, password): return self.login_unconditionally(username) raise XendError("Login failed") def logout(self, session): """Delete session of it exists.""" if self.is_session_valid(session): del self.sessions[session] def is_session_valid(self, session): """Returns true is session is valid.""" if type(session) == type(str()): return (session in self.sessions) return False def is_authorized(self, username, password): """Returns true is a user is authorised via PAM. Note: We use the 'login' PAM stack rather than inventing our own. @rtype: boolean """ pam_auth = None try: pam_auth = PAM.pam() except NameError: # if PAM doesn't exist, let's ignore it return False pam_auth.start("login") pam_auth.set_item(PAM.PAM_USER, username) def _pam_conv(auth, query_list, user_data): resp = [] for i in range(len(query_list)): query, qtype = query_list[i] if qtype == PAM.PAM_PROMPT_ECHO_ON: resp.append((username, 0)) elif qtype == PAM.PAM_PROMPT_ECHO_OFF: resp.append((password, 0)) else: return None return resp pam_auth.set_item(PAM.PAM_CONV, _pam_conv) try: pam_auth.authenticate() pam_auth.acct_mgmt() except PAM.error, resp: return False except Exception, e: log.warn("Error with PAM: %s" % str(e)) return False else: return True def get_user(self, session): try: return self.sessions[session][0] except (KeyError, IndexError): return None def instance(): """Singleton constructor. Use this instead of the class constructor. """ global inst try: inst except: inst = XendAuthSessions() inst.init() return inst