<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/slcl, branch remove</title>
<subtitle>Small and lightweight cloud storage written in C99 and POSIX.1-2008.
</subtitle>
<id>https://gitea.privatedns.org/xavi/slcl/atom?h=remove</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/slcl/atom?h=remove'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/'/>
<updated>2023-07-08T01:06:13+00:00</updated>
<entry>
<title>Implement file/directory removal</title>
<updated>2023-07-08T01:06:13+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-07T22:54:59+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=d54e3ad322f8ed4219f9cdb7b78ae210861031d1'/>
<id>urn:sha1:d54e3ad322f8ed4219f9cdb7b78ae210861031d1</id>
<content type='text'>
The following workflow has been implemented:

- A new checkbox for each object inside a directory is shown.
- When one or more objects are selected, the user submits a request
through a HTML5 form.
- Then, slcl will ask the user for confirmation, listing the selected
objects, while reminding the user about the effects.
- The user confirms the selection.
- slcl removes the selected objects. All objects from non-empty
directories are removed, too.
- Finally, slcl redirects the user to the directory the request was
made from.
</content>
</entry>
<entry>
<title>cftw: Allow directories to call the user callback</title>
<updated>2023-07-08T00:30:31+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-08T00:30:31+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=74ca76a58fca114140d0d0cc13a1216d6dffbee0'/>
<id>urn:sha1:74ca76a58fca114140d0d0cc13a1216d6dffbee0</id>
<content type='text'>
This provides a few benefits:

- This will allow searching for directories by name.
- Future commits will allow to remove files and directories, so this
  change was also required for cftw.
</content>
</entry>
<entry>
<title>page.c: Return HTTP_STATUS_OK on successful page_search</title>
<updated>2023-07-07T22:52:53+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-07T22:52:53+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=8bff49d9c8c5842ee1a0cd423035dd53728bf11c'/>
<id>urn:sha1:8bff49d9c8c5842ee1a0cd423035dd53728bf11c</id>
<content type='text'>
This was probably a copy-paste issue when implementing page_search based
on page_quota_exceeded.
</content>
</entry>
<entry>
<title>main.c: Fix use-after-free on failed search_fn</title>
<updated>2023-07-07T20:04:01+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-07T20:01:13+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=960a35a02fa8c98036e73be8fee9ea3f1c0888e9'/>
<id>urn:sha1:960a35a02fa8c98036e73be8fee9ea3f1c0888e9</id>
<content type='text'>
When search_fn fails, it must free `r` before `results`, as the former
is assigned based on the latter - otherwise, it would lead to undefined
behaviour.

So far, only memory allocation errors would make search_fn to fail.
</content>
</entry>
<entry>
<title>cftw.c: Check errors from readdir(3)</title>
<updated>2023-07-05T23:56:43+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-05T23:56:43+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=74b7f7a902d9916dddb07d6adb26c63e765a6349'/>
<id>urn:sha1:74b7f7a902d9916dddb07d6adb26c63e765a6349</id>
<content type='text'>
According to POSIX.1-2017, applications are advised to assign errno(3)
to 0 before a call to readdir(3), and compare errno(3) after the call to
check for errors.
</content>
</entry>
<entry>
<title>main.c: Use ISO C99-compatible declaration for main</title>
<updated>2023-07-05T22:56:27+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-05T22:56:19+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=36ff7d81432308ba430414180c0ab7a41af228ba'/>
<id>urn:sha1:36ff7d81432308ba430414180c0ab7a41af228ba</id>
<content type='text'>
C99 §5.1.2.2.1 only defines the following declarations for main:

- int main(void)
- int main(int argc, char *argv[])

While the use of equivalent types (e.g.: char **argv) is allowed, const
char ** would not be considered equivalent, and thus an invalid
declaration depending on the implementation.
</content>
</entry>
<entry>
<title>server.c: Fix typo</title>
<updated>2023-07-05T22:42:12+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-05T22:42:12+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=640210a7f6f527c24924e95c51c5665b3cd76d03'/>
<id>urn:sha1:640210a7f6f527c24924e95c51c5665b3cd76d03</id>
<content type='text'>
</content>
</entry>
<entry>
<title>http.c: Accept resources with '&amp;' or '?'</title>
<updated>2023-07-05T22:19:05+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-05T21:34:36+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=7bd56e69dccec2794a7b568eb254a40f96b900c5'/>
<id>urn:sha1:7bd56e69dccec2794a7b568eb254a40f96b900c5</id>
<content type='text'>
Otherwise, client requests to resources such as '/me &amp; you', '/?' or
'/??preview=1' would fail.
</content>
</entry>
<entry>
<title>server.c: Fix undefined behaviour on &gt;1 clients</title>
<updated>2023-07-03T11:40:12+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-03T11:36:46+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=15c905f150927b16bd3d1ffe62d2bc9d92da26c5'/>
<id>urn:sha1:15c905f150927b16bd3d1ffe62d2bc9d92da26c5</id>
<content type='text'>
server.c kept an array of all of its active clients, calling realloc(3)
everytime its size had to be modified. However, reallocating this array
had the undesired consequence of moving other active clients to other
memory locations.

Potentially, this would result in dangling pointers from other
components that also kept pointers to struct server_client instances
e.g.: handler.c.

For this reason, the array-based approach has been completely dropped,
in favour of a doubly-linked list.
</content>
</entry>
<entry>
<title>Implement search</title>
<updated>2023-06-06T01:52:16+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-06-06T01:49:36+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=5a6c92d69bbb307ca09ac2ecbad54df4f2394bea'/>
<id>urn:sha1:5a6c92d69bbb307ca09ac2ecbad54df4f2394bea</id>
<content type='text'>
This new feature adds a HTML form on each directory listing that allows
to search files recursively, starting from the current user directory.
Wildcard patterns are also allowed.
</content>
</entry>
</feed>
