Questions tagged [privileged-functions]

12 questions
4
votes
4 answers

is there a way to inject privileged methods after an object is constructed?

I'm trying to write fully automated unit tests in JavaScript and I'm looking for a way to read some private variables in various JS functions. I thought I recalled a way to inject privileged members into a function/object (and found an overwhelming…
patrickgamer
  • 515
  • 3
  • 15
2
votes
1 answer

Time-Stamp Counter Restriction

I want to check if the RDTSC instruction is available. There must be a Intel Pentium or newer processor and either the TSD flag in register CR4 is clear or it is set and the CPL equals 0. So, there's no problem to obtain the current privilege level…
0xbadf00d
  • 14,584
  • 15
  • 60
  • 93
2
votes
1 answer

Grant capabilities to a running process

An already running process needs a privileged instruction, like using the SO_RCVBUFFORCE socket option. This process is running as a normal user process. How to give capability/permission to this process? File-based capability settings are still a…
CsTamas
  • 3,803
  • 5
  • 28
  • 34
2
votes
2 answers

Is it possible to write a second non-static, selecting, priviledged function in a JQuery Plugin?

Almost all of the examples in the jQuery tutorials that I've read, usually use one major public function for their selecting plugin. When I say 'selecting' plugin, I mean one that is not simply a static function extended onto jQuery. For…
Mark Rogers
  • 90,043
  • 18
  • 79
  • 129
1
vote
3 answers

JavaScript: call of function with 'this.' does not reference to method in class

Here is an abstract JavaScript code sample that illustrates the situation that is causing me to ask a question here: function className (){ var private_variable = 0; function privateMethod(){ // Some irrelevant code. …
user1203684
  • 102
  • 2
  • 6
1
vote
1 answer

Is there any way to make use of information hiding while not wasting memory in Javascript prototypes?

I'm following Crockford's guide to private methods in Javascript, and I'm struggling with something. I'm trying to optimize this code function Container(param) { function dec() { if (secret > 0) { secret -= 1; …
memememe
  • 563
  • 3
  • 19
1
vote
1 answer

Java Font.createFont fails on Linux because of sun.misc.IOUtils.createTempFile("+~JF", ".tmp", null)

I've some code that ultimately calls Font.createFont. It works fine on server (centos something...) but on my Ubuntu box it dies because of this call that is inside Font.createFont final File tFile = AccessController.doPrivileged( …
gotch4
  • 12,473
  • 27
  • 100
  • 161
0
votes
1 answer

What is Silverlight/C# equivalent for Java's AccessController.doPrivileged

I'm trying to do some filing with Silverlight and have access the result from Javascript. It is easily done by Java applets through the AccessController.doPrivileged method, for example I can write methods such as SaveToFile or ReadFromFile which…
Sina Iravanian
  • 15,001
  • 4
  • 28
  • 44
0
votes
1 answer

Can I use privileged Docker container to spawn other containers on host?

I have a project that consists of dozens of dozens of containers per host. Until now, I have been using SSH/Ansible to spawn containers on my VMs on bootstrap, but now I would like a daemon to run on each host to start containers only when…
Adrien Luxey
  • 442
  • 1
  • 5
  • 15
0
votes
1 answer

SMJobBless Apple sample code keep asking password

I have downloaded the Apple's SMJobBless to execute privileged operation. It is working correctly. The only issue i'm facing is, every time on launch it asks for password. Is there a way to avoid this thing? Thanks
Dawood Mujib
  • 265
  • 2
  • 12
0
votes
4 answers

Privileged Methods - how to get values of properties that are passed to the function?

(example is from the book but I don't seem to get it) function User (properties){ for( var i in properties){ (function(){ this["get"+i] = function () { return properties[i];}; this["set"+i] =…
Bew Promtong
  • 61
  • 1
  • 2
  • 7
-2
votes
3 answers

privileged instruction in Java

Is it possible to make some privileged instructions (eg sti, cli) available via some Java's API? Why not? (Or if it's is, could you give me some outline/basic idea of how this would be implemented?) Thanks