Add time to an OS X Parental Controls managed account with a shell command

3

2

I imagine that there's a simple counter for daily usage, and that this can be modified, but I've been unable to find any documentation on where or how to do this. Does anyone know?

Sarah

Posted 2012-01-25T16:07:58.643

Reputation: 324

You want to "consume" allowed time from the command line? – Daniel Beck – 2012-01-25T16:09:52.807

That too, but primarily add time, eg. consume "negative time." – Sarah – 2012-01-25T16:14:30.567

Aren't you queried for an administrator password to grant an exception when the available time has been used up? – Daniel Beck – 2012-01-25T16:23:06.623

I will check that out, but I don't see how it helps as I've only a shell connection to the machine, which is on a low bandwidth connection. – Sarah – 2012-01-25T17:02:12.673

I'm asking because researching parental controls internals is pretty time consuming. I assume it's dynamically calculated from the same data source as used for application logs, but haven't had the time to fake enough usage to remove it again. Maybe you have more luck in directly editing the SQLite database.

– Daniel Beck – 2012-01-25T17:20:06.233

Thank you for the link, I will try to see if I can make anything from that, but it seems a bit hairy. – Sarah – 2012-01-25T18:06:20.947

I have now checked the SQLITE database, but the only table that seemed relevant - ZAPPLICATION - had no impact on the timer. (I dropped all records) – Sarah – 2012-01-25T19:27:49.970

Answers

2

The file:

Library/Application Support/Apple/ParentalControls/Users/user/com.apple.familycontrols.overrides.plist

appears to contain a key/integer pair "duration" that entirely controls the remaining time for the current day.

The syntax is quite easy to understand, although how the system react to changes in the file is not quite clear. For instance, the timer in the username menu breaks if edited while the user is logged in. Everything does appear to get reloaded on login, however, so it should be easy to extend the time remotely via shell once it has run out. Beware, the time format is wonky, though. I've only managed to test three digit numbers for duration, and they appear to be interpreted as Minute Second Second.

EDIT> The above theories are not correct. It appears that the value is actually a value in seconds, but it must be added to some expirytime that is not in this file, but probably in the individual binary plist files stored under the same hierarchy in year/month/day, but it is very hard to decipher these.

Sarah

Posted 2012-01-25T16:07:58.643

Reputation: 324