[kde-china] kde4下为什么su到root用户后无法运行图形程序?

vvoody wxj.g.sh在gmail.com
星期一 十一月 23 13:23:39 CET 2009


2009/11/23 Grissiom <chaos.proton在gmail.com>:
> 2009/11/23 翁学天 <wengxt在gmail.com>
>>
>> 如果是su操作的话,而不是su -,应该会继承环境变量的
>>
>> 其实我这里就算su -过去,也会得到以下结果,不知道为啥display也传过去了……可能和发行版有什么关系……
>> No protocol specified
>> kwrite: cannot connect to X server :0
>> 这个才是错误
>> 不过话说回来,我这里倒是无论kde,gtk程序都不能运行,错误相同,图形界面都要靠kdesu
>
> 试了一下:
> ~% su
> /home/grissiom# kate
> No protocol specified
> kate: cannot connect to X server :0.0
Kate能打开。

> ~% su -
> Password:
> darkstar# kate
> kate: cannot connect to X server
和你一样。但export DISPLAY=:0,然后原普通用户xhost +后就可以打开了。

> 两个的错误信息不一样哦~
> 发行版是 Slackware ;P
>
Slackware 13.0 KDE 4.2.4

>>
>> 2009/11/23 vvoody <wxj.g.sh在gmail.com>
>>>
>>> 不对阿,普通用户su -之后root都不能运行X程序(无论gtk、kde)阿,因为DISPLAY没设置阿,会提示:
>>> root在slackware:~# xeyes
>>> Error: Can't open display:
>>>
>>>>>> root在slackware:~# firefox
>>> Error: no display specified
>>>
>>> root得export DISPLAY=:0.0,普通用户xhost +后root才能运行X程序。lz su后能运行X程序是什么情况?
>>>
>
> --
> Cheers,
> Grissiom
>
> _______________________________________________
> kde-china mailing list
> kde-china在kde.org
> https://mail.kde.org/mailman/listinfo/kde-china
>
>



-- 
Free as freedom, slack as Slackware.
vvoody


关于邮件列表 kde-china 的更多信息