Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

[BUG-5656] llGiveInventory fails when no-copy items are given to attachments (even no-copy ones) #13603

Open
sl-service-account opened this issue Apr 7, 2014 · 5 comments

Comments

@sl-service-account
Copy link

Steps to Reproduce

  1. Have an attachment, set permissions to transfer no copy, modify and have a script inside, that is no copy, transfer, no modify. Give it away.

  2. Have an scripted add on installer that tries to give add-on-items with llGiveInventory to the attachment.

  3. Have the add-on-items inside the installer (notecards, animations) have the permissions no copy and transfer (same as the attachment),

  4. Give it away to the same other resident like before.

  5. Have the resident wear the attachment and rez the installer

  6. Run the install and you get the error "Blocked by permissions" and the no copy add-on-items from the install-box are gone with the wind. The installer is empty, the attachment did not get the items.

-> this deletes residents items.

Workaround is:

  1. have an additional script in the first item, that is no transfer
    and
  2. have the items you give copy, no transfer

==
2nd Scenario

  1. Have the same attachemtn as before (modify, no copy, transfer)
  2. Have the add-on-items the permission no transfer & copy

-> it gets the error "Destination did not accept"

However, I am thinking this did work very well, before and but rendered the attachemt to no copy, no transfer

Actual Behavior

llGiveInventory fails either with Blocked by permissions or Destination did not accept
no copy items of the resident get stolen by the system.

Expected Behavior

no error,
items transfer fine
items get not stolen from the resident

Other information

Seems related to SCR-491

Original Jira Fields
Field Value
Issue BUG-5656
Summary llGiveInventory fails when no-copy items are given to attachments (even no-copy ones)
Type Bug
Priority Unset
Status Accepted
Resolution Accepted
Reporter Mo Noel (mo.noel)
Created at 2014-04-07T20:10:09Z
Updated at 2014-04-10T17:24:14Z
{
  'Business Unit': ['Platform'],
  'Date of First Response': '2014-04-07T15:19:49.451-0500',
  "Is there anything you'd like to add?": 'Seems related to SCR-491',
  'System': 'SL Simulator',
  'Target Viewer Version': 'viewer-development',
  'What just happened?': '\r\nllGiveInventory fails either with Blocked by permissions or Destination did not accept\r\nno copy items of the resident get stolen by the system.\r\n',
  'What were you doing when it happened?': '1. Have an attachment, set permissions to transfer no copy, modify and have a script inside, that is no copy, transfer, no modify. Give it away.\r\n\r\n2. Have an scripted add on installer that tries to give add-on-items with llGiveInventory to the attachment.\r\n3. Have the add-on-items inside the installer (notecards, animations) have the permissions no copy and transfer (same as the attachment),\r\n4. Give it away to the same other resident like before.\r\n5. Have the resident wear the attachment and rez the installer\r\n5. Run the install and you get the error "Blocked by permissions" and the no copy add-on-items from the install-box are gone with the wind. The installer is empty, the attachment did not get the items.\r\n\r\n-> this deletes residents items.\r\n\r\n\r\nWorkaround is: \r\n1. have an additional script in the first item, that is no transfer\r\n_and_\r\n2. have the items you give copy, no transfer\r\n\r\n\r\n==\r\n2nd Scenario\r\n\r\n1. Have the same attachemtn as before (modify, no copy, transfer)\r\n2. Have the add-on-items the permission no transfer & copy\r\n\r\n-> it gets the error "Destination did not accept"\r\n\r\nHowever, I am thinking this did work very well, before and but rendered the attachemt to no copy, no transfer',
  'What were you expecting to happen instead?': 'no error, \r\nitems transfer fine\r\nitems get not stolen from the resident',
}
@sl-service-account
Copy link
Author

Darien Caldwell commented at 2014-04-07T20:19:49Z

Yes, this is expected behavior. LL had to tighten the permissions to disallow this due to it being used to get around permissions and copy content in bad faith. The workaround is for the attachment to be rezzed in the sim, not worn.

@sl-service-account
Copy link
Author

Mo Noel commented at 2014-04-08T07:52:22Z

Maybe scenario 2 you could argument as expected behaviour, but surely not scenario 1, where you transfer items with the exact same copy / transfer permissions and instead of transfering them, the system extinguishes them, so that the no copy property of the resident is actually lost.

