From 458b8e289ad6fb5df0a44c5a119ef9bda8861604 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 7 May 2010 21:25:05 +0000 Subject: tune some buffer sizes and small cleanups git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1087 ef36b2f9-881f-0410-afb5-c4e39611909c --- nslcd/group.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'nslcd/group.c') diff --git a/nslcd/group.c b/nslcd/group.c index 35522f6..14f7251 100644 --- a/nslcd/group.c +++ b/nslcd/group.c @@ -5,7 +5,7 @@ Copyright (C) 1997-2006 Luke Howard Copyright (C) 2006 West Consulting - Copyright (C) 2006, 2007, 2008, 2009 Arthur de Jong + Copyright (C) 2006, 2007, 2008, 2009, 2010 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -80,7 +80,7 @@ static const char *group_attrs[6]; static int mkfilter_group_byname(const char *name, char *buffer,size_t buflen) { - char safename[1024]; + char safename[300]; /* escape attribute */ if(myldap_escape(name,safename,sizeof(safename))) return -1; @@ -108,15 +108,14 @@ static int mkfilter_group_bymember(MYLDAP_SESSION *session, const char *uid, char *buffer,size_t buflen) { - char buf[80],*dn; - char safeuid[80]; - char safedn[1024]; + char dn[256]; + char safeuid[300]; + char safedn[300]; /* escape attribute */ if(myldap_escape(uid,safeuid,sizeof(safeuid))) return -1; /* try to translate uid to DN */ - dn=uid2dn(session,uid,buf,sizeof(buf)); - if (dn==NULL) + if (uid2dn(session,uid,dn,sizeof(dn))==NULL) return mysnprintf(buffer,buflen, "(&%s(%s=%s))", group_filter, -- cgit v1.2.3