I'm working on a script to create a single-line js file inside Firefox.app on Mac OS (/Applications/Firefox.app/Contents/MacOS/defaults/pref). The command is:
echo 'user_pref("security.tls.version.min", 1);' >> /Applications/Firefox.app/Contents/MacOS/defaults/pref/all-pcc.js
Since this is just one command, I'd like to avoid creating and pushing a separate script file, if possible. 

Just using root "/" as the directory seems to work, but the file that results is empty, though in the right place.

Thanks,
Ric
1 Comment   [ + ] Show Comment

Comments

  • One of my coworkers discovered that you can write the command to a [any-name].js file in this folder and it will run for all users. There's already a file, channel-prefs.js in there. I relented and wound up using a script and that worked. The browser now passes the poodlefix.com test. There is an error in my example, though. The string needs to begin with "echo 'user(..." not "echo 'user_pref(..." when used in a .js file in this directory. Originally, I was working on looping through the users to add a users.js file to file to ~/Library/Application Support/... but that was going beyond my limited bash scripting skills. runuser would have been great, but it doesn't appear to be implemented in the Mac OS shells. We have sudo -u [username] but I'm not sure how well that would work when run from the K1000. Any good KKE's or documents on writing KACE scripts for the Mac? Your conference sessions covered deployment quite well but there seems to be a lot of scripting issues that are unique to the Mac.
Please log in to comment

Answers

0
not positive about mac FF but windows that pref file was under every user and I had to change it in each users profile.

cd /D "%APPDATA%\Mozilla\Firefox\Profiles\*.default"
echo user_pref("security.tls.version.min", 1);>>prefs.js - See more at: http://www.itninja.com/question/k1000-k2000-poodle-and-sslv3#sthash.MNXeAP31.dpuf
cd /D "%APPDATA%\Mozilla\Firefox\Profiles\*.default"
echo user_pref("security.tls.version.min", 1);>>prefs.js

if that is the case for macs you should be able to use

runuser -l  userNameHere -c 'command'
to run as user so you hit the users /Applications/ folder vs the systems with the fix
Answered 11/24/2014 by: SMal.tmcc
Red Belt

Please log in to comment
This content is currently hidden from public view.
Reason: Removed by member request
For more information, visit our FAQ's.

0
One of my coworkers discovered that you can write the command to a [any-name].js file in this folder and it will run for all users. There's already a file, channel-prefs.js in there. I relented and wound up using a separate shell script (dependency) and that worked. The browser now passes the poodlefix.com test. 

There is an error in my example, though. The string needs to begin with "echo 'user(..." not "echo 'user_pref(..." when used in a .js file in this directory.  

Originally, I was working on looping through the users to add a users.js file to file to ~/Library/Application Support/... but that was going beyond my limited bash scripting skills. runuser would have been great, but it doesn't appear to be implemented in the Mac OS shells. We have sudo -u [username] but I'm not sure how well that would work when run from the K1000. 

Any good KKE's or documents on writing KACE scripts for the Mac? Your conference sessions covered deployment quite well but there seems to be a lot of scripting issues that are unique to the Mac.

Thanks!
Answered 11/24/2014 by: rgetter
Senior White Belt

  • The quotes were probably getting changed when the shell script was saved, which is why uploading the shell script worked. You can click the link to modify the XML of a script but for more complicated scripts I often find it is easier to upload. That way I can test the script by running it manually on my machine or a test machine and then upload it directly to KACE.
  • working on macs a lot more now so as I pick up tricks I will post them. There also are some of highly skilled mac folks on ITninja, I have picked up a lot of things reading thru posts from them.
Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share