aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llinventory/llpermissions.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llinventory/llpermissions.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llinventory/llpermissions.cpp')
-rw-r--r--linden/indra/llinventory/llpermissions.cpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/linden/indra/llinventory/llpermissions.cpp b/linden/indra/llinventory/llpermissions.cpp
index afa2772..b25faa8 100644
--- a/linden/indra/llinventory/llpermissions.cpp
+++ b/linden/indra/llinventory/llpermissions.cpp
@@ -650,7 +650,7 @@ BOOL LLPermissions::importFile(LLFILE* fp)
650 650
651BOOL LLPermissions::exportFile(LLFILE* fp) const 651BOOL LLPermissions::exportFile(LLFILE* fp) const
652{ 652{
653 char uuid_str[256]; /* Flawfinder: ignore */ 653 std::string uuid_str;
654 654
655 fprintf(fp, "\tpermissions 0\n"); 655 fprintf(fp, "\tpermissions 0\n");
656 fprintf(fp, "\t{\n"); 656 fprintf(fp, "\t{\n");
@@ -662,16 +662,16 @@ BOOL LLPermissions::exportFile(LLFILE* fp) const
662 fprintf(fp, "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner); 662 fprintf(fp, "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner);
663 663
664 mCreator.toString(uuid_str); 664 mCreator.toString(uuid_str);
665 fprintf(fp, "\t\tcreator_id\t%s\n", uuid_str); 665 fprintf(fp, "\t\tcreator_id\t%s\n", uuid_str.c_str());
666 666
667 mOwner.toString(uuid_str); 667 mOwner.toString(uuid_str);
668 fprintf(fp, "\t\towner_id\t%s\n", uuid_str); 668 fprintf(fp, "\t\towner_id\t%s\n", uuid_str.c_str());
669 669
670 mLastOwner.toString(uuid_str); 670 mLastOwner.toString(uuid_str);
671 fprintf(fp, "\t\tlast_owner_id\t%s\n", uuid_str); 671 fprintf(fp, "\t\tlast_owner_id\t%s\n", uuid_str.c_str());
672 672
673 mGroup.toString(uuid_str); 673 mGroup.toString(uuid_str);
674 fprintf(fp, "\t\tgroup_id\t%s\n", uuid_str); 674 fprintf(fp, "\t\tgroup_id\t%s\n", uuid_str.c_str());
675 675
676 if(mIsGroupOwned) 676 if(mIsGroupOwned)
677 { 677 {
@@ -784,21 +784,21 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
784 784
785BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const 785BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const
786{ 786{
787 char uuid_str[256]; /* Flawfinder: ignore */ 787 std::string uuid_str;
788 788
789 output_stream << "\tpermissions 0\n"; 789 output_stream << "\tpermissions 0\n";
790 output_stream << "\t{\n"; 790 output_stream << "\t{\n";
791 791
792 char buffer[256]; /* Flawfinder: ignore */ 792 std::string buffer;
793 snprintf(buffer, sizeof(buffer), "\t\tbase_mask\t%08x\n", mMaskBase); /* Flawfinder: ignore */ 793 buffer = llformat( "\t\tbase_mask\t%08x\n", mMaskBase);
794 output_stream << buffer; 794 output_stream << buffer;
795 snprintf(buffer, sizeof(buffer), "\t\towner_mask\t%08x\n", mMaskOwner); /* Flawfinder: ignore */ 795 buffer = llformat( "\t\towner_mask\t%08x\n", mMaskOwner);
796 output_stream << buffer; 796 output_stream << buffer;
797 snprintf(buffer, sizeof(buffer), "\t\tgroup_mask\t%08x\n", mMaskGroup); /* Flawfinder: ignore */ 797 buffer = llformat( "\t\tgroup_mask\t%08x\n", mMaskGroup);
798 output_stream << buffer; 798 output_stream << buffer;
799 snprintf(buffer, sizeof(buffer), "\t\teveryone_mask\t%08x\n", mMaskEveryone); /* Flawfinder: ignore */ 799 buffer = llformat( "\t\teveryone_mask\t%08x\n", mMaskEveryone);
800 output_stream << buffer; 800 output_stream << buffer;
801 snprintf(buffer, sizeof(buffer), "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner); /* Flawfinder: ignore */ 801 buffer = llformat( "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner);
802 output_stream << buffer; 802 output_stream << buffer;
803 803
804 mCreator.toString(uuid_str); 804 mCreator.toString(uuid_str);
@@ -826,7 +826,7 @@ LLXMLNode *LLPermissions::exportFileXML() const
826{ 826{
827 LLXMLNode *ret = new LLXMLNode("permissions", FALSE); 827 LLXMLNode *ret = new LLXMLNode("permissions", FALSE);
828 828
829 ret->createChild("group_owned", TRUE)->setBoolValue(1, (const BOOL*)&mIsGroupOwned); 829 ret->createChild("group_owned", TRUE)->setBoolValue(mIsGroupOwned);
830 830
831 ret->createChild("base_mask", FALSE)->setByteValue(4, (U8*)&mMaskBase, LLXMLNode::ENCODING_HEX); 831 ret->createChild("base_mask", FALSE)->setByteValue(4, (U8*)&mMaskBase, LLXMLNode::ENCODING_HEX);
832 ret->createChild("owner_mask", FALSE)->setByteValue(4, (U8*)&mMaskOwner, LLXMLNode::ENCODING_HEX); 832 ret->createChild("owner_mask", FALSE)->setByteValue(4, (U8*)&mMaskOwner, LLXMLNode::ENCODING_HEX);
@@ -869,7 +869,11 @@ bool LLPermissions::importXML(LLXMLNode* node)
869 if (node->getChild("group_id", sub_node)) 869 if (node->getChild("group_id", sub_node))
870 success = success && (1 == sub_node->getUUIDValue(1, &mGroup)); 870 success = success && (1 == sub_node->getUUIDValue(1, &mGroup));
871 if (node->getChild("group_owned", sub_node)) 871 if (node->getChild("group_owned", sub_node))
872 success = success && (1 == sub_node->getBoolValue(1, (BOOL*)&mIsGroupOwned)); 872 {
873 BOOL tmpbool = FALSE;
874 success = success && (1 == sub_node->getBoolValue(1, &tmpbool));
875 mIsGroupOwned = (bool)tmpbool;
876 }
873 if (!success) 877 if (!success)
874 { 878 {
875 lldebugs << "LLPermissions::importXML() failed for node named '" 879 lldebugs << "LLPermissions::importXML() failed for node named '"
@@ -1114,12 +1118,12 @@ void LLAggregatePermissions::unpackMessage(LLMessageSystem* msg, const char* blo
1114 mBits[PI_TRANSFER] = bits & TWO_BITS; 1118 mBits[PI_TRANSFER] = bits & TWO_BITS;
1115} 1119}
1116 1120
1117const LLString AGGREGATE_VALUES[4] = 1121const std::string AGGREGATE_VALUES[4] =
1118 { 1122 {
1119 LLString( "Empty" ), 1123 std::string( "Empty" ),
1120 LLString( "None" ), 1124 std::string( "None" ),
1121 LLString( "Some" ), 1125 std::string( "Some" ),
1122 LLString( "All" ) 1126 std::string( "All" )
1123 }; 1127 };
1124 1128
1125std::ostream& operator<<(std::ostream &s, const LLAggregatePermissions &perm) 1129std::ostream& operator<<(std::ostream &s, const LLAggregatePermissions &perm)