222
Flash Media Server Security
Permissions levels
Flash Media Server does not use explicit levels of privileges, but provides a way for the
application developer to implement system objects that the application code can not
compromise. Privileged access is simply the capability to directly access these special objects.
These system objects could be compromised if a system call explicitly evaluates randomly
accessed code on the caller's behalf. This should never be permitted.
Synchronous system calls
The protected object mechanism may be used to simulate system calls. The system introduces
a C-layer shim for each protected object to intercept the call and pass it to the underlying
user-defined object. Application code can never directly access or inspect how Flash Media
Server implements system objects. Developers can use this mechanism to disguise global
functions by renaming and storing them as a protected object, which will make it available
only through a wrapper. This technique for creating protected objects allows application
developers to hide built-in global functions or implement new global functions.
The following example demonstrates how a
secure.js
script protects the
load
function.
//Begin system.asc
var sysobj = {};
sysobj._load = load;
//Stash away the load function.
load = null;
//Make it unavailable unprivileged code.
sysobj.load = function(fname) {
//User defined code to validate/modify fname ...
return this._load(fname);
}
// Grab the global object.
var global = getGlobal();
// Now protect our sysobj and make it available as
// 'system' globally. Furthermore set its attributes
// such that it is read-only and not deletable.
global["system"] = protectObject(sysobj);
setAttributes( global, "system", false, true, true );
// Now add a global load() function for compatibility.
// Make it read-only and non-deletable.
global["load"] = function(path) { return system.load(path); }
setAttributes(global, "load", false, true, true);
// End system.asc
The act of an application calling the
load
function is always performed by the user-defined
system call.
Содержание FLASH MEDIA SERVER 2-MANAGING FLASH MEDIA...
Страница 1: ...Managing Flash Media Server...
Страница 6: ...6 Contents...
Страница 10: ...10 About This Manual...
Страница 84: ...84 Deploying Flash Media Server...