|
Ian Kent |
62ad96 |
autofs-5.0.3 - nisplus partial and free
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
From: Jeff Bastian <jbastian@redhat.com>
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
During a nisplus key lookup nis_list() can return NIS_PARTIAL
|
|
Ian Kent |
62ad96 |
as well as possibly NIS_NOTFOUND or NIS_S_NOTFOUND when the key
|
|
Ian Kent |
62ad96 |
doesn't exist. This patch adds this to the checks and fixes a use
|
|
Ian Kent |
62ad96 |
after free of the result struct.
|
|
Ian Kent |
62ad96 |
---
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
modules/lookup_nisplus.c | 16 ++++++++++------
|
|
Ian Kent |
62ad96 |
1 file changed, 10 insertions(+), 6 deletions(-)
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
--- autofs-5.0.3.orig/modules/lookup_nisplus.c
|
|
Ian Kent |
62ad96 |
+++ autofs-5.0.3/modules/lookup_nisplus.c
|
|
Ian Kent |
62ad96 |
@@ -285,13 +285,15 @@ static int lookup_one(struct autofs_poin
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
result = nis_list(tablename, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
|
|
Ian Kent |
62ad96 |
if (result->status != NIS_SUCCESS && result->status != NIS_S_SUCCESS) {
|
|
Ian Kent |
62ad96 |
+ nis_error rs = result->status;
|
|
Ian Kent |
62ad96 |
nis_freeresult(result);
|
|
Ian Kent |
62ad96 |
pthread_setcancelstate(cur_state, NULL);
|
|
Ian Kent |
62ad96 |
- if (result->status == NIS_NOTFOUND ||
|
|
Ian Kent |
62ad96 |
- result->status == NIS_S_NOTFOUND)
|
|
Ian Kent |
62ad96 |
+ if (rs == NIS_NOTFOUND ||
|
|
Ian Kent |
62ad96 |
+ rs == NIS_S_NOTFOUND ||
|
|
Ian Kent |
62ad96 |
+ rs == NIS_PARTIAL)
|
|
Ian Kent |
62ad96 |
return CHE_MISSING;
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
- return -result->status;
|
|
Ian Kent |
62ad96 |
+ return -rs;
|
|
Ian Kent |
62ad96 |
}
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
@@ -338,13 +340,15 @@ static int lookup_wild(struct autofs_poi
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
result = nis_list(tablename, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
|
|
Ian Kent |
62ad96 |
if (result->status != NIS_SUCCESS && result->status != NIS_S_SUCCESS) {
|
|
Ian Kent |
62ad96 |
+ nis_error rs = result->status;
|
|
Ian Kent |
62ad96 |
nis_freeresult(result);
|
|
Ian Kent |
62ad96 |
pthread_setcancelstate(cur_state, NULL);
|
|
Ian Kent |
62ad96 |
- if (result->status == NIS_NOTFOUND ||
|
|
Ian Kent |
62ad96 |
- result->status == NIS_S_NOTFOUND)
|
|
Ian Kent |
62ad96 |
+ if (rs == NIS_NOTFOUND ||
|
|
Ian Kent |
62ad96 |
+ rs == NIS_S_NOTFOUND ||
|
|
Ian Kent |
62ad96 |
+ rs == NIS_PARTIAL)
|
|
Ian Kent |
62ad96 |
return CHE_MISSING;
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
- return -result->status;
|
|
Ian Kent |
62ad96 |
+ return -rs;
|
|
Ian Kent |
62ad96 |
}
|
|
Ian Kent |
62ad96 |
|
|
Ian Kent |
62ad96 |
this = NIS_RES_OBJECT(result);
|