From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71969: [PATCH] Support interactive D-Bus authentication Date: Sat, 06 Jul 2024 17:24:45 +0200 Message-ID: <877cdy1r2a.fsf@gmx.de> References: <877cdzklbd.fsf@stebalien.com> <87o77a20s6.fsf@gmx.de> <87frsm1sht.fsf@gmx.de> <86v81i36vh.fsf@gnu.org> Reply-To: Michael Albinus Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24046"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71969@debbugs.gnu.org, steven@stebalien.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 06 17:26:29 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sQ7Iz-00062N-Eg for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jul 2024 17:26:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQ7IX-0007ga-Oc; Sat, 06 Jul 2024 11:26:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQ7IV-0007cF-Gd for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 11:25:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sQ7IV-0004ME-8X for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 11:25:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sQ7IY-00047b-UN for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 11:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jul 2024 15:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71969 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71969-submit@debbugs.gnu.org id=B71969.172027951415733 (code B ref 71969); Sat, 06 Jul 2024 15:26:02 +0000 Original-Received: (at 71969) by debbugs.gnu.org; 6 Jul 2024 15:25:14 +0000 Original-Received: from localhost ([127.0.0.1]:46578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQ7Ha-00045R-Jp for submit@debbugs.gnu.org; Sat, 06 Jul 2024 11:25:14 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:33365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQ7HX-00044o-AC for 71969@debbugs.gnu.org; Sat, 06 Jul 2024 11:25:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1720279487; x=1720884287; i=michael.albinus@gmx.de; bh=XR9NtQdSv7dlfDI2SIBEUauulETwSqWs5E7o0Us/lAQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=GHouT+7xNUTmghm40YWMpPqBKEr1/A0KmAEHIxOUSk53d8K1fHNy6zTDQcihSPoU 6AKz+ORLOC7irTB8lzDxM5qi08gCa3Xp0CVtm4hsDkp3NClELFpKjenNxzNd5zKBV p9QnAptwf/9xo4hL3G1yKGnYzLS15FdVorjxma3irXg62bsbPbXbw8Tc4CkjFJriL yadDkTHhRRqh7Hz8hywosuxoNFyM6AiMS+sT0vRglFDkNnsXy/pKfc/Y3zYAuCgop 7Aw9mbrv14aPc35EJcmcJH1wgpxylxLzgjQDduzDi6JWrqgaMD/UZYIQprVWjAFWc 7mtl1OC//aWspPYLxQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N3se8-1sHLos3bgu-012iX9; Sat, 06 Jul 2024 17:24:47 +0200 In-Reply-To: <86v81i36vh.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 06 Jul 2024 17:57:54 +0300") X-Provags-ID: V03:K1:L/h3HoadxsAiS2B8hFqzrJzMK6GatW5gHIwcrT7QbhM8y4F1uhI 3GP6+O6GqFlpEgW+3E8O8eikPX/oVWI6jwDR+VTxC+/ViO4dlFyL5nYXgIQDNExl6wzKywh eHGzDU75/r0pC4c16Dqh/5ufK5CkWSEmlpcqf+ZZ95/7XX3AEGGBLHXmzspSoPTPGwFgJMw hVJp6WQB9lI19Y6QN2BZw== UI-OutboundReport: notjunk:1;M01:P0:73ZwmCKs2Fk=;GG1IqFFQxM2Q6cMk5/ppAwOFZIM uNJlxs9WQTfQ1LkEC4HPAOBNtnPNOlaohpyawkSn+koGSVVGsjc1g2O6RAGNCzFlyNxoh5/R3 rhDhLGhL130edl2bKuV6l7ztgspoCCcuVcfp2lUrxO8JgUThTcSZWzv3jKgjA9wQxR4ds4qKQ hj8CKU/DZpznmaOMPha9s4AF24YIjkjbc8NOM/TLYr2cSMWPVmkUPIuZIt4bPXNVzWv38u+HF 7gJ49jmtzacUB8Y0L16/snmJwZP+L9uAnPHZlhu0FKHF4Q901HzX+7Xx4MKY5nzhD3ad9jdrW NIUBoRSda8c6waA5cEAc+lIEyxDVvSfTHGV694BTUlt98LoO4fEheB4hIaGzhEpRi4zQZ5cQ6 yNNQdJmUQMsIh0Tqb43pcRdrvZOv8Ls1vnzTLosL87ubB5K+FahiS6kdfrxC9T4xGU5sb4k03 rIFmCpNyRquRCyXFmvc8Y2R2YSyG9G/RliOA+MXxTzwN4D69xsZHE4BkaJ9UEFHPvv3Aqyzdy hWAw6aEyfQj4IpnPXJc0+P1c60aQDX/GGpG3CuRjnFDcfGG7Hz9t9qVIKRxcCJ8817LjUuZ+t HswgkiNdgbVVjLc5G0P9rAeV6TjHozvXyRyK+ccMP1OkQo4NJYJrah34uukkmN1pCZ5qTZniv 0+jOh1MZfkdYJpPWrIba93gplgTFxjN609fEADiihWEYzLHPsPgx3nWRZ0kph3TE1JwEAsUPP lKSUT6huus52I7yIXNh5UXBTzrB8kLG1zJvj4Taqka2fCDWOo3QOiW834IaK8mBdjitEZADu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288506 Archived-At: Eli Zaretskii writes: Hi Eli, >> > Furthermore, does exist dbus_message_set_allow_interactive_authorizat= ion >> > "since ever"? Or shall we check for the existence in configure.ac, li= ke >> > we do it with other dbus_* functions? >> >> I've just checked the dbus git repo. >> dbus_message_set_allow_interactive_authorization was added in >> D-Bus 1.8.10, so we need a check in configure.ac. > > Is this really a build-time condition, not a run-time condition? Can > we know in advance which version of D-Bus will be used at run time? Well, we must call this function, or not, in dbusbind.c. Of course it depends on the libdbus-1.so version whether it is available at runtime. But we must know already at build time, whether the function is offered via /usr/include/dbus-1.0/dbus/dbus-message.h. Otherwise, the function call would result in a compiler error. So it is a build time dependency. We do a similar check for other D-Bus functions in configure.ac, see this snippet: =2D-8<---------------cut here---------------start------------->8--- AC_CHECK_FUNCS([dbus_watch_get_unix_fd \ dbus_type_is_valid \ dbus_validate_bus_name \ dbus_validate_path \ dbus_validate_interface \ dbus_validate_member]) =2D-8<---------------cut here---------------end--------------->8--- And in dbusbind.c, we have then code like =2D-8<---------------cut here---------------start------------->8--- #if HAVE_DBUS_WATCH_GET_UNIX_FD /* TODO: Reverse these on w32, which prefers the opposite. */ int fd =3D dbus_watch_get_unix_fd (watch); if (fd =3D=3D -1) fd =3D dbus_watch_get_socket (watch); #else int fd =3D dbus_watch_get_fd (watch); #endif =2D-8<---------------cut here---------------end--------------->8--- Of course there is the risk, that Emacs is compiled with a function call (based on an include file), which does not exist at runtime, because the Emacs program runs somewhere else. OTOH, D-Bus 1.8.10 was tagged in the D-Bus git on "Thu Nov 6 15:39:51 2014 +0000". The likelihood, that we run into problems, is small, and the check in configure.ac is just "to be sure". Best regards, Michael.