Safe loading of dynamic user-defined code
AssigneeSap SE
InventorBenjamin Heilbrunn
Life of this patent
Estimating the term…
Abstract
Disclosed herein are system, method, and computer program product embodiments for dynamically loading user-defined code into a multi-user system. An embodiment operates by receiving an action represented by source code including one or more elements of a programming language from a user of a multi-user system; compiling the source code into compiled code, the compiling further including modifying the action based on a filter including at least one of the one or more elements so that the compiled code represents the modified action; and executing the complied code on the multi-user system.
Claims22
A computer implemented method, comprising:
- receiving, by at least one processor, an action represented by source code including one or more elements and a first element of a programming language from a user of a multi-user system, wherein the user is associated with a privilege level and a second user of the multi-user system is associated with a second privilege level;
- compiling, by the at least one processor, the source code, the compiling further comprising:
- selecting, based on the privilege level, a pre-defined list of unauthorized elements, wherein the second privilege level is associated with a second pre-defined list of unauthorized elements, wherein a number of unauthorized elements in the pre-defined list of unauthorized elements is different from a second number of unauthorized elements in the second pre-defined list of unauthorized elements, and wherein the number of unauthorized elements in the pre-defined list of unauthorized elements is based on the privilege level;
- comparing the one or more elements and the first element to the pre-defined list of unauthorized elements;
- determining that the first element matches a first unauthorized element of the pre-defined list;
- removing the first element from the source code in response to the determining;
- generating partial compiled code that represents a modified version of the action that includes the one or more elements and does not include the first element;
- and
- executing, by the at least one processor, the partial compiled code on the multi-user system,
- wherein at least one of the receiving, compiling, and executing are performed by one or more computers.
A multi-user system, comprising:
- a memory;
- and
- at least one processor coupled to the memory and configured to:
- receive an action represented by source code including one or more elements and a first element of a programming language from a user of the multi-user system, wherein the user is associated with a privilege level and a second user of the multi-user system is associated with a second privilege level;
- compiling, by the at least one processor, the source code, the compiling further comprising:
- compile the source code into partial compiled code;
- and
- execute the partial compiled code on the multi-user system,
- wherein to compile the source code into the partial compiled code, the at least one processor is configured to:
- select, based on the privilege level, a pre-defined list of unauthorized elements, wherein the second privilege level is associated with a second pre-defined list of unauthorized elements, and wherein a number of unauthorized elements in the pre-defined list of unauthorized elements is different from a second number of unauthorized elements in the second pre-defined list of unauthorized elements, and wherein the number of unauthorized elements in the pre-defined list of unauthorized elements is based on the privilege level;
- compare the one or more elements and the first element to the pre-defined list of unauthorized elements;
- determine that the first element matches a first unauthorized element of the pre-defined list;
- and
- remove the first element from the source code in response to the determining;
- and
- generating the partial compiled code that represents a modified version of the action that includes the one or more elements and does not include the first element.
A non-transitory tangible computer-readable device having instructions stored thereon that, when executed by at least one computing device, causes the at least one computing device to perform operations comprising:
- receiving an action represented by source code including one or more elements and a first element of a programming language from a user of a multi-user system, wherein the user is associated with a privilege level and a second user of the multi-user system is associated with a second privilege level;
- compiling the source code, the compiling further comprising:
- selecting, based on the privilege level, a pre-defined list of unauthorized elements, wherein the second privilege level is associated with a second pre-defined list of unauthorized elements, and wherein a number of unauthorized elements in the pre-defined list of unauthorized elements is different from a second number of unauthorized elements in the second pre-defined list of unauthorized elements, and wherein the number of unauthorized elements in the pre-defined list of unauthorized elements is based on the privilege level;
- comparing the one or more elements and the first element to the pre-defined list of unauthorized elements;
- determining that the first element of the one or more elements matches a first unauthorized element of the pre-defined list;
- removing the first element from the source code in response to the determining;
- generating partial compiled code that represents a modified version of the action that includes the one or more elements and does not include the first element;
- and
- executing the partial compiled code on the multi-user system.
Dependencies are inferred from the claim text.