s3:smbd: use PATH_MAX for the buffer passed to full_path_tos()
authorStefan Metzmacher <metze@samba.org>
Sat, 14 Dec 2013 09:45:42 +0000 (10:45 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 14 Dec 2013 15:24:34 +0000 (16:24 +0100)
We use this in other places too and it's better than a hardcoded value.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/files.c
source3/smbd/notify.c

index ba24eda27f3d555b99cfa91df6617bef0c80e1d3..5cf037edc260926d1e5542a5d8e640f5cd323d31 100644 (file)
@@ -734,7 +734,7 @@ ssize_t full_path_tos(const char *dir, const char *name,
 NTSTATUS file_name_hash(connection_struct *conn,
                        const char *name, uint32_t *p_name_hash)
 {
-       char tmpbuf[1024];
+       char tmpbuf[PATH_MAX];
        char *fullpath, *to_free;
        size_t len;
 
index 078bc996601221e590ce1e9a5ae0531861b560e4..c19982ac3a6be2836a8517ddb0bbb1990412ee95 100644 (file)
@@ -419,7 +419,7 @@ void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
 {
        struct notify_context *notify_ctx = conn->sconn->notify_ctx;
        char *fullpath, *to_free;
-       char tmpbuf[1024];
+       char tmpbuf[PATH_MAX];
        ssize_t len;
 
        if (path[0] == '.' && path[1] == '/') {