Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/common.h
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-12-18 23:53:21 +0100
committerArthur de Jong <arthur@arthurdejong.org>2013-12-18 23:55:03 +0100
commit9f0285333e122c625c6055c3aebebc30f25b8702 (patch)
treeee5e634896b825d5633a521370f31fd967a5f432 /nslcd/common.h
parent23a41ce888caaea871bf3c20c83136e3f6002f2a (diff)
Centralise buffer sizes
Common buffer sizes are now stored centrally so it can be easily and consistently updated if required. Some buffers remain with locally defined sizes that do not match a global buffer size.
Diffstat (limited to 'nslcd/common.h')
-rw-r--r--nslcd/common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/nslcd/common.h b/nslcd/common.h
index 393f695..cfc51eb 100644
--- a/nslcd/common.h
+++ b/nslcd/common.h
@@ -159,6 +159,17 @@ void invalidator_do(enum ldap_map_selector map);
#endif /* _POSIX_HOST_NAME_MAX */
#endif /* not HOST_NAME_MAX */
+/* common buffer lengths */
+#define BUFLEN_NAME 256 /* user, group names and such */
+#define BUFLEN_SAFENAME 300 /* escaped name */
+#define BUFLEN_PASSWORD 64 /* passwords */
+#define BUFLEN_PASSWORDHASH 256 /* passwords hashes */
+#define BUFLEN_DN 256 /* distinguished names */
+#define BUFLEN_SAFEDN 300 /* escapedd dn */
+#define BUFLEN_FILTER 4096 /* search filters */
+#define BUFLEN_HOSTNAME (HOST_NAME_MAX + 1) /* host names (+ escaped) */
+#define BUFLEN_MESSAGE 1024 /* message strings */
+
/* provide strtouid() function alias */
#if SIZEOF_UID_T == SIZEOF_UNSIGNED_LONG_INT
#define strtouid (uid_t)strtoul