|
楼主 |
发表于 2011-5-5 19:50:08
|
显示全部楼层
搜了一下网络,没找到补丁,所以自己写了个倒退补丁。。。
我把所有脑残的 DetectRunningAsRoot 函数定义全部删除,是否使用 root 不应该由软件来决定,而是掌握在我们自己手中。
- void BrowserMainPartsGtk::DetectRunningAsRoot() {
- if (geteuid() == 0) {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- gfx::GtkInitFromCommandLine(command_line);
- // Get just enough of our resource machinery up so we can extract the
- // locale appropriate string. Note that the GTK implementation ignores the
- // passed in parameter and checks the LANG environment variables instead.
- ResourceBundle::InitSharedInstance("");
- std::string message = l10n_util::GetStringFUTF8(
- IDS_REFUSE_TO_RUN_AS_ROOT,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
- GtkWidget* dialog = gtk_message_dialog_new(
- NULL,
- static_cast<GtkDialogFlags>(0),
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- "%s",
- message.c_str());
- message = l10n_util::GetStringFUTF8(
- IDS_REFUSE_TO_RUN_AS_ROOT_2,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
- gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
- "%s",
- message.c_str());
- message = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME);
- gtk_window_set_title(GTK_WINDOW(dialog), message.c_str());
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
- exit(EXIT_FAILURE);
- }
- }
复制代码 |
|