<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/slcl/main.c, branch imagemagick</title>
<subtitle>Small and lightweight cloud storage written in C99 and POSIX.1-2008.
</subtitle>
<id>https://gitea.privatedns.org/xavi/slcl/atom?h=imagemagick</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/slcl/atom?h=imagemagick'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/'/>
<updated>2023-03-28T01:15:27+00:00</updated>
<entry>
<title>WIP thumbnail stuff</title>
<updated>2023-03-28T01:15:27+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-03-24T01:39:23+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=fa97b1904c72c184b09c627c7ccab0d0db4a060c'/>
<id>urn:sha1:fa97b1904c72c184b09c627c7ccab0d0db4a060c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main.c: Use S_ISDIR in ensure_dir</title>
<updated>2023-03-25T08:49:24+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-03-25T08:49:24+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=09a157d307f3dd766912a203347069b11fed1aa1'/>
<id>urn:sha1:09a157d307f3dd766912a203347069b11fed1aa1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Define _POSIX_C_SOURCE</title>
<updated>2023-03-24T01:49:11+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-03-24T01:47:11+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=b3ef22ac2ae126951c5b74003c7b17189c0ecbbb'/>
<id>urn:sha1:b3ef22ac2ae126951c5b74003c7b17189c0ecbbb</id>
<content type='text'>
This allows using the default compiler defined by make(1) (i.e.,
c99(1)), thus improving POSIX compatibility.
</content>
</entry>
<entry>
<title>Send response on quota exceeded</title>
<updated>2023-03-20T09:57:20+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-03-20T02:32:00+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=d9bb874591c63f2efbfc1c4c953934251c700e9f'/>
<id>urn:sha1:d9bb874591c63f2efbfc1c4c953934251c700e9f</id>
<content type='text'>
So far, slcl would just close the connection with a client when the
Content-Length of an incoming request exceeded the user quota, without
any meaningful information given back to the user.

Now, slcl responds with a HTML file with meaningful information about
the error.

Limitations:

- While this commits has been successfully tested on ungoogled-chromium,
LibreWolf (and I assume Firefox and any other derivates too) does not
seem to receive the response from the server.
    - However, this issue only occurred during local testing, but not
on remote instances.
</content>
</entry>
<entry>
<title>main.c: Fix double free(3) and refactor form handling</title>
<updated>2023-03-19T22:58:03+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-03-19T12:08:09+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=66bc98275f24935b2d609ce9c98de5c3b73c6dd3'/>
<id>urn:sha1:66bc98275f24935b2d609ce9c98de5c3b73c6dd3</id>
<content type='text'>
- When a non-empty username and an empty password was given, slcl would
crash due to a double free(3). This happened because append_form would
grow the form list before sanitizing the input and, since the output
pointer was not updated to the caller function, the latter would attempt
to free a now-old pointer.
- Additionally, some compilers such as clang complained about the
potential use of an uninitialized variable when calling forms_free.
- Also, it was a good opportunity to refactor get_forms and its caller
functions, as get_forms was not differentiate fatal errors from user
input errors.
</content>
</entry>
<entry>
<title>main.c: Fix undefined value for cur</title>
<updated>2023-03-16T01:23:05+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-03-16T01:23:05+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=9624e8114408b96ac96675191ae2e34b0e403ee1'/>
<id>urn:sha1:9624e8114408b96ac96675191ae2e34b0e403ee1</id>
<content type='text'>
As otherwise reported by clang 14.0.0:

main.c:679:14: warning: variable 'cur' is used uninitialized whenever '&amp;&amp;' condition is false [-Wsometimes-uninitialized]
    else if (available &amp;&amp; quota_current(a, username, &amp;cur))

This was a minor issue after all, as pq was not used unless available
were set.
</content>
</entry>
<entry>
<title>main.c: Ensure essential directories on startup</title>
<updated>2023-03-16T00:46:49+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-03-16T00:46:49+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=7e2e37d40ac130079570a4f8111d4d5ca5fc9344'/>
<id>urn:sha1:7e2e37d40ac130079570a4f8111d4d5ca5fc9344</id>
<content type='text'>
So far, slcl failed with poorly described error messages when any of the
essential directories were missing. Now, these are created automatically
so that the initial setup is easier.
</content>
</entry>
<entry>
<title>main.c: Call form_free instead of repeating code</title>
<updated>2023-03-09T01:04:52+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-03-09T00:46:45+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=d18243c019878067f1883ef69cfea1ddd5888c2f'/>
<id>urn:sha1:d18243c019878067f1883ef69cfea1ddd5888c2f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Implement public file sharing</title>
<updated>2023-03-09T01:02:40+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-03-09T00:29:48+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=2e1b1313962d979b6e15491c63d316d829638bf0'/>
<id>urn:sha1:2e1b1313962d979b6e15491c63d316d829638bf0</id>
<content type='text'>
An HTML form is now added next to each regular file, that generates a
POST request. Then, slcl replies with a HTML document with a link to the
public resource (which are implemented as symlinks).

Limitations:

- For now, only regular files can be shared i.e., sharing directories is
not possible. While feasible, it still requires a larger refactor to
list_dir and resource_layout, so that read-only access to the directory
is provided to anonymous users.
</content>
</entry>
<entry>
<title>Translate whitespace to '+' in append_form</title>
<updated>2023-03-09T00:17:37+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-03-09T00:17:37+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=a4c12e7ccc11f5f15e0e81db0be2a908eab5b141'/>
<id>urn:sha1:a4c12e7ccc11f5f15e0e81db0be2a908eab5b141</id>
<content type='text'>
Otherwise, every function calling get_forms must implement this.
</content>
</entry>
</feed>
