Tag Archives: leopard

Leopard, sudo, proxies and environment variables

Wow, just ran into this problem. The sudoers file on leopard has some new settings as default, which means that if you have environment variables set, they will not be inherited as superuser unless they are explicitly set.

# Defaults specification
Defaults        env_reset
Defaults        env_keep += "BLOCKSIZE"
Defaults        env_keep += "COLORFGBG COLORTERM"
Defaults        env_keep += "__CF_USER_TEXT_ENCODING"
Defaults        env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE"
Defaults        env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME"
Defaults        env_keep += "LINES COLUMNS"
Defaults        env_keep += "LSCOLORS"
Defaults        env_keep += "SSH_AUTH_SOCK"
Defaults        env_keep += "TZ"
Defaults        env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY"
Defaults        env_keep += "EDITOR VISUAL"

At work I am behind a proxy, commands run as root from the terimnal are not inheriting my terminals proxy settings. MacPorts was failing.

There are 2 solutions.

Explicitly state the environment variable in the command line:

$ sudo env http_proxy=http://proxy.url:port/ command

or, add the environmant variable "http_proxy" to the list in /etc/sudoers.

Connecting Leopard to a Linux VNC Server

Leopard has a nifty VNC implementation built right into the OS, you can share your screen from the Sharing preferences and connect to it using any VNC client. And there is a VNC client built right into the finder ⌘-K (Connect to server) allows you to enter in a vnc server in the form vnc://server:port.

But if you try and connect to an up to date Xvnc server it will probably fail, you need to specify that your VNC server uses the VNC protocol 3.3 for backwards compatibility, the command option is simply “-Protocol3.3” you will now be able to connect to your Xvnc server from Leopard using the built in viewer.

If you were to follow my earlier instruction for a GDM VNC Server then simply add this option to: /etc/xinetd.d/vnc

UPDATE #1

You will notice that the connecting to server box doesn’t go away, this is because Apple does not like the option: -securitytypes=none

Setup a password file using vncpasswd and remove the above option and add the option:

-rfbauth=/path/to/vncpasswd_file