<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/lib-src, branch features/user-directory</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>New emacsclient option to either create or reuse an existing frame.</title>
<updated>2021-11-04T23:14:30+00:00</updated>
<author>
<name>Gregory Heytings</name>
</author>
<published>2021-11-04T23:14:30+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=2bcc2160c9f7f16c5e9cd815b8074de27f30896d'/>
<id>2bcc2160c9f7f16c5e9cd815b8074de27f30896d</id>
<content type='text'>
* doc/emacs/misc.texi (emacsclient Options): Document the new option.

* doc/man/emacsclient.1: Mention the new option (bug#51374).
* etc/NEWS: Mention the new option.

* lib-src/emacsclient.c (reuse_frame): New variable.
(longopts): New option.
(decode_options): Decode the new option.
(print_help_and_exit): Document the new option.
(main): Use the new option.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* doc/emacs/misc.texi (emacsclient Options): Document the new option.

* doc/man/emacsclient.1: Mention the new option (bug#51374).
* etc/NEWS: Mention the new option.

* lib-src/emacsclient.c (reuse_frame): New variable.
(longopts): New option.
(decode_options): Decode the new option.
(print_help_and_exit): Document the new option.
(main): Use the new option.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix compilation errors with MinGW64 GCC 11</title>
<updated>2021-10-24T17:45:56+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2021-10-24T17:45:56+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3bad61e1ac5244efb4fff6062763ea759e0aafec'/>
<id>3bad61e1ac5244efb4fff6062763ea759e0aafec</id>
<content type='text'>
* lib-src/ntlib.c (IS_DIRECTORY_SEP): Remove redundant macro.

* lib-src/ntlib.c (DEFER_MS_W32_H):
* nt/addpm.c (DEFER_MS_W32_H):
* nt/cmdproxy.c (DEFER_MS_W32_H):
* nt/ddeclient.c (DEFER_MS_W32_H):
* nt/preprep.c (DEFER_MS_W32_H):
* nt/runemacs.c (DEFER_MS_W32_H): Fix a typo.
* nt/Makefile.in (BASE_CFLAGS): Add -I switches to pick up
config.h and lib/attribute.h.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib-src/ntlib.c (IS_DIRECTORY_SEP): Remove redundant macro.

* lib-src/ntlib.c (DEFER_MS_W32_H):
* nt/addpm.c (DEFER_MS_W32_H):
* nt/cmdproxy.c (DEFER_MS_W32_H):
* nt/ddeclient.c (DEFER_MS_W32_H):
* nt/preprep.c (DEFER_MS_W32_H):
* nt/runemacs.c (DEFER_MS_W32_H): Fix a typo.
* nt/Makefile.in (BASE_CFLAGS): Add -I switches to pick up
config.h and lib/attribute.h.
</pre>
</div>
</content>
</entry>
<entry>
<title>Include &lt;config.h&gt; first in MS-Windows source</title>
<updated>2021-10-24T17:22:17+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2021-10-24T03:35:18+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=beb265450c01b3e3188f844ff0fb961d9df79071'/>
<id>beb265450c01b3e3188f844ff0fb961d9df79071</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Seccomp filter for newer GNU/Linux systems (Bug#51073).</title>
<updated>2021-10-09T17:39:31+00:00</updated>
<author>
<name>Philipp Stephani</name>
</author>
<published>2021-10-09T17:39:31+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=b497add9719dac16696f64d5a551d2b813f0c825'/>
<id>b497add9719dac16696f64d5a551d2b813f0c825</id>
<content type='text'>
On some systems, process startup calls prctl(PR_CAPBSET_READ) via
'cap_get_bound'.  We can just return EINVAL.

* lib-src/seccomp-filter.c (main): Add a rule for
prctl(PR_CAPBSET_READ, ...).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On some systems, process startup calls prctl(PR_CAPBSET_READ) via
'cap_get_bound'.  We can just return EINVAL.

* lib-src/seccomp-filter.c (main): Add a rule for
prctl(PR_CAPBSET_READ, ...).
</pre>
</div>
</content>
</entry>
<entry>
<title>Simplify socket symlink-attack checking</title>
<updated>2021-10-03T18:42:20+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2021-10-03T18:42:20+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=732c70a0d9d8db6a2fd77a52185f9a76743b05a9'/>
<id>732c70a0d9d8db6a2fd77a52185f9a76743b05a9</id>
<content type='text'>
This is a minor bugfix cleanup (Bug#33847#161).
* lib-src/emacsclient.c: Move "#include &lt;acl.h&gt;" to inside
"#ifdef SOCKETS_IN_FILE_SYSTEM", which is more accurate
and simpler than having a separate "#ifndef WINDOWSNT".
(O_PATH): Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a minor bugfix cleanup (Bug#33847#161).
* lib-src/emacsclient.c: Move "#include &lt;acl.h&gt;" to inside
"#ifdef SOCKETS_IN_FILE_SYSTEM", which is more accurate
and simpler than having a separate "#ifndef WINDOWSNT".
(O_PATH): Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>; Fix typos</title>
<updated>2021-09-03T11:05:32+00:00</updated>
<author>
<name>Stefan Kangas</name>
</author>
<published>2021-09-03T09:13:53+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=0cabf8bc363cdeace84523b251752c0aac32b31b'/>
<id>0cabf8bc363cdeace84523b251752c0aac32b31b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve compatibility with musl-libc (Bug#48789)</title>
<updated>2021-08-29T18:51:39+00:00</updated>
<author>
<name>Philipp Stephani</name>
</author>
<published>2021-08-29T18:51:39+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=8fa624b39b39569d280b06811dd81f1253559e17'/>
<id>8fa624b39b39569d280b06811dd81f1253559e17</id>
<content type='text'>
* lib-src/seccomp-filter.c (export_filter): Remove use of
nonstandard macro TEMP_FAILURE_RETRY.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib-src/seccomp-filter.c (export_filter): Remove use of
nonstandard macro TEMP_FAILURE_RETRY.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix libexec installation on NS (bug#50250)</title>
<updated>2021-08-29T12:09:21+00:00</updated>
<author>
<name>Alan Third</name>
</author>
<published>2021-08-29T12:07:54+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3065b6b73b72f8661d87e3335b348b347a9eb58d'/>
<id>3065b6b73b72f8661d87e3335b348b347a9eb58d</id>
<content type='text'>
* lib-src/Makefile.in (ns_applibexecdir): New variable.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib-src/Makefile.in (ns_applibexecdir): New variable.
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid using %n in emacsclient</title>
<updated>2021-08-22T14:23:54+00:00</updated>
<author>
<name>Omar Polo</name>
</author>
<published>2021-08-22T14:23:54+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=5b55659baebd314a00e0219e65e356a9acdbc40a'/>
<id>5b55659baebd314a00e0219e65e356a9acdbc40a</id>
<content type='text'>
* lib-src/emacsclient.c (local_sockname): Avoid using %n (bug#50155).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib-src/emacsclient.c (local_sockname): Avoid using %n (bug#50155).
</pre>
</div>
</content>
</entry>
<entry>
<title>Redo emacsclient socket symlink-attack checking</title>
<updated>2021-07-23T11:33:37+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2021-07-23T11:33:21+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=007744dd0404d6febca88b00c22981cc630fb8c0'/>
<id>007744dd0404d6febca88b00c22981cc630fb8c0</id>
<content type='text'>
* admin/merge-gnulib (GNULIB_MODULES): Add file-has-acl.
* lib/file-has-acl.c: New file, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib-src/emacsclient.c: Include acl.h, for file_has_acl.
(O_PATH): Default to O_SEARCH, which is good enough here.
(union local_sockaddr): New type.
(socket_status): Remove, replacing with ...
(connect_socket): New function.  All callers changed.
This function checks for ownership and permissions issues with the
parent directory of the socket file, instead of checking the
owner of the socket (which does not help security).
(socknamesize): Move to file scope.
(local_sockname): New arg S.  No need to pass socknamesize.
UID arg is now uid_t.  All callers changed.  Get file descriptor
of parent directory of socket, to foil some symlink attacks.
Do not follow symlinks to that directory.
(set_local_socket): Create the socket here instead of on
each attempt to connect it.  Fall back from XDG_RUNTIME_DIR
to /tmp only if the former fails due to ENOENT.  Adjust
permission-failure diagnostic to match changed behavior.

This addresses Bug#33847, which complained about emacsclient in a
safer XDG environment not connecting to an Emacs server running in
a less-safe enviroment outside XDG.  The patch fixes a
longstanding issue with emacsclient permission checking.
It’s ineffective to look at the permission of the socket file
itself; on some platforms, these permissions are ignored anyway.
What matters are the permissions on the parent directory of the
socket file, as these are what make symlink attacks possible.
Change the permissions check accordingly, and also refuse to
follow symlinks to that parent directory.  These changes make it
OK for emacsclient to fall back from XDG_RUNTIME_DIR to the
traditionally less-safe /tmp/emacsNNNN directories, since /tmp is
universally sticky nowadays.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* admin/merge-gnulib (GNULIB_MODULES): Add file-has-acl.
* lib/file-has-acl.c: New file, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib-src/emacsclient.c: Include acl.h, for file_has_acl.
(O_PATH): Default to O_SEARCH, which is good enough here.
(union local_sockaddr): New type.
(socket_status): Remove, replacing with ...
(connect_socket): New function.  All callers changed.
This function checks for ownership and permissions issues with the
parent directory of the socket file, instead of checking the
owner of the socket (which does not help security).
(socknamesize): Move to file scope.
(local_sockname): New arg S.  No need to pass socknamesize.
UID arg is now uid_t.  All callers changed.  Get file descriptor
of parent directory of socket, to foil some symlink attacks.
Do not follow symlinks to that directory.
(set_local_socket): Create the socket here instead of on
each attempt to connect it.  Fall back from XDG_RUNTIME_DIR
to /tmp only if the former fails due to ENOENT.  Adjust
permission-failure diagnostic to match changed behavior.

This addresses Bug#33847, which complained about emacsclient in a
safer XDG environment not connecting to an Emacs server running in
a less-safe enviroment outside XDG.  The patch fixes a
longstanding issue with emacsclient permission checking.
It’s ineffective to look at the permission of the socket file
itself; on some platforms, these permissions are ignored anyway.
What matters are the permissions on the parent directory of the
socket file, as these are what make symlink attacks possible.
Change the permissions check accordingly, and also refuse to
follow symlinks to that parent directory.  These changes make it
OK for emacsclient to fall back from XDG_RUNTIME_DIR to the
traditionally less-safe /tmp/emacsNNNN directories, since /tmp is
universally sticky nowadays.
</pre>
</div>
</content>
</entry>
</feed>
