Comment 13 for bug 310126

Revision history for this message
Anders Kaseorg (andersk) wrote :

edit_config() {
    backup_xorg_conf || return 1

    xorg_conf_tmp=$(mktmp "/tmp/xorg.conf.XXXXXXXX")
    cp /etc/X11/xorg_conf ${xorg_conf_tmp}
    zenity --text-info --editable --filename=${xorg_conf_tmp} --width=640 --height=480 > "/etc/X11/xorg.conf"
}

There is a typo on the cp line: /etc/X11/xorg_conf should be /etc/X11/xorg.conf .

Also, this will cause xorg.conf to be overwritten with an empty file if the user hits Esc at the zenity prompt. The last two lines should be replaced with
    zenity --text-info --editable --filename=/etc/X11/xorg.conf --width=640 --height=480 > "$xorg_conf_tmp" && \
      mv "$xorg_conf_tmp" /etc/X11/xorg.conf

Finally, are you SURE that a malicious user can’t gain any kind of unauthorized access by editing xorg.conf?