This is more severe then just breaking content, imho.

@sl-service-account
Copy link
Author

Maestro Linden commented at 2014-04-08T22:51:57Z

Hi Mo, thanks for the report. I can't seem to reproduce the content loss aspect of this issue.

  1. Have an attachment, set permissions to transfer no copy, modify and have a script inside, that is no copy, transfer, no modify. Give it away.
    Here’s the script I used for the attachment:
string permsList(integer perm)
{
    list perm_list;
    if(perm & PERM_ALL == PERM_ALL) perm_list += ["PERM_ALL"];
    else
    {
        // only need to include these details if PERM_ALL isn't set, really..
        if(perm & PERM_COPY) perm_list += ["PERM_COPY"];
        if(perm & PERM_MODIFY) perm_list += ["PERM_MODIFY"];
        if(perm & PERM_TRANSFER) perm_list += ["PERM_TRANSFER"];
        if(perm & PERM_MOVE) perm_list += ["PERM_MOVE"];
        integer others = perm & ~(PERM_COPY | PERM_MODIFY | PERM_TRANSFER | PERM_MOVE);
        if(others) perm_list += ["other :" + (string)others];
    }
    
    return (string)perm + " = " + llList2CSV(perm_list);
}
default
{
    state_entry()
    {
        llSay(0, "touch me to get my task_id and list of inventory");
    }
    touch_start(integer total_number)
    {
        llSay(0, "task_id: " + (string)llGetKey());
        integer item = llGetInventoryNumber(INVENTORY_ALL);
        while(item--)
        {
            string item_name = llGetInventoryName(INVENTORY_ALL, item);
            llSay(0, "Item: '" + item_name + "'"
                + "\n\tMASK_BASE: " + permsList(llGetInventoryPermMask(item_name, MASK_BASE))
                + "\n\tMASK_OWNER: " + permsList(llGetInventoryPermMask(item_name, MASK_OWNER))
                + "\n\tMASK_GROUP: " + permsList(llGetInventoryPermMask(item_name, MASK_GROUP))
                + "\n\tMASK_EVERYONE: " + permsList(llGetInventoryPermMask(item_name, MASK_EVERYONE))
                + "\n\tMASK_NEXT: " + permsList(llGetInventoryPermMask(item_name, MASK_NEXT))
            );
        }
    }
}
  1. Have an scripted add on installer that tries to give add-on-items with llGiveInventory to the attachment.
    Here’s the script I used for the installer:
// 'installer' script for BUG-5656
string permsList(integer perm)
{
    list perm_list;
    if(perm & PERM_ALL == PERM_ALL) perm_list += ["PERM_ALL"];
    else
    {
        // only need to include these details if PERM_ALL isn't set, really..
        if(perm & PERM_COPY) perm_list += ["PERM_COPY"];
        if(perm & PERM_MODIFY) perm_list += ["PERM_MODIFY"];
        if(perm & PERM_TRANSFER) perm_list += ["PERM_TRANSFER"];
        if(perm & PERM_MOVE) perm_list += ["PERM_MOVE"];
        integer others = perm & ~(PERM_COPY | PERM_MODIFY | PERM_TRANSFER | PERM_MOVE);
        if(others) perm_list += ["other :" + (string)others];
    }
    
    return (string)perm + " = " + llList2CSV(perm_list);
}

