From 6b5e7df2c32a87de067e41051f0fa7a285189e20 Mon Sep 17 00:00:00 2001
From: mshlyn <linlongzhou@163.com>
Date: Sat, 23 Mar 2013 03:09:21 +0800
Subject: [PATCH] Fix ticket 9561: KDL when mounting exports located in
directory deeper than 1 level
---
src/add-ons/kernel/file_systems/nfs4/ReplyInterpreter.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/add-ons/kernel/file_systems/nfs4/ReplyInterpreter.cpp b/src/add-ons/kernel/file_systems/nfs4/ReplyInterpreter.cpp
index d078e4b..9a53751 100644
a
|
b
|
ReplyInterpreter::_FlattenPathname(XDR::ReadStream& stream)
|
534 | 534 | uint32 count = stream.GetUInt(); |
535 | 535 | char* pathname = NULL; |
536 | 536 | uint32 size = 0; |
| 537 | uint32 path_end = 0; |
537 | 538 | for (uint32 i = 0; i < count; i++) { |
538 | 539 | const char* path = stream.GetString(); |
539 | 540 | size += strlen(path) + 1; |
… |
… |
ReplyInterpreter::_FlattenPathname(XDR::ReadStream& stream)
|
541 | 542 | pathname = reinterpret_cast<char*>(malloc(strlen(path) + 1)); |
542 | 543 | pathname[0] = '\0'; |
543 | 544 | } else { |
544 | | *pathname++ = '/'; |
| 545 | pathname[path_end] = '/'; |
545 | 546 | pathname = reinterpret_cast<char*>(realloc(pathname, size)); |
| 547 | pathname[path_end + 1] = '\0'; |
546 | 548 | } |
547 | 549 | strcat(pathname, path); |
| 550 | path_end = size - 1; |
548 | 551 | free(const_cast<char*>(path)); |
549 | 552 | } |
550 | 553 | |