Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added locking mechanism #24

Open
GoogleCodeExporter opened this issue Sep 2, 2015 · 0 comments
Open

Added locking mechanism #24

GoogleCodeExporter opened this issue Sep 2, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

~/.pppauth/lock is used for locking whole directory.

When users logs in pam-ppp tries to lock this file for at most 0.014s (20
trials every 700us). Normally this file shouldn't be locked this long, so
if it can't lock it, it assumes something went wrong (something locked, and
then died in a funny manner), but the user is prompted for the password
nevertheless, although the prompt gets "(no lock)" prefix to tell user that
something is bad.

If the file is normally locked (which should happen all the time) keys are
read, incremented and saved back. Then the lock is released. This should
remove the race-condition with two parallel ssh sessions.

As usual patch attached; the repos:
http://thera.be/my_public/my_projects/ppp-pam.git/
Has all changes so far and I can merge it upstream if given r/w access to svn.

Source with changes:
http://xn--tp-fna.thera.be/ppp-pam/ppp-pam-0.2.3.tar.bz2

Checked more/less to work on x86 and x86_64; tried also to lock the file is
artificial way, and it worked as it should. Nevertheless do your checks. ;d

Question: shouldn't we check if memory is correctly allocated in pam module?

Original issue reported on code.google.com by TomaszFo...@gmail.com on 8 Nov 2009 at 7:14

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant