1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-03 06:45:37 -08:00

Add support for 255 character file names in fuse.

from Helg Bredow, thanks!
input/OK reyk@
This commit is contained in:
syl 2014-04-28 13:08:34 +00:00
parent 7a44d664c0
commit ddbf791048
3 changed files with 12 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dict.c,v 1.1 2013/06/03 16:00:50 tedu Exp $ */
/* $OpenBSD: dict.c,v 1.2 2014/04/28 13:08:34 syl Exp $ */
/*
* Copyright (c) 2012 Gilles Chehade <gilles@poolp.org>
@ -26,7 +26,7 @@
#define MAX_DICTKEY_SIZE NAME_MAX
struct dictentry {
SPLAY_ENTRY(dictentry) entry;
char key[MAX_DICTKEY_SIZE];
char key[MAX_DICTKEY_SIZE + 1];
void *data;
};

View File

@ -1,4 +1,4 @@
/* $OpenBSD: fuse_private.h,v 1.9 2013/12/03 09:59:40 syl Exp $ */
/* $OpenBSD: fuse_private.h,v 1.10 2014/04/28 13:08:34 syl Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@ -34,7 +34,7 @@ struct fuse_vnode {
ino_t ino;
ino_t parent;
char path[NAME_MAX];
char path[NAME_MAX + 1];
struct fuse_dirhandle *fd;
SIMPLEQ_ENTRY(fuse_vnode) node; /* for dict */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: fuse_subr.c,v 1.7 2014/02/05 20:13:58 syl Exp $ */
/* $OpenBSD: fuse_subr.c,v 1.8 2014/04/28 13:08:34 syl Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@ -29,14 +29,18 @@ alloc_vn(struct fuse *f, const char *path, ino_t ino, ino_t parent)
struct fuse_vnode *vn;
if ((vn = malloc(sizeof(*vn))) == NULL) {
DPERROR("alloc_vn:");
DPERROR(__func__);
return (NULL);
}
vn->ino = ino;
vn->parent = parent;
strncpy(vn->path, path, NAME_MAX);
vn->path[NAME_MAX - 1] = '\0';
if (strlcpy(vn->path, path, sizeof(vn->path)) >= sizeof(vn->path)) {
DPRINTF("%s: strlcpy name too long\n", __func__);
free(vn);
return (NULL);
}
if (ino == (ino_t)-1) {
f->max_ino++;
vn->ino = f->max_ino;