chown -R 0:0 /Applications/Tunnelblick.app
#!/bin/sh
/Applications/Tunnelblick.app/Contents/Resources/installer 5
/bin/launchctl load -w /Library/LaunchDaemons/net.tunnelblick.tunnelblick.tunnelblickd.plist
Each configuration should look like this (for a configuration named "Foo bar"):Foo bar.tblk/Contents/Resources/config.ovpnThe "Resources" folder should also contain any other files needed by the configuration (such as key or certificate files), and those files should be referred to within the config.ovpn file without any path information. An optional "Info.plist" file may be included in the "Contents" folder.
tunnelblickd_hash=`/usr/bin/shasum -a 256 /Applications/Tunnelblick.app/Contents/Resources/tunnelblickd | awk '{print $1}'`
tunnelblickd_plist_hash=`/usr/bin/shasum -a 256 /Library/LaunchDaemons/net.tunnelblick.tunnelblick.tunnelblickd.plist | awk '{print $1}'`
/usr/bin/defaults write /Users/<user>/Library/Preferences/net.tunnelblick.tunnelblick.plist tunnelblickdHash -string ${tunnelblickd_hash}
/usr/bin/defaults write /Users/<user>/Library/Preferences/net.tunnelblick.tunnelblick.plist tunnelblickdPlistHash -string ${tunnelblickd_plist_hash}
/usr/sbin/chown <user>:staff /Users/<user>/Library/Preferences/net.tunnelblick.tunnelblick.plist*
#define INSTALLER_CLEAR_LOG 0x0001u
#define INSTALLER_COPY_APP 0x0002u
#define INSTALLER_SECURE_APP 0x0004u
// 0x0008u UNUSED, was "INSTALLER_HELPER_IS_TO_BE_SUID"
#define INSTALLER_SECURE_TBLKS 0x0010u
#define INSTALLER_CONVERT_NON_TBLKS 0x0020u
#define INSTALLER_MOVE_LIBRARY_OPENVPN 0x0040u
#define INSTALLER_INSTALL_FORCED_PREFERENCES 0x0080u
#define INSTALLER_REPLACE_DAEMON 0x0100u
#define INSTALLER_MOVE_NOT_COPY 0x1000u
#define INSTALLER_DELETE 0x2000u
Tunnelblick installer started 2023-06-13 18:26:01.617908. 1 arguments: 0x0005
getuid() = 0; getgid() = 0; geteuid() = 0; getegid() = 0
Unable to change ownership of /Applications/Tunnelblick.app from 0:80 to 0:0
Error was 'Operation not permitted'
Unable to change permissions from 755 to 744 on /Applications/Tunnelblick.app/Contents/Resources/atsystemstart
...
Unable to change permissions from 755 to 744 on /Applications/Tunnelblick.app/Contents/Resources/re-enable-network-services.sh
Unable to change ownership of /Applications/Tunnelblick.app/Contents/Resources/openvpn from 0:80 to 0:0
Error was 'Operation not permitted'
Tunnelblick installer started 2023-06-14 13:13:57.540977. 1 arguments: 0x0005
getuid() = 0; getgid() = 0; geteuid() = 0; getegid() = 0
Changed ownership of /Library/Application Support/Tunnelblick from 0:80 to 0:0
Created directory /Library/Application Support/Tunnelblick/Logs with owner 0:0 and permissions 755
Created directory /Library/Application Support/Tunnelblick/Tblks with owner 0:0 and permissions 755
Created directory /Library/Application Support/Tunnelblick/Mips with owner 0:0 and permissions 755
Created directory /Library/Application Support/Tunnelblick/expect-disconnect with owner 0:0 and permissions 755
Created directory /Library/Application Support/Tunnelblick/Users with owner 0:0 and permissions 755
Created directory /Library/Application Support/Tunnelblick/Users/root with owner 0:0 and permissions 755
Created or checked '/var/root/Library/Application Support/Tunnelblick'; owner = 0:80; permissions = 488
Created or checked '/var/root/Library/Application Support/Tunnelblick/Configurations'; owner = 0:80; permissions = 488
Need to replace and/or reload 'tunnelblickd':
tunnelblickdHashOK = NO
launchctlPlistHashOK = NO
tunnelblickdPlistOK = YES
socketOK = YES
Replaced /Library/LaunchDaemons/net.tunnelblick.tunnelblick.tunnelblickd.plist
Used launchctl to load tunnelblickd
Tunnelblick installer finished without error
stat of /tmp/tunnelblick-authorized-error failed
Error was 'No such file or directory'
stat of /tmp/tunnelblick-authorized-running failed
Error was 'No such file or directory'
Tunnelblick installer started 2023-06-14 13:13:58.098614. 1 arguments: 0x0010
getuid() = 0; getgid() = 0; geteuid() = 0; getegid() = 0
Created or checked '/var/root/Library/Application Support/Tunnelblick'; owner = 0:80; permissions = 488
Created or checked '/var/root/Library/Application Support/Tunnelblick/Configurations'; owner = 0:80; permissions = 488
Tunnelblick internal error: secureOneFolder: No user
Warning: Unable to secure all .tblk packages
Tunnelblick installer finished without error
stat of /tmp/tunnelblick-authorized-error failed
Error was 'No such file or directory'
stat of /tmp/tunnelblick-authorized-running failed
Error was 'No such file or directory'
Tunnelblick installer started 2023-06-14 13:13:57.540977. 1 arguments: 0x0005
getuid() = 0; getgid() = 0; geteuid() = 0; getegid() = 0
Changed ownership of /Library/Application Support/Tunnelblick from 0:80 to 0:0
Are you updating an old system? Tunnelblick has required 0:0 ownership for quite a while.
Created directory /Library/Application Support/Tunnelblick/Logs with owner 0:0 and permissions 755
Created directory /Library/Application Support/Tunnelblick/Tblks with owner 0:0 and permissions 755
Created directory /Library/Application Support/Tunnelblick/Mips with owner 0:0 and permissions 755
Created directory /Library/Application Support/Tunnelblick/expect-disconnect with owner 0:0 and permissions 755
Created directory /Library/Application Support/Tunnelblick/Users with owner 0:0 and permissions 755
Created directory /Library/Application Support/Tunnelblick/Users/root with owner 0:0 and permissions 755
The above is necessary and appropriate.
Created or checked '/var/root/Library/Application Support/Tunnelblick'; owner = 0:80; permissions = 488
Created or checked '/var/root/Library/Application Support/Tunnelblick/Configurations'; owner = 0:80; permissions = 488
This is because getuid() == 0. Tunnelblick 4.0.0 should avoid doing this.
Need to replace and/or reload 'tunnelblickd':
tunnelblickdHashOK = NO
launchctlPlistHashOK = NO
tunnelblickdPlistOK = YES
socketOK = YES
Replaced /Library/LaunchDaemons/net.tunnelblick.tunnelblick.tunnelblickd.plist
Used launchctl to load tunnelblickd
The above are necessary and appropriate.
Tunnelblick installer finished without error
stat of /tmp/tunnelblick-authorized-error failed
Error was 'No such file or directory'
stat of /tmp/tunnelblick-authorized-running failed
Error was 'No such file or directory'
These are flag files used by Tunnelblick when it runs installer. The errors can be ignored.
Tunnelblick installer started 2023-06-14 13:13:58.098614. 1 arguments: 0x0010
getuid() = 0; getgid() = 0; geteuid() = 0; getegid() = 0
Created or checked '/var/root/Library/Application Support/Tunnelblick'; owner = 0:80; permissions = 488
Created or checked '/var/root/Library/Application Support/Tunnelblick/Configurations'; owner = 0:80; permissions = 488
Tunnelblick internal error: secureOneFolder: No user
Warning: Unable to secure all .tblk packages
Since it doesn't know what user's .tblk packages should be secured, it can't secure them.
Tunnelblick installer finished without error
Well, for some definition of "error" : ). I'll look into why it doesn't complain about not securing the .tblks, though.
stat of /tmp/tunnelblick-authorized-error failed
Error was 'No such file or directory'
stat of /tmp/tunnelblick-authorized-running failed
Error was 'No such file or directory'
These are flag files used by Tunnelblick when it runs installer. The errors can be ignored.