aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-04-09 22:19:27 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-17 21:51:36 -0400
commitb6ddc4e6fed9c6f4adb273c8b36e1731f90ec17e (patch)
treed12b3d657b9fac6f5c33b271a093be25a9fa2284 /fs
parent34a622b2e1c8e11c8990184634f101c1aad42fec (diff)
[XFS] Don't validate symlink target component length
This target component validation is not POSIX conformant and it is not done by any other Linux filesystem so remove it from XFS. SGI-PV: 980080 SGI-Modid: xfs-linux-melb:xfs-kern:30776a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_vnodeops.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 3418c94bcf17..d46f24c68498 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -3105,31 +3105,6 @@ xfs_symlink(
3105 pathlen = strlen(target_path); 3105 pathlen = strlen(target_path);
3106 if (pathlen >= MAXPATHLEN) /* total string too long */ 3106 if (pathlen >= MAXPATHLEN) /* total string too long */
3107 return XFS_ERROR(ENAMETOOLONG); 3107 return XFS_ERROR(ENAMETOOLONG);
3108 if (pathlen >= MAXNAMELEN) { /* is any component too long? */
3109 int len, total;
3110 char *path;
3111
3112 for (total = 0, path = target_path; total < pathlen;) {
3113 /*
3114 * Skip any slashes.
3115 */
3116 while(*path == '/') {
3117 total++;
3118 path++;
3119 }
3120
3121 /*
3122 * Count up to the next slash or end of path.
3123 * Error out if the component is bigger than MAXNAMELEN.
3124 */
3125 for(len = 0; *path != '/' && total < pathlen;total++, path++) {
3126 if (++len >= MAXNAMELEN) {
3127 error = ENAMETOOLONG;
3128 return error;
3129 }
3130 }
3131 }
3132 }
3133 3108
3134 if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) { 3109 if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) {
3135 error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dp, 3110 error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dp,