[SSSD] [PATCH] autofs: Raise the maximum key length to PATH_MAX

Jakub Hrozek jhrozek at redhat.com
Thu Apr 12 12:28:33 UTC 2012


On Thu, Apr 12, 2012 at 08:21:55AM -0400, Stephen Gallagher wrote:
> On Thu, 2012-04-12 at 14:16 +0200, Jakub Hrozek wrote:
> > When I limited the maximum key length to NAME_MAX I forgot about
> > indirect keys. Ian Kent reminded me in
> > https://bugzilla.redhat.com/show_bug.cgi?id=683523#c80 that indirect
> > keys can be full paths.
> 
> Ack

I lied in the comment, it's direct keys, not indirect. The code is the
same as the first patch. 
-------------- next part --------------
>From 5507cb0c0b7c5bfdb30c48763db1983148bd814c Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Thu, 12 Apr 2012 14:12:41 +0200
Subject: [PATCH] autofs: Raise the maximum key length to PATH_MAX

https://fedorahosted.org/sssd/ticket/1300
---
 src/sss_client/autofs/sss_autofs.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sss_client/autofs/sss_autofs.c b/src/sss_client/autofs/sss_autofs.c
index e1810466bfdda417e04882b085f4e9315480c8ad..0125e6eece3bfcc69029e6a1e300159778eb72f3 100644
--- a/src/sss_client/autofs/sss_autofs.c
+++ b/src/sss_client/autofs/sss_autofs.c
@@ -24,9 +24,11 @@
 #include "sss_client/autofs/sss_autofs_private.h"
 #include "sss_client/sss_cli.h"
 
-/* Historically, autofs map and key names were just file names */
+/* Historically, autofs map names were just file names. Direct key names
+ * may be full directory paths
+ */
 #define MAX_AUTOMNTMAPNAME_LEN  NAME_MAX
-#define MAX_AUTOMNTKEYNAME_LEN  NAME_MAX
+#define MAX_AUTOMNTKEYNAME_LEN  PATH_MAX
 
 /* How many entries shall _sss_getautomntent_r retreive at once */
 #define GETAUTOMNTENT_MAX_ENTRIES   512
-- 
1.7.7.6



More information about the sssd-devel mailing list