Commit Graph

44 Commits

Author SHA1 Message Date
6f63beb1fc pam: Add str_has_prefix() helper
To simplify the options parsing.
2020-01-23 18:45:43 +01:00
f7557c6ee7 pam: Add monotonic clock helper 2020-01-23 18:45:43 +01:00
c6e72c5f28 pam: Add include for asprintf to copy/paste header 2020-01-23 18:45:43 +01:00
986a42bcd1 pam: Update copyright notice 2020-01-23 18:45:43 +01:00
d0df422f9b all: Bump required glib version
Require the same version of glib as libfprint, and remove support for
very old versions.
2019-12-18 17:03:37 +01:00
96444b4156 pam: Fix rhost string length check 2019-08-13 14:16:32 +02:00
8f90390c6b pam: Fix rhost check when rhost is unavailable
Don't exit early if the rhost field isn't filled in, as it usually isn't
for a lot of services.

Fixes: 3274a31
2019-08-08 12:31:32 +02:00
3274a31153 pam: Don't ask for fingerprints for remote logins
As written in the "Linux-PAM Application Developers' Guide"
at http://www.linux-pam.org/Linux-PAM-html/adg-security-user-identity.html:
"
As a general rule, the following convention for its value can be
assumed: NULL = unknown; localhost = invoked directly from the
local system; other.place.xyz = some component of the user's
connection originates from this remote/requesting host.
"

So also exit early if the hostname isn't localhost as it should be.

Closes: #21
2019-08-07 14:12:53 +00:00
51f4dce4e7 pam: Fix typo in occurred 2018-11-09 07:41:42 +01:00
051eb0427d pam: Don't poke the hardware if user has no registered prints
Before claiming the device and therefore potentially activating
the actual hardware, make a call to see if the user has any
prints registered at all.

https://bugs.freedesktop.org/show_bug.cgi?id=99811
2017-02-16 14:49:58 +01:00
f54a90ea80 pam: separate device opening and claiming
For some operations, i.e. listing the enrolled prints, the device
does not need to be claimed. Therefore the claiming can be delayed
until we actually start the verification process, allowing us to
query the fingerprint system if the user has any prints enrolled.

https://bugs.freedesktop.org/show_bug.cgi?id=99811
2017-02-16 14:46:35 +01:00
da87d1d7ee pam: Only call g_type_init when using an old glib
Calling g_type_init() is not needed anymore and deprecated since
glib version 2.36.

https://bugs.freedesktop.org/show_bug.cgi?id=99812
2017-02-14 17:14:20 +01:00
7e4630ced2 pam: Fix eventfd leak
When we create our own GMainContext, we need to be the ones
disposing of it as well, as GMainLoop won't take ownership of it.

From https://bugzilla.redhat.com/show_bug.cgi?id=1050827
2014-01-27 12:25:57 +01:00
b4f5304565 pam: return PAM_UNKNOWN_USER when user is unenrolled
This commit makes pam_fprintd return PAM_UNKNOWN_USER when
the user has not enrolled a fingerprint.

This lets the administrator set up pam_fprintd as a required
authentication, method, but only for users that have enrolled a
fingerprint, as such:

auth  [success=ok user_unknown=ignore default=die] pam_fprintd.so max_tries=1 timeout=-1
auth  [success=1  default=ignore]                  pam_unix.so nullok_secure
auth  requisite                                    pam_deny.so

With this config, users w/o an enrolled fingerprint will just be
asked for a password.  Users with an enrolled fingerprint will
required to login using both their fingerprint and a password.

https://bugs.freedesktop.org/show_bug.cgi?id=64781
2013-06-03 08:56:22 -04:00
9c99e5cd59 pam: Make max_tries and timeout arguments.
https://bugs.freedesktop.org/show_bug.cgi?id=49918
2013-03-26 12:45:58 +01:00
73edad087f pam: Avoid segfault on login without devices
Avoid crashing if paths_array is NULL.

https://bugs.freedesktop.org/show_bug.cgi?id=49904
2012-05-14 15:09:25 +01:00
4c120e487b pam: Fix crash when enumerating the devices
We don't need to free this by hand, it'll get freed when
we free the array itself.
2012-02-07 21:43:28 +00:00
cde767cbc9 pam: Don't get a list of devices twice
GetDefaultDevice just gives you the first device in the list.
Use that fact to check for > 1 device, and get the default device
in one swoop.
2012-02-01 19:53:26 +00:00
d77b59cd36 pam: don't use device name if there is only one reader 2012-02-01 19:41:58 +00:00
749b6ca31c Fix redefinition warning in pam_fprintd 2010-09-11 14:58:29 +01:00
ebd97c70ff Translate the messages from pam_fprintd
Using our new fangled translations
2010-09-11 14:56:57 +01:00
731b22d368 0.2.0
Fix a missing brace in main.c, fix distchecking.
2010-08-19 16:01:23 +01:00
7544102f2e Fix screensaver unlock for some users
pam_fprintd is very careful to use its own main loop context (as it
should) to prevent getting in the way of the gnome-screensaver.

