]>
Commit | Line | Data |
---|---|---|
3d551623 PG |
1 | diff --git a/CHANGELOG b/CHANGELOG |
2 | index 9312ad5..6379d18 100644 | |
3 | --- a/CHANGELOG | |
4 | +++ b/CHANGELOG | |
5 | @@ -47,6 +47,7 @@ | |
6 | - fix for dynamic logging breaking non-sasl build (Guillaume Rousse) | |
7 | - eliminate NULL proc ping for singleton host or local mounts. | |
8 | - fix incorrect read/write size of startup status token (Matthias Koenig). | |
9 | +- fix off-by-one error for lookup of map keys exactly 255 characters long. | |
10 | ||
11 | 18/06/2007 autofs-5.0.2 | |
12 | ----------------------- | |
13 | diff --git a/modules/lookup_file.c b/modules/lookup_file.c | |
14 | index 23ea07d..550bf5c 100644 | |
15 | --- a/modules/lookup_file.c | |
16 | +++ b/modules/lookup_file.c | |
17 | @@ -1047,7 +1047,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | |
18 | ||
19 | debug(ap->logopt, MODPREFIX "looking up %s", name); | |
20 | ||
21 | - key_len = snprintf(key, KEY_MAX_LEN, "%s", name); | |
22 | + key_len = snprintf(key, KEY_MAX_LEN + 1, "%s", name); | |
23 | if (key_len > KEY_MAX_LEN) | |
24 | return NSS_STATUS_NOTFOUND; | |
25 | ||
26 | diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c | |
27 | index 93a1b40..b8484a2 100644 | |
28 | --- a/modules/lookup_ldap.c | |
29 | +++ b/modules/lookup_ldap.c | |
30 | @@ -2053,7 +2053,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | |
31 | ||
32 | debug(ap->logopt, MODPREFIX "looking up %s", name); | |
33 | ||
34 | - key_len = snprintf(key, KEY_MAX_LEN, "%s", name); | |
35 | + key_len = snprintf(key, KEY_MAX_LEN + 1, "%s", name); | |
36 | if (key_len > KEY_MAX_LEN) | |
37 | return NSS_STATUS_NOTFOUND; | |
38 | ||
39 | diff --git a/modules/lookup_nisplus.c b/modules/lookup_nisplus.c | |
40 | index bb1ca42..fee8b16 100644 | |
41 | --- a/modules/lookup_nisplus.c | |
42 | +++ b/modules/lookup_nisplus.c | |
43 | @@ -476,7 +476,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | |
44 | ||
45 | debug(ap->logopt, MODPREFIX "looking up %s", name); | |
46 | ||
47 | - key_len = snprintf(key, KEY_MAX_LEN, "%s", name); | |
48 | + key_len = snprintf(key, KEY_MAX_LEN + 1, "%s", name); | |
49 | if (key_len > KEY_MAX_LEN) | |
50 | return NSS_STATUS_NOTFOUND; | |
51 | ||
52 | diff --git a/modules/lookup_yp.c b/modules/lookup_yp.c | |
53 | index e8ca8e8..5f4f95f 100644 | |
54 | --- a/modules/lookup_yp.c | |
55 | +++ b/modules/lookup_yp.c | |
56 | @@ -567,7 +567,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | |
57 | ||
58 | debug(ap->logopt, MODPREFIX "looking up %s", name); | |
59 | ||
60 | - key_len = snprintf(key, KEY_MAX_LEN, "%s", name); | |
61 | + key_len = snprintf(key, KEY_MAX_LEN + 1, "%s", name); | |
62 | if (key_len > KEY_MAX_LEN) | |
63 | return NSS_STATUS_NOTFOUND; | |
64 |