Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1453778 Details for
Bug 1470310
gedit default save as location is / in 7.4
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
dist-git patch with the HOME chdir change
dbus-chdir.patch (text/plain), 5.18 KB, created by
David King
on 2018-06-22 15:59:54 UTC
(
hide
)
Description:
dist-git patch with the HOME chdir change
Filename:
MIME Type:
Creator:
David King
Created:
2018-06-22 15:59:54 UTC
Size:
5.18 KB
patch
obsolete
>From 2dd8dcc4b13351cd4fe2cf6c134e42ddc222f5ca Mon Sep 17 00:00:00 2001 >From: David King <dking@redhat.com> >Date: Fri, 22 Jun 2018 16:00:08 +0100 >Subject: [PATCH] Use HOME as dbus-launch working directory (#1470310) > >Resolves: #1470310 >--- > dbus-1.10.24-dbus-launch-chdir.patch | 80 ++++++++++++++++++++++++++++++++++++ > dbus.spec | 8 +++- > 2 files changed, 87 insertions(+), 1 deletion(-) > create mode 100644 dbus-1.10.24-dbus-launch-chdir.patch > >diff --git a/dbus-1.10.24-dbus-launch-chdir.patch b/dbus-1.10.24-dbus-launch-chdir.patch >new file mode 100644 >index 0000000..90099a4 >--- /dev/null >+++ b/dbus-1.10.24-dbus-launch-chdir.patch >@@ -0,0 +1,80 @@ >+From bb49885ffa9d9bdf7d30a072467c53a2866896e1 Mon Sep 17 00:00:00 2001 >+From: David King <dking@redhat.com> >+Date: Fri, 22 Jun 2018 14:57:00 +0100 >+Subject: [PATCH] dbus-launch: use HOME as the working directory >+ >+Session buses started as part of a systemd --user session are launched >+with the current working directory being the home directory of the user. >+Applications which are launched via dbus activation inherit the working >+directory from the session bus dbus-daemon. >+ >+When dbus-launch is used to start dbus-daemon, as is commonly the case >+with a session manager such as gnome-session, this leads to applications >+having a default working directory of "/", which is undesirable (as an >+example, the default directory in a GTK+ save dialog becomes "/"). >+ >+As an improvement, make dbus-launch use the value of the environment >+variable HOME, if it is set, as the current working directory. >+ >+Signed-off-by: David King <dking@redhat.com> >+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106987 >+Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1470310 >+--- >+ doc/dbus-launch.1.xml.in | 4 ++++ >+ tools/dbus-launch.c | 22 ++++++++++++++-------- >+ 2 files changed, 18 insertions(+), 8 deletions(-) >+ >+diff --git a/doc/dbus-launch.1.xml.in b/doc/dbus-launch.1.xml.in >+index 2fcea03f..55796f78 100644 >+--- a/doc/dbus-launch.1.xml.in >++++ b/doc/dbus-launch.1.xml.in >+@@ -51,6 +51,10 @@ backticks or the $() construct can be used to read information from >+ instance and print the address and PID of that instance to standard >+ output.</para> >+ >++<para>If the environment variable HOME is set, it is used as the current >++working directory. Otherwise, the root directory (<filename>/</filename>) is >++used.</para> >++ >+ <para>You may specify a program to be run; in this case, <command>dbus-launch</command> >+ will launch a session bus instance, set the appropriate environment >+ variables so the specified program can find the bus, and then execute the >+diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c >+index 425914a1..77ffe4cf 100644 >+--- a/tools/dbus-launch.c >++++ b/tools/dbus-launch.c >+@@ -622,17 +622,23 @@ babysit (int exit_with_session, >+ verbose ("babysitting, exit_with_session = %d, child_pid = %ld, read_bus_pid_fd = %d\n", >+ exit_with_session, (long) child_pid, read_bus_pid_fd); >+ >+- /* We chdir ("/") since we are persistent and daemon-like, and fork >+- * again so dbus-launch can reap the parent. However, we don't >+- * setsid() or close fd 0 because the idea is to remain attached >+- * to the tty and the X server in order to kill the message bus >+- * when the session ends. >++ /* We chdir () since we are persistent and daemon-like, either to $HOME >++ * to match the behaviour of a session bus started by systemd --user, or >++ * otherwise "/". We fork again so dbus-launch can reap the parent. >++ * However, we don't setsid() or close fd 0 because the idea is to >++ * remain attached to the tty and the X server in order to kill the >++ * message bus when the session ends. >+ */ >+ >+- if (chdir ("/") < 0) >++ s = getenv ("HOME"); >++ >++ if (s == NULL || *s == '\0') >++ s = "/"; >++ >++ if (chdir (s) < 0) >+ { >+- fprintf (stderr, "Could not change to root directory: %s\n", >+- strerror (errno)); >++ fprintf (stderr, "Could not change to working directory \"%s\": %s\n", >++ s, strerror (errno)); >+ exit (1); >+ } >+ >+-- >+2.17.1 >+ >diff --git a/dbus.spec b/dbus.spec >index 12732c7..891792a 100644 >--- a/dbus.spec >+++ b/dbus.spec >@@ -18,7 +18,7 @@ > Name: dbus > Epoch: 1 > Version: 1.10.24 >-Release: 10%{?dist} >+Release: 11%{?dist} > Summary: D-BUS message bus > > Group: System Environment/Libraries >@@ -42,6 +42,8 @@ Patch3: dbus-1.6.12-avoid-selinux-context-translation.patch > Patch4: dbus-1.10.24-dbus-send-man-page-typo.patch > # https://bugzilla.redhat.com/show_bug.cgi?id=1529044 > Patch5: 0001-bus-raise-fd-limits-before-dropping-privs.patch >+# https://bugzilla.redhat.com/show_bug.cgi?id=1470310 >+Patch6: dbus-1.10.24-dbus-launch-chdir.patch > > BuildRequires: libtool > BuildRequires: expat-devel >= %{expat_version} >@@ -142,6 +144,7 @@ in this separate package so server systems need not install X. > %patch3 -p1 > %patch4 -p1 > %patch5 -p1 >+%patch6 -p1 > > %build > # Avoid rpath. >@@ -370,6 +373,9 @@ popd > %{_includedir}/* > > %changelog >+* Fri Jun 22 2018 David King <dking@redhat.com> - 1:1.10.24-11 >+- Use HOME as dbus-launch working directory (#1470310) >+ > * Thu Feb 15 2018 David King <dking@redhat.com> - 1:1.10.24-7 > - Improve permissions on /run/dbus (#1510773) > >-- >1.8.3.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1470310
:
1453778
|
1477617