aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llvfs
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llvfs')
-rw-r--r--linden/indra/llvfs/CMakeLists.txt6
-rw-r--r--linden/indra/llvfs/lldir.cpp25
-rw-r--r--linden/indra/llvfs/lldir.h16
-rw-r--r--linden/indra/llvfs/lldir_linux.cpp2
-rw-r--r--linden/indra/llvfs/lldir_linux.h2
-rw-r--r--linden/indra/llvfs/lldir_mac.cpp2
-rw-r--r--linden/indra/llvfs/lldir_mac.h2
-rw-r--r--linden/indra/llvfs/lldir_solaris.cpp2
-rw-r--r--linden/indra/llvfs/lldir_solaris.h2
-rw-r--r--linden/indra/llvfs/lldir_win32.cpp2
-rw-r--r--linden/indra/llvfs/lldir_win32.h2
-rw-r--r--linden/indra/llvfs/lllfsthread.cpp2
-rw-r--r--linden/indra/llvfs/lllfsthread.h2
-rw-r--r--linden/indra/llvfs/llvfile.cpp3
-rw-r--r--linden/indra/llvfs/llvfile.h2
-rw-r--r--linden/indra/llvfs/llvfs.cpp4
-rw-r--r--linden/indra/llvfs/llvfs.h2
-rw-r--r--linden/indra/llvfs/llvfsthread.cpp2
-rw-r--r--linden/indra/llvfs/llvfsthread.h2
19 files changed, 58 insertions, 24 deletions
diff --git a/linden/indra/llvfs/CMakeLists.txt b/linden/indra/llvfs/CMakeLists.txt
index 9f136f7..c3c12ef 100644
--- a/linden/indra/llvfs/CMakeLists.txt
+++ b/linden/indra/llvfs/CMakeLists.txt
@@ -56,3 +56,9 @@ set_source_files_properties(${llvfs_HEADER_FILES}
56list(APPEND llvfs_SOURCE_FILES ${llvfs_HEADER_FILES}) 56list(APPEND llvfs_SOURCE_FILES ${llvfs_HEADER_FILES})
57 57
58add_library (llvfs ${llvfs_SOURCE_FILES}) 58add_library (llvfs ${llvfs_SOURCE_FILES})
59
60if (DARWIN)
61 include(CMakeFindFrameworks)
62 find_library(CARBON_LIBRARY Carbon)
63 target_link_libraries(llvfs ${CARBON_LIBRARY})
64endif (DARWIN)
diff --git a/linden/indra/llvfs/lldir.cpp b/linden/indra/llvfs/lldir.cpp
index 8cd2b5c..1dc00dd 100644
--- a/linden/indra/llvfs/lldir.cpp
+++ b/linden/indra/llvfs/lldir.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -497,6 +497,29 @@ std::string LLDir::getTempFilename() const
497 return temp_filename; 497 return temp_filename;
498} 498}
499 499
500// static
501std::string LLDir::getScrubbedFileName(const std::string uncleanFileName)
502{
503 std::string name(uncleanFileName);
504 const std::string illegalChars(getForbiddenFileChars());
505 // replace any illegal file chars with and underscore '_'
506 for( unsigned int i = 0; i < illegalChars.length(); i++ )
507 {
508 int j = -1;
509 while((j = name.find(illegalChars[i])) > -1)
510 {
511 name[j] = '_';
512 }
513 }
514 return name;
515}
516
517// static
518std::string LLDir::getForbiddenFileChars()
519{
520 return "\\/:*?\"<>|";
521}
522
500void LLDir::setLindenUserDir(const std::string &first, const std::string &last) 523void LLDir::setLindenUserDir(const std::string &first, const std::string &last)
501{ 524{
502 // if both first and last aren't set, assume we're grabbing the cached dir 525 // if both first and last aren't set, assume we're grabbing the cached dir
diff --git a/linden/indra/llvfs/lldir.h b/linden/indra/llvfs/lldir.h
index dbddf7d..b041afc 100644
--- a/linden/indra/llvfs/lldir.h
+++ b/linden/indra/llvfs/lldir.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2000&license=viewergpl$ 5 * $LicenseInfo:firstyear=2000&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2000-2008, Linden Research, Inc. 7 * Copyright (c) 2000-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -64,12 +64,12 @@ class LLDir
64 64
65 virtual void initAppDirs(const std::string &app_name) = 0; 65 virtual void initAppDirs(const std::string &app_name) = 0;
66 public: 66 public:
67 virtual S32 deleteFilesInDir(const std::string &dirname, const std::string &mask); 67 virtual S32 deleteFilesInDir(const std::string &dirname, const std::string &mask);
68 68
69// pure virtual functions 69// pure virtual functions
70 virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask) = 0; 70 virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask) = 0;
71 virtual BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap) = 0; 71 virtual BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap) = 0;
72 virtual void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname) = 0; 72 virtual void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname) = 0;
73 virtual std::string getCurPath() = 0; 73 virtual std::string getCurPath() = 0;
74 virtual BOOL fileExists(const std::string &filename) const = 0; 74 virtual BOOL fileExists(const std::string &filename) const = 0;
75 75
@@ -104,7 +104,7 @@ class LLDir
104 std::string getBaseFileName(const std::string& filepath, bool strip_exten = false) const; 104 std::string getBaseFileName(const std::string& filepath, bool strip_exten = false) const;
105 std::string getDirName(const std::string& filepath) const; 105 std::string getDirName(const std::string& filepath) const;
106 std::string getExtension(const std::string& filepath) const; // Excludes '.', e.g getExtension("foo.wav") == "wav" 106 std::string getExtension(const std::string& filepath) const; // Excludes '.', e.g getExtension("foo.wav") == "wav"
107 107
108 // these methods search the various skin paths for the specified file in the following order: 108 // these methods search the various skin paths for the specified file in the following order:
109 // getUserSkinDir(), getSkinDir(), getDefaultSkinDir() 109 // getUserSkinDir(), getSkinDir(), getDefaultSkinDir()
110 std::string findSkinnedFilename(const std::string &filename) const; 110 std::string findSkinnedFilename(const std::string &filename) const;
@@ -114,6 +114,10 @@ class LLDir
114 // random filename in common temporary directory 114 // random filename in common temporary directory
115 std::string getTempFilename() const; 115 std::string getTempFilename() const;
116 116
117 // For producing safe download file names from potentially unsafe ones
118 static std::string getScrubbedFileName(const std::string uncleanFileName);
119 static std::string getForbiddenFileChars();
120
117 virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir 121 virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir
118 virtual void setPerAccountChatLogsDir(const std::string &first, const std::string &last); // Set the per user chat log directory. 122 virtual void setPerAccountChatLogsDir(const std::string &first, const std::string &last); // Set the per user chat log directory.
119 virtual void setLindenUserDir(const std::string &first, const std::string &last); // Set the linden user dir to this user's dir 123 virtual void setLindenUserDir(const std::string &first, const std::string &last); // Set the linden user dir to this user's dir
diff --git a/linden/indra/llvfs/lldir_linux.cpp b/linden/indra/llvfs/lldir_linux.cpp
index 481d23d..ce8806a 100644
--- a/linden/indra/llvfs/lldir_linux.cpp
+++ b/linden/indra/llvfs/lldir_linux.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/lldir_linux.h b/linden/indra/llvfs/lldir_linux.h
index 99925c1..09a27a7 100644
--- a/linden/indra/llvfs/lldir_linux.h
+++ b/linden/indra/llvfs/lldir_linux.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2000&license=viewergpl$ 5 * $LicenseInfo:firstyear=2000&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2000-2008, Linden Research, Inc. 7 * Copyright (c) 2000-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/lldir_mac.cpp b/linden/indra/llvfs/lldir_mac.cpp
index 548f3da..f61fa74 100644
--- a/linden/indra/llvfs/lldir_mac.cpp
+++ b/linden/indra/llvfs/lldir_mac.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/lldir_mac.h b/linden/indra/llvfs/lldir_mac.h
index beb8c93..8288bf8 100644
--- a/linden/indra/llvfs/lldir_mac.h
+++ b/linden/indra/llvfs/lldir_mac.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2000&license=viewergpl$ 5 * $LicenseInfo:firstyear=2000&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2000-2008, Linden Research, Inc. 7 * Copyright (c) 2000-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/lldir_solaris.cpp b/linden/indra/llvfs/lldir_solaris.cpp
index 62c1eb7..adbe747 100644
--- a/linden/indra/llvfs/lldir_solaris.cpp
+++ b/linden/indra/llvfs/lldir_solaris.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2005&license=viewergpl$ 5 * $LicenseInfo:firstyear=2005&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2005-2008, Linden Research, Inc. 7 * Copyright (c) 2005-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/lldir_solaris.h b/linden/indra/llvfs/lldir_solaris.h
index a8ad4ca..dea397d 100644
--- a/linden/indra/llvfs/lldir_solaris.h
+++ b/linden/indra/llvfs/lldir_solaris.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2005&license=viewergpl$ 5 * $LicenseInfo:firstyear=2005&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2005-2008, Linden Research, Inc. 7 * Copyright (c) 2005-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/lldir_win32.cpp b/linden/indra/llvfs/lldir_win32.cpp
index 9cb9721..8703a0f 100644
--- a/linden/indra/llvfs/lldir_win32.cpp
+++ b/linden/indra/llvfs/lldir_win32.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/lldir_win32.h b/linden/indra/llvfs/lldir_win32.h
index e988d39..25bb276 100644
--- a/linden/indra/llvfs/lldir_win32.h
+++ b/linden/indra/llvfs/lldir_win32.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2000&license=viewergpl$ 5 * $LicenseInfo:firstyear=2000&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2000-2008, Linden Research, Inc. 7 * Copyright (c) 2000-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/lllfsthread.cpp b/linden/indra/llvfs/lllfsthread.cpp
index 7dce4d9..bdcf61f 100644
--- a/linden/indra/llvfs/lllfsthread.cpp
+++ b/linden/indra/llvfs/lllfsthread.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$ 5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2001-2008, Linden Research, Inc. 7 * Copyright (c) 2001-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/lllfsthread.h b/linden/indra/llvfs/lllfsthread.h
index eebec48..a344282 100644
--- a/linden/indra/llvfs/lllfsthread.h
+++ b/linden/indra/llvfs/lllfsthread.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2000&license=viewergpl$ 5 * $LicenseInfo:firstyear=2000&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2000-2008, Linden Research, Inc. 7 * Copyright (c) 2000-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/llvfile.cpp b/linden/indra/llvfs/llvfile.cpp
index 61de885..085c36c 100644
--- a/linden/indra/llvfs/llvfile.cpp
+++ b/linden/indra/llvfs/llvfile.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -35,6 +35,7 @@
35 35
36#include "llerror.h" 36#include "llerror.h"
37#include "llthread.h" 37#include "llthread.h"
38#include "llstat.h"
38#include "llvfs.h" 39#include "llvfs.h"
39 40
40const S32 LLVFile::READ = 0x00000001; 41const S32 LLVFile::READ = 0x00000001;
diff --git a/linden/indra/llvfs/llvfile.h b/linden/indra/llvfs/llvfile.h
index 040e61a..16fa779 100644
--- a/linden/indra/llvfs/llvfile.h
+++ b/linden/indra/llvfs/llvfile.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/llvfs.cpp b/linden/indra/llvfs/llvfs.cpp
index b3d02a5..d6c9278 100644
--- a/linden/indra/llvfs/llvfs.cpp
+++ b/linden/indra/llvfs/llvfs.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -1266,7 +1266,7 @@ void LLVFS::eraseBlockLength(LLVFSBlock *block)
1266 } 1266 }
1267 if(!found_block) 1267 if(!found_block)
1268 { 1268 {
1269 llwarns << "eraseBlock could not find block" << llendl; 1269 llerrs << "eraseBlock could not find block" << llendl;
1270 } 1270 }
1271} 1271}
1272 1272
diff --git a/linden/indra/llvfs/llvfs.h b/linden/indra/llvfs/llvfs.h
index 06015b6..b31ec89 100644
--- a/linden/indra/llvfs/llvfs.h
+++ b/linden/indra/llvfs/llvfs.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/llvfsthread.cpp b/linden/indra/llvfs/llvfsthread.cpp
index ff27475..599c00e 100644
--- a/linden/indra/llvfs/llvfsthread.cpp
+++ b/linden/indra/llvfs/llvfsthread.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$ 5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2001-2008, Linden Research, Inc. 7 * Copyright (c) 2001-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/llvfs/llvfsthread.h b/linden/indra/llvfs/llvfsthread.h
index 5f1c6ac..b38a788 100644
--- a/linden/indra/llvfs/llvfsthread.h
+++ b/linden/indra/llvfs/llvfsthread.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$ 5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2001-2008, Linden Research, Inc. 7 * Copyright (c) 2001-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab