* [PATCH] don't validate symlink target component length
@ 2008-04-07 9:57 Christoph Hellwig
2008-04-07 22:03 ` David Chinner
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2008-04-07 9:57 UTC (permalink / raw)
To: xfs
This validtion is not posix conform and no other Linux filesystem does
it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-04-07 09:33:21.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-04-07 09:34:25.000000000 +0200
@@ -3105,31 +3105,6 @@ xfs_symlink(
pathlen = strlen(target_path);
if (pathlen >= MAXPATHLEN) /* total string too long */
return XFS_ERROR(ENAMETOOLONG);
- if (pathlen >= MAXNAMELEN) { /* is any component too long? */
- int len, total;
- char *path;
-
- for (total = 0, path = target_path; total < pathlen;) {
- /*
- * Skip any slashes.
- */
- while(*path == '/') {
- total++;
- path++;
- }
-
- /*
- * Count up to the next slash or end of path.
- * Error out if the component is bigger than MAXNAMELEN.
- */
- for(len = 0; *path != '/' && total < pathlen;total++, path++) {
- if (++len >= MAXNAMELEN) {
- error = ENAMETOOLONG;
- return error;
- }
- }
- }
- }
if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) {
error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dp,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] don't validate symlink target component length
2008-04-07 9:57 [PATCH] don't validate symlink target component length Christoph Hellwig
@ 2008-04-07 22:03 ` David Chinner
0 siblings, 0 replies; 2+ messages in thread
From: David Chinner @ 2008-04-07 22:03 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Mon, Apr 07, 2008 at 11:57:45AM +0200, Christoph Hellwig wrote:
> This validtion is not posix conform and no other Linux filesystem does
> it.
Beat me to it, Christoph. ;)
I'll run it through QA.
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-07 22:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-07 9:57 [PATCH] don't validate symlink target component length Christoph Hellwig
2008-04-07 22:03 ` David Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox