<feed xmlns='http://www.w3.org/2005/Atom'>
<title>unit.git/auto/isolation, branch 1.29.0-1</title>
<subtitle>Universal Web Application Server</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/'/>
<entry>
<title>Fixed main() prototypes in auto tests.</title>
<updated>2022-10-28T02:17:31+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2022-10-27T23:17:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=8f0dd9478e164121e31bebaf1c10dd6e537d2918'/>
<id>8f0dd9478e164121e31bebaf1c10dd6e537d2918</id>
<content type='text'>
Future releases of GCC are planning to remove[0] default support for
some old features that were removed from C99 but GCC still accepts.

We can test for these changes by using the following -Werror=
directives

  -Werror=implicit-int
  -Werror=implicit-function-declaration
  -Werror=int-conversion
  -Werror=strict-prototypes
  -Werror=old-style-definition

Doing so revealed an issue with the auto/ tests in that the test
programs always define main as

  int main()

rather than

  int main(void)

which results in a bunch of errors like

build/autotest.c:3:23: error: function declaration isn't a prototype [-Werror=strict-prototypes]
    3 |                   int main() {
      |                       ^~~~
build/autotest.c: In function 'main':
build/autotest.c:3:23: error: old-style function definition [-Werror=old-style-definition]

The fix was easy, it only required fixing the main prototype with

  find -type f -exec sed -i 's/int main() {/int main(void) {/g' {} \;

Regardless of these upcoming GCC changes, this is probably a good thing
to do anyway for correctness.

[0]: https://fedoraproject.org/wiki/Changes/PortingToModernC

Link: &lt;https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/CJXKTLXJUPZ4F2C2VQOTNMEA5JAUPMBD/&gt;
Link: &lt;https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/6SGHPHPAXKCVJ6PUZ57WVDQ5TDBVIRMF/&gt;
Reviewed-by: Alejandro Colomar &lt;alx@nginx.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Future releases of GCC are planning to remove[0] default support for
some old features that were removed from C99 but GCC still accepts.

We can test for these changes by using the following -Werror=
directives

  -Werror=implicit-int
  -Werror=implicit-function-declaration
  -Werror=int-conversion
  -Werror=strict-prototypes
  -Werror=old-style-definition

Doing so revealed an issue with the auto/ tests in that the test
programs always define main as

  int main()

rather than

  int main(void)

which results in a bunch of errors like

build/autotest.c:3:23: error: function declaration isn't a prototype [-Werror=strict-prototypes]
    3 |                   int main() {
      |                       ^~~~
build/autotest.c: In function 'main':
build/autotest.c:3:23: error: old-style function definition [-Werror=old-style-definition]

The fix was easy, it only required fixing the main prototype with

  find -type f -exec sed -i 's/int main() {/int main(void) {/g' {} \;

Regardless of these upcoming GCC changes, this is probably a good thing
to do anyway for correctness.

[0]: https://fedoraproject.org/wiki/Changes/PortingToModernC

Link: &lt;https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/CJXKTLXJUPZ4F2C2VQOTNMEA5JAUPMBD/&gt;
Link: &lt;https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/6SGHPHPAXKCVJ6PUZ57WVDQ5TDBVIRMF/&gt;
Reviewed-by: Alejandro Colomar &lt;alx@nginx.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Rejecting non-Linux pivot_root(2).</title>
<updated>2022-08-02T17:50:10+00:00</updated>
<author>
<name>Alejandro Colomar</name>
<email>alx.manpages@gmail.com</email>
</author>
<published>2022-08-02T17:39:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=418bc208d08dbc4a0a3511e503c946ab6ac71c39'/>
<id>418bc208d08dbc4a0a3511e503c946ab6ac71c39</id>
<content type='text'>
Some non-Linux systems implement pivot_root(2), even if they
don't document that.  An example is MacOS:

$ grepc pivot_root / 2&gt;/dev/null
.../sys/sysproto.h:3012:
int pivot_root(struct proc *, struct pivot_root_args *, int *);

Since the prototype of the syscall differs from that of Linux, we
can't use that syscall.  Let's make sure the test only detects
pivot_root(2) under Linux.  Also, rename the feature macro to make
clear that it's only about Linux's pivot_root(2).

This closes #737 issue on GitHub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some non-Linux systems implement pivot_root(2), even if they
don't document that.  An example is MacOS:

$ grepc pivot_root / 2&gt;/dev/null
.../sys/sysproto.h:3012:
int pivot_root(struct proc *, struct pivot_root_args *, int *);

Since the prototype of the syscall differs from that of Linux, we
can't use that syscall.  Let's make sure the test only detects
pivot_root(2) under Linux.  Also, rename the feature macro to make
clear that it's only about Linux's pivot_root(2).

This closes #737 issue on GitHub.
</pre>
</div>
</content>
</entry>
<entry>
<title>Including &lt;mntent.h&gt; iff it exists.</title>
<updated>2022-08-02T11:58:01+00:00</updated>
<author>
<name>Alejandro Colomar</name>
<email>alx.manpages@gmail.com</email>
</author>
<published>2022-06-19T10:48:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=2c0888f69c247c82fc02ba207aa19fa00acf4b5e'/>
<id>2c0888f69c247c82fc02ba207aa19fa00acf4b5e</id>
<content type='text'>
With NXT_HAVE_PIVOT_ROOT, we had issues in MacOS.  Headers should
normally be included unconditionally, except of course if they
don't exist.

This fixes part of the #737 issue on GitHub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With NXT_HAVE_PIVOT_ROOT, we had issues in MacOS.  Headers should
normally be included unconditionally, except of course if they
don't exist.

This fixes part of the #737 issue on GitHub.
</pre>
</div>
</content>
</entry>
<entry>
<title>Replaced Linux syscall macros by libc macros.</title>
<updated>2022-07-18T17:09:30+00:00</updated>
<author>
<name>Alejandro Colomar</name>
<email>alx.manpages@gmail.com</email>
</author>
<published>2022-06-18T13:59:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=5015b05fc495bf3e87f8decfd1617a4a399939d4'/>
<id>5015b05fc495bf3e87f8decfd1617a4a399939d4</id>
<content type='text'>
User-space programs should use the SYS_*form, as documented in
syscall(2).  That also adds compatibility to non-Linux systems.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
User-space programs should use the SYS_*form, as documented in
syscall(2).  That also adds compatibility to non-Linux systems.
</pre>
</div>
</content>
</entry>
<entry>
<title>Isolation: fixed build when features aren't detected.</title>
<updated>2020-06-23T11:11:27+00:00</updated>
<author>
<name>Tiago Natel de Moura</name>
<email>t.nateldemoura@f5.com</email>
</author>
<published>2020-06-23T11:11:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=f8ba5d6c0093090e81819481e523af5fd27ab1e3'/>
<id>f8ba5d6c0093090e81819481e523af5fd27ab1e3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Added "rootfs" feature.</title>
<updated>2020-05-28T13:57:41+00:00</updated>
<author>
<name>Tiago Natel de Moura</name>
<email>t.nateldemoura@f5.com</email>
</author>
<published>2020-05-28T13:57:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=e2b53e16c60ba1e3bbbe59172c184e97f889326b'/>
<id>e2b53e16c60ba1e3bbbe59172c184e97f889326b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Isolation: allowed the use of credentials with unpriv userns.</title>
<updated>2019-12-06T16:52:50+00:00</updated>
<author>
<name>Tiago Natel</name>
<email>t.nateldemoura@f5.com</email>
</author>
<published>2019-12-06T16:52:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=411daeaa532c47328ab901a7ba9ea5dcd876be06'/>
<id>411daeaa532c47328ab901a7ba9ea5dcd876be06</id>
<content type='text'>
The setuid/setgid syscalls requires root capabilities but if the kernel
supports unprivileged user namespace then the child process has the full
set of capabilities in the new namespace, then we can allow setting "user"
and "group" in such cases (this is a common security use case).

Tests were added to ensure user gets meaningful error messages for
uid/gid mapping misconfigurations.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The setuid/setgid syscalls requires root capabilities but if the kernel
supports unprivileged user namespace then the child process has the full
set of capabilities in the new namespace, then we can allow setting "user"
and "group" in such cases (this is a common security use case).

Tests were added to ensure user gets meaningful error messages for
uid/gid mapping misconfigurations.
</pre>
</div>
</content>
</entry>
<entry>
<title>Initial applications isolation support using Linux namespaces.</title>
<updated>2019-09-19T12:25:23+00:00</updated>
<author>
<name>Tiago de Bem Natel de Moura</name>
<email>t.nateldemoura@f5.com</email>
</author>
<published>2019-09-19T12:25:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=c554941b4f826d83d92d5ca8d7713bea4167896e'/>
<id>c554941b4f826d83d92d5ca8d7713bea4167896e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