default
{
    on_rez(integer init)
    {
        llOwnerSay("Say the task_id of the object to give my inventory to.");
        llSay(0, "Touch me to get the list of inventory (and permissions)");
        llListen(0, "", llGetOwner(), "");
    }

    listen(integer channel, string name, key id, string msg)
    {
        key target = (key)llStringTrim(msg, STRING_TRIM);
        string item = llGetInventoryName(INVENTORY_OBJECT, 0);
        if(target != NULL_KEY)
        {
            llSay(0, "Giving item \"" + item + "\" to " + (string)target);
            llGiveInventory(target, item);
        }
    }
    
    
    touch_start(integer total_number)
    {
        integer item = llGetInventoryNumber(INVENTORY_ALL);
        while(item--)
        {
            string item_name = llGetInventoryName(INVENTORY_ALL, item);
            llSay(0, "Item: '" + item_name + "'"
                + "\n\tMASK_BASE: " + permsList(llGetInventoryPermMask(item_name, MASK_BASE))
                + "\n\tMASK_OWNER: " + permsList(llGetInventoryPermMask(item_name, MASK_OWNER))
                + "\n\tMASK_GROUP: " + permsList(llGetInventoryPermMask(item_name, MASK_GROUP))
                + "\n\tMASK_EVERYONE: " + permsList(llGetInventoryPermMask(item_name, MASK_EVERYONE))
                + "\n\tMASK_NEXT: " + permsList(llGetInventoryPermMask(item_name, MASK_NEXT))
            );
        }
    }
}
  1. Have the add-on-items inside the installer (notecards, animations) have the permissions no copy and transfer (same as the attachment),
    I used a single modify/transfer/no-copy object, named “no-copy object”.
  2. Give it away to the same other resident like before.
  3. Have the resident wear the attachment and rez the installer
    Before executing (5), I touched the attachment and installer to get the task_id of the attachment, and verify the permissions of ‘no-copy object’ in the installer:
    [15:38] BUG-5656 no-copy attachment: task_id: 1aec5f70-c68a-e97a-c7f5-116b861738c8
    [15:38] BUG-5656 no-copy attachment: Item: 'New Script'
    MASK_BASE: 532480 = PERM_TRANSFER, PERM_MOVE
    MASK_OWNER: 532480 = PERM_TRANSFER, PERM_MOVE
    MASK_GROUP: 0 =
    MASK_EVERYONE: 0 =
    MASK_NEXT: 532480 = PERM_TRANSFER, PERM_MOVE

[15:39] BUG-5656 installer: Item: 'no-copy object'
MASK_BASE: 548864 = PERM_MODIFY, PERM_TRANSFER, PERM_MOVE
MASK_OWNER: 548864 = PERM_MODIFY, PERM_TRANSFER, PERM_MOVE
MASK_GROUP: 0 =
MASK_EVERYONE: 0 =
MASK_NEXT: 548864 = PERM_MODIFY, PERM_TRANSFER, PERM_MOVE
[15:39] BUG-5656 installer: Item: 'New Script'
MASK_BASE: 581632 = PERM_COPY, PERM_MODIFY, PERM_TRANSFER, PERM_MOVE
MASK_OWNER: 581632 = PERM_COPY, PERM_MODIFY, PERM_TRANSFER, PERM_MOVE
MASK_GROUP: 0 =
MASK_EVERYONE: 0 =
MASK_NEXT: 581632 = PERM_COPY, PERM_MODIFY, PERM_TRANSFER, PERM_MOVE
5. Run the install and you get the error "Blocked by permissions" and the no copy add-on-items from the install-box are gone with the wind. The installer is empty, the attachment did not get the items.
At this point, I do not see the behavior you describe. The installer does produce a “Unable to give inventory: 'Blocked by permissions’.” script error, but ‘no-copy object’ remains in the installer’s task inventory (as seen by the build tool and when I touch the installer a 2nd time). If I drop the attachment, then say its task_id a second time, then “no-copy object” is transferred successfully.

It looks like the caveats list at https://wiki.secondlife.com/wiki/LlGiveInventory doesn't quite cover this case (giving a no-copy item to a no-copy attachment). I think allowing this transfer would be 'safe', since the attachment and transferred item have the same copy and transfer permissions, but I want to check with other Lindens to see if this would be reasonable to support.

@sl-service-account
Copy link
Author

Mo Noel commented at 2014-04-09T23:24:56Z

I was pretty sure the items vanished, actually two times while I tested. I still found the empty box in the inventory.

But right now I am not able to reproduce the vanishing either. The items stay in the inventory of the box. So, either it was some temporary event, or I my observation has an error (e.g. I mixed some test cases).

However. it would be nice and but consistant, if the transfer of no copy, transfer -items would work. ;)

@sl-service-account
Copy link
Author

Maestro Linden commented at 2014-04-10T17:22:30Z

We checked the code and found that this error message will always trigger when the item is no-copy and the target object is an attachment. The server code could be smarter about this, and allow the operation if the attachment was already no-copy with its folded permissions.

For the time being, I've added this behavior to the list of documented caveats:
https://wiki.secondlife.com/w/index.php?title=LlGiveInventory&diff=1189340&oldid=1187748

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant