From 78fe8216941a8d0f6fb6b9259d8b0f4ed70978d4 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 14 Oct 1999 01:19:08 +0000 Subject: 1999-10-13 Roland McGrath * lookup.c (diskfs_lookup): Enforce diskfs_name_max limit for CREATE and RENAME, returning ENAMETOOLONG for violations. * io-pathconf.c (diskfs_S_io_pathconf): _PC_NO_TRUNC controlled by diskfs_name_max setting. --- libdiskfs/io-pathconf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libdiskfs/io-pathconf.c') diff --git a/libdiskfs/io-pathconf.c b/libdiskfs/io-pathconf.c index ec13fd14..8c86cabf 100644 --- a/libdiskfs/io-pathconf.c +++ b/libdiskfs/io-pathconf.c @@ -44,11 +44,14 @@ diskfs_S_io_pathconf (struct protid *cred, case _PC_NAME_MAX: /* string_t constrains the upper bound. */ - *value = diskfs_name_max > 1024 ? 1024 : diskfs_name_max; + *value = diskfs_name_max > 1023 ? 1023 : diskfs_name_max; + break; + + case _PC_NO_TRUNC: /* enforced in diskfs_lookup */ + *value = diskfs_name_max >= 0; break; case _PC_CHOWN_RESTRICTED: - case _PC_NO_TRUNC: /* look at string_t trunc behavior in MiG */ case _PC_SYNC_IO: case _PC_ASYNC_IO: *value = 1; -- cgit v1.2.3