summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>2019-02-25 20:50:48 +0100
committerTomáš Mráz <t8m@users.noreply.github.com>2019-02-26 10:06:07 +0100
commitb136bff25e93be6f11de74aca03569022364b973 (patch)
treea9980cab20bbb0095762e6da23e721fdfc8076f7 /modules
parent6fadf6b0ea489abc47003076263fc7465325f788 (diff)
pam_tally2: Remove unnecessary fsync()
pam_tally2 does fsync() after writing to a tally file. This causes hard drive cache flushes on every failed SSH login on many (if not most) filesystems. And an internet-exposed machine can have a lot of these failed logins. This operation however doesn't seem to be necessary - the pam_tally2 module does not do any operation which would need explicit post-crash ordering, it just does simple file reads and writes. And doing a fsync() after them doesn't close any race if the system happens to crash between a write being posted and its fsync() completion. Let's remove this operation to get rid of all these extra cache flushes.
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_tally2/pam_tally2.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/modules/pam_tally2/pam_tally2.c b/modules/pam_tally2/pam_tally2.c
index 984edf6a..ce7f5aee 100644
--- a/modules/pam_tally2/pam_tally2.c
+++ b/modules/pam_tally2/pam_tally2.c
@@ -484,10 +484,6 @@ set_tally(pam_handle_t *pamh, uid_t uid,
}
}
- if (fsync(*tfile)) {
- pam_syslog(pamh, LOG_ALERT, "update (fsync) failed for %s: %m", filename);
- return PAM_AUTH_ERR;
- }
return PAM_SUCCESS;
}