From 12efc76750083252c155907029ad00cdfc897090 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 31 Jan 2016 16:08:20 +0000 Subject: Fix and test symlink attribute size --- mythfs/service/inodes/symlink.cpp | 2 +- mythfs/unittests/testMain.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mythfs/service/inodes/symlink.cpp b/mythfs/service/inodes/symlink.cpp index 8dcc0df..5e86015 100644 --- a/mythfs/service/inodes/symlink.cpp +++ b/mythfs/service/inodes/symlink.cpp @@ -14,7 +14,7 @@ namespace MythFS { return { 0, 0, S_IRUSR | S_IRGRP | S_IROTH | S_IFLNK, - 1,"root","root",0,0,0,0,0,0,0}; + 1,"root","root",0,(Ice::Long)target.length(),0,0,0,0,0}; } std::string diff --git a/mythfs/unittests/testMain.cpp b/mythfs/unittests/testMain.cpp index a2dfabe..5641cec 100644 --- a/mythfs/unittests/testMain.cpp +++ b/mythfs/unittests/testMain.cpp @@ -92,6 +92,7 @@ BOOST_AUTO_TEST_CASE( listAll ) auto a = rv->getattr(re, "/all/1001_20151220233900.mpg"); BOOST_REQUIRE(S_ISLNK(a.mode)); + BOOST_REQUIRE_EQUAL(strlen("/var/store/mythrecordings/1001_20151220233900.mpg"), a.size); auto l = rv->readlink(re, "/all/1001_20151220233900.mpg"); BOOST_REQUIRE_EQUAL("/var/store/mythrecordings/1001_20151220233900.mpg", l); } -- cgit v1.2.3