Ardour  8.7-14-g57a6773833
Userdata.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Userdata
 
class  UserdataValue< T >
 
class  UserdataPtr
 
class  UserdataShared< C >
 
struct  UserdataSharedHelper< C, makeObjectConst >
 
struct  UserdataSharedHelper< C, true >
 
struct  StackHelper< C, byContainer, isEnum >
 
struct  StackHelper< T, false, false >
 
struct  StackHelper< T, false, true >
 
struct  Stack< T >
 
struct  Stack< T * >
 
struct  Stack< T *const >
 
struct  Stack< T const * >
 
struct  Stack< T const *const >
 
struct  Stack< T *const & >
 
struct  Stack< T & >
 
struct  RefStackHelper< C, byContainer >
 
struct  RefStackHelper< T, false >
 
struct  Stack< T const & >
 

Functions

void * getIdentityKey ()
 

Function Documentation

◆ getIdentityKey()

void* getIdentityKey ( )
inline

Return the identity pointer for our lightuserdata tokens.

LuaBridge metatables are tagged with a security "token." The token is a lightuserdata created from the identity pointer, used as a key in the metatable. The value is a boolean = true, although any value could have been used.

Because of Lua's dynamic typing and our improvised system of imposing C++ class structure, there is the possibility that executing scripts may knowingly or unknowingly cause invalid data to get passed to the C functions created by LuaBridge. In particular, our security model addresses the following:

Notes:

  1. Scripts cannot create a userdata (ignoring the debug lib).
  2. Scripts cannot create a lightuserdata (ignoring the debug lib).
  3. Scripts cannot set the metatable on a userdata.
  4. Our identity key is a unique pointer in the process.
  5. Our metatables have a lightuserdata identity key / value pair.
  6. Our metatables have "__metatable" set to a boolean = false.
  7. Our lightuserdata is unique.

Definition at line 63 of file Userdata.h.