Fix update-receiver.lsl failing to self-delete, and a security issue. (#22)

The types in the list are strings, so they won't match a key.

Remove the pin from the prim when removing the script.
This commit is contained in:
Sei-Lisa 2017-08-27 02:39:50 +02:00 committed by codeviolet
parent 56c16cf6bf
commit e03807caa7

View file

@ -1,6 +1,6 @@
/* /*
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
* *
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io) * Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
@ -8,14 +8,14 @@
* https://avsitter.github.io/TRADEMARK.mediawiki * https://avsitter.github.io/TRADEMARK.mediawiki
* *
* Please consider supporting continued development of AVsitter and * Please consider supporting continued development of AVsitter and
* receive automatic updates and other benefits! All details and user * receive automatic updates and other benefits! All details and user
* instructions can be found at http://avsitter.github.io * instructions can be found at http://avsitter.github.io
*/ */
/* /*
* Simple script used for updating a large number of furniture items at once * Simple script used for updating a large number of furniture items at once
* This script goes in each furniture prim that expects an update from the sender * This script goes in each furniture prim that expects an update from the sender
* will auto-delete if a non-admin avatar rezzes the furniture * will auto-delete if a non-admin avatar rezzes the furniture
*/ */
integer pin = -29752; integer pin = -29752;
@ -53,10 +53,11 @@ default
{ {
if (start) if (start)
{ {
if (~llListFindList(admin_avatars, [llGetOwner()])) if (~llListFindList(admin_avatars, [(string)llGetOwner()]))
{ {
llRegionSayTo(llGetOwner(), 0, "Removing :" + llGetScriptName()); llRegionSayTo(llGetOwner(), 0, "Removing :" + llGetScriptName());
} }
llSetRemoteScriptAccessPin(0);
llRemoveInventory(llGetScriptName()); llRemoveInventory(llGetScriptName());
} }
} }
@ -87,8 +88,9 @@ default
{ {
if (change & CHANGED_OWNER) if (change & CHANGED_OWNER)
{ {
if (!llListFindList(admin_avatars, [llGetOwner()])) if (llListFindList(admin_avatars, [(string)llGetOwner()]) == -1)
{ {
llSetRemoteScriptAccessPin(0);
llRemoveInventory(llGetScriptName()); llRemoveInventory(llGetScriptName());
} }
} }