Unfortunately, there's a small bug in its logic where it ends up
removing a random file descriptor from the default context. In the
bug report that file descriptor is really important.  It's what
tells gnome-screensaver when to drop the dialog.

The patch is as simple as:

-   g_source_remove (timeout_id);
+   g_source_destroy (source);

(g_source_remove always operates on the default context)

https://bugzilla.redhat.com/show_bug.cgi?id=614573
2010-08-16 19:35:57 +01:00
4ea1c48f9f Detect when a device is disconnected
Pretty hacky way to detect whether the device we're handling has
been disconnected during a verify or enrollment. This should allow
us to avoid users having to wait when somebody pulls the plug.
2009-01-27 16:45:47 -03:00
04fd09cfa8 dbus + fprintd error
On Mon, 2009-01-12 at 12:18 +0000, Konstantin V. Gavrilenko wrote:
> Hi Bastien,
>
> by default the fprintd installs the pam_fprintd into the /usr/lib64/security, whil egentoo searches them in /lib/security.
> So I simply simlinked it to the correct location /usr/lib64/security/pam_fprintd.so to /lib/security/pam_fprintd.so
> I've removed the symlink, and copied the file, but it does not change anything, the same error appears.
>
> As you asked,  recompiled some of the packages with "-O1 -gddb" and  "nostrip" options.

> #4  0x00007fa3344a3899 in dbus_connection_unref (connection=0x624e20) at dbus-connection.c:2686
>         __FUNCTION__ = "dbus_connection_unref"
> #5  0x00007fa334915284 in pam_sm_authenticate (pamh=0x6105c0, flags=<value optimized out>, argc=<value optimized out>, argv=<value optimized out>) at pam_fprintd.c:375
>         rhost = 0x0
>         username = 0x610740 "root"
>         i = <value optimized out>
>         r = 0

Could you please test the attached patch?

Cheers
2009-01-24 17:10:05 -03:00
9498800f20 More cleanups
Some objects were leaked when no devices were available. Plug those
leaks.
2008-12-20 11:46:32 +00:00
9874ac4b91 Add string helper for results and fingers
Add a simple header file which can be copied to other projects
to simplify i18n of results and strings.
2008-12-10 00:54:27 +00:00
6f69aef553 Remove some dead code in PAM
verify_result_str() isn't used anymore.
2008-12-04 13:23:50 +00:00
6fc861a154 Use dbus_g_proxy_new_from_proxy
Removes the need to have the dbus connection around.
2008-11-24 17:20:45 +00:00
b4ee4a5cdd Add debug option for PAM
When the debug option is set in the PAM configuration, redirect
debug output to syslog (usually /var/log/secure).
2008-11-24 17:19:08 +00:00
2b71776124 Fix GetAll properties call
The error wasn't properly initialised, but wasn't used anyway, and
we were missing the interface argument.
2008-11-22 13:01:16 +00:00
c9fdeb47aa Use D-Bus properties instead of GetProperties
- Use D-Bus native properties instead of a GetProperties call.
- Fix a number of front-ends by registering the right signals and
marshallers following the "done" signal argument addition
- Fix VerifyStart call in the pam module
2008-11-22 13:00:48 +00:00
26aab5dc28 Add a done argument to result signals
For verify and enroll, add a done argument so that front-end
know easily when they should be closing the device.
2008-11-21 18:15:51 +00:00
0636c77962 Enumerate all the fingers for swipe and press
We need to enumerate all the fingers for swipe and press actions,
otherwise we might break break translations.
2008-11-21 18:15:51 +00:00
837627b1a7 Use scan type property for better messages
Better messages for the PAM plugin, by using whether the device
requires swiping or pressing the finger on the reader.
2008-11-21 18:15:51 +00:00
874d8164b4 Add ScanType and NumberEnrollStages properties
Export the type of scan the device performs, and, when the device
is claimed, the number of enrollment stages.
2008-11-21 18:15:50 +00:00
f7186c7ff0 Remove all uses of enums in the API
The clients aren't supposed to know the magic numbers for enums,
so use strings instead.
2008-11-21 18:15:50 +00:00
5426b1a472 Use GetDefaultDevice
As we're not using the non-default device anyway.
2008-11-21 18:15:21 +00:00
1e43720c15 Remove use of finger number in the API
Use well-defined strings instead of numbers to pass around
specific fingers in the public API.
2008-11-21 18:15:21 +00:00
924e08d2e8 Add device name property
Add GetProperties method, with a single "Name" properties into
the hashtable.
Use the device name property in the PAM module, and in the list test.
2008-11-21 18:15:21 +00:00
8bae65d50e Fix pam module running under gnome-screensaver
1) Set up our own D-Bus (private) connection
2) Set up our own main loop and main loop context

This means we finally work right within gnome-screensaver!
2008-11-18 17:07:10 +00:00
4bc8330d56 Note that pam_fprint is only temporarily here 2008-11-03 22:55:01 +00:00
6a2753eae2 And call g_type_init()
Otherwise it just won't work...
2008-11-03 22:53:46 +00:00
4fa5552650 Add PAM module
Add a PAM module, and enable all the warnings
2008-11-03 22:53:44 +00:00