Thanks all of you, I'll try it now.<br><br>Thanks again.<br><br><br><div>--<br>
<div>&nbsp;Best Regards,<br>
<br></div>
</div><br><pre><br>在2010-05-13&nbsp;00:26:45,"Thiago&nbsp;Macieira"&nbsp;&lt;thiago@kde.org&gt;&nbsp;写道:
&gt;Em&nbsp;Quarta-feira&nbsp;12&nbsp;Maio&nbsp;2010,&nbsp;às&nbsp;18:02:10,&nbsp;Rémi&nbsp;Denis-Courmont&nbsp;escreveu:
&gt;&gt;&nbsp;Le&nbsp;mercredi&nbsp;12&nbsp;mai&nbsp;2010&nbsp;14:04:40&nbsp;Thiago&nbsp;Macieira,&nbsp;vous&nbsp;avez&nbsp;écrit&nbsp;:
&gt;&gt;&nbsp;&gt;&nbsp;Em&nbsp;Quarta-feira&nbsp;12.&nbsp;Maio&nbsp;2010,&nbsp;às&nbsp;12.13.06,&nbsp;danny&nbsp;escreveu:
&gt;&gt;&nbsp;&gt;&nbsp;&gt;&nbsp;Dear&nbsp;All,
&gt;&gt;&nbsp;&gt;&nbsp;&gt;&nbsp;
&gt;&gt;&nbsp;&gt;&nbsp;&gt;&nbsp;I&nbsp;have&nbsp;a&nbsp;program&nbsp;run&nbsp;as&nbsp;root,&nbsp;but&nbsp;I&nbsp;need&nbsp;get&nbsp;information&nbsp;from&nbsp;GVFS
&gt;&gt;&nbsp;&gt;&nbsp;&gt;&nbsp;which&nbsp;is&nbsp;on&nbsp;the&nbsp;session&nbsp;bus,&nbsp;and&nbsp;it&nbsp;shows&nbsp;"failed&nbsp;to&nbsp;connect&nbsp;the
&gt;&gt;&nbsp;&gt;&nbsp;&gt;&nbsp;session&nbsp;bus"&nbsp;while&nbsp;I&nbsp;run&nbsp;the&nbsp;test&nbsp;program,&nbsp;and&nbsp;it&nbsp;could&nbsp;not&nbsp;get&nbsp;any
&gt;&gt;&nbsp;&gt;&nbsp;&gt;&nbsp;information&nbsp;from&nbsp;the&nbsp;GVFS.
&gt;&gt;&nbsp;&gt;&nbsp;&gt;&nbsp;
&gt;&gt;&nbsp;&gt;&nbsp;&gt;&nbsp;Could&nbsp;I&nbsp;access&nbsp;the&nbsp;session&nbsp;bus&nbsp;in&nbsp;my&nbsp;"root"&nbsp;program?
&gt;&gt;&nbsp;&gt;&nbsp;
&gt;&gt;&nbsp;&gt;&nbsp;No.
&gt;&gt;&nbsp;&gt;&nbsp;
&gt;&gt;&nbsp;&gt;&nbsp;The&nbsp;user's&nbsp;session&nbsp;bus&nbsp;requires&nbsp;the&nbsp;user's&nbsp;UID.&nbsp;Your&nbsp;program&nbsp;needs&nbsp;to
&gt;&gt;&nbsp;&gt;&nbsp;drop&nbsp;privileges&nbsp;before&nbsp;connecting.
&gt;&gt;&nbsp;
&gt;&gt;&nbsp;I&nbsp;think,&nbsp;in&nbsp;principles,&nbsp;the&nbsp;root&nbsp;process&nbsp;could&nbsp;just&nbsp;set&nbsp;its&nbsp;effective&nbsp;UID
&gt;&gt;&nbsp;to&nbsp;the&nbsp;user,&nbsp;while&nbsp;establishing&nbsp;the&nbsp;DBus&nbsp;connection,&nbsp;then&nbsp;back&nbsp;to&nbsp;root.&nbsp;It
&gt;&gt;&nbsp;does&nbsp;not&nbsp;need&nbsp;to&nbsp;drop&nbsp;the&nbsp;root&nbsp;privileges.
&gt;
&gt;Well,&nbsp;setting&nbsp;the&nbsp;EUID&nbsp;is&nbsp;dropping&nbsp;the&nbsp;privileges,&nbsp;even&nbsp;if&nbsp;you&nbsp;can&nbsp;still&nbsp;take&nbsp;
&gt;them&nbsp;back&nbsp;later&nbsp;:-)
&gt;
&gt;--&nbsp;
&gt;Thiago&nbsp;Macieira&nbsp;-&nbsp;thiago&nbsp;(AT)&nbsp;macieira.info&nbsp;-&nbsp;thiago&nbsp;(AT)&nbsp;kde.org
&gt;&nbsp;&nbsp;Senior&nbsp;Product&nbsp;Manager&nbsp;-&nbsp;Nokia,&nbsp;Qt&nbsp;Development&nbsp;Frameworks
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PGP/GPG:&nbsp;0x6EF45358;&nbsp;fingerprint:
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E067&nbsp;918B&nbsp;B660&nbsp;DBD1&nbsp;105C&nbsp;&nbsp;966C&nbsp;33F5&nbsp;F005&nbsp;6EF4&nbsp;5358
</pre><br><br><span title="neteasefooter"/><hr/>
<a href="http://ym.163.com/?from=od3" target="_blank">网易为中小企业免费提供企业邮箱(自主域名)</a>
</span>