Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 160207 Details for
Bug 248782
pam_abl seems to do nothing, PAM breakage?
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to get pam_abl working again
pam_abl-0.2.3-morefixes.patch (text/plain), 3.79 KB, created by
Sjoerd Mullender
on 2007-07-29 21:39:38 UTC
(
hide
)
Description:
patch to get pam_abl working again
Filename:
MIME Type:
Creator:
Sjoerd Mullender
Created:
2007-07-29 21:39:38 UTC
Size:
3.79 KB
patch
obsolete
>--- pam_abl.c- 2007-07-29 23:19:24.000000000 +0200 >+++ pam_abl.c 2007-07-29 23:20:59.000000000 +0200 >@@ -87,7 +87,7 @@ > > /* Log a login attempt > */ >-static int record(const abl_args *args, const char *dbname, const char *kv, time_t tm, long maxage) { >+static int record(const abl_args *args, const char *dbname, const char *kv, time_t tm, long maxage, int success) { > DB *db; > int err, err2; > DBT key, data; >@@ -136,12 +136,16 @@ > data.size = 0; > } > >- if (err = grow_buffer(args, &data, data.size + sizeof(time_t)), 0 != err) { >- goto fail2; >- } >+ if (success) { >+ data.data = realloc(data.data, data.size -= sizeof(time_t)); >+ } else { >+ if (err = grow_buffer(args, &data, data.size + sizeof(time_t)), 0 != err) { >+ goto fail2; >+ } > >- memcpy((char *) data.data + data.size, &tm, sizeof(time_t)); >- data.size += sizeof(time_t); >+ memcpy((char *) data.data + data.size, &tm, sizeof(time_t)); >+ data.size += sizeof(time_t); >+ } > > if (err = db->put(db, NULL, &key, &data, 0), 0 != err) { > log_sys_error(args, err, "updating database"); >@@ -163,7 +167,7 @@ > return err; > } > >-static int record_host(const abl_args *args, time_t tm) { >+static int record_host(const abl_args *args, time_t tm, int success) { > if (NULL != args->host_db) { > const char *rhost; > int err; >@@ -173,7 +177,7 @@ > return err; > } > if (NULL != rhost) { >- return record(args, args->host_db, rhost, tm, args->host_purge); >+ return record(args, args->host_db, rhost, tm, args->host_purge, success); > } else { > log_debug(args, "PAM_RHOST is NULL"); > return 0; >@@ -183,7 +187,7 @@ > } > } > >-static int record_user(const abl_args *args, time_t tm) { >+static int record_user(const abl_args *args, time_t tm, int success) { > if (NULL != args->user_db) { > const char *user; > int err; >@@ -192,7 +196,7 @@ > return err; > } > if (NULL != user) { >- return record(args, args->user_db, user, tm, args->user_purge); >+ return record(args, args->user_db, user, tm, args->user_purge, success); > } else { > log_debug(args, "PAM_USER is NULL"); > return 0; >@@ -202,17 +206,17 @@ > } > } > >-static int record_attempt(const abl_args *args) { >+static int record_attempt(const abl_args *args, int success) { > int err; > time_t tm = time(NULL); > > log_debug(args, "Recording failed attempt"); > >- if (err = record_host(args, tm), 0 != err) { >+ if (err = record_host(args, tm, success), 0 != err) { > return err; > } > >- if (err = record_user(args, tm), 0 != err) { >+ if (err = record_user(args, tm, success), 0 != err) { > return err; > } > >@@ -340,13 +344,11 @@ > } > > static void cleanup(pam_handle_t *pamh, void *data, int err) { >+ log_debug((abl_args *) data, "Cleaning up, err is %08x", err); > if (NULL != data) { > abl_args *args = data; > log_debug(args, "In cleanup, err is %08x", err); > >- if (err && (err & PAM_DATA_REPLACE) == 0) { >- record_attempt(args); >- } > config_free(args); > free(args); > } >@@ -372,6 +374,7 @@ > } > > check_attempt(args, &rv); >+ record_attempt(args, 0); > if (rv) { > const char *rhost, *user, *service; > if (PAM_SUCCESS == pam_get_item(args->pamh, PAM_RHOST, (const void **) (const void*) &rhost ) && >@@ -392,6 +395,9 @@ > } > > PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv) { >+ void *data; >+ if (pam_get_data(pamh, DATA_NAME, &data) == PAM_SUCCESS && data) >+ record_attempt((abl_args *) data, 1); > return pam_set_data(pamh, DATA_NAME, NULL, cleanup); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 248782
:
160207
|
160265