aboutsummaryrefslogtreecommitdiff
path: root/auth.c
Commit message (Collapse)AuthorAgeFilesLines
* auth.c: Make use of crealpathXavier Del Campo Romero2023-11-241-44/+4
| | | | | crealpath already provides a mechanism to determine the current working directory from getcwd(3).
* auth.c: Fix potential signed integer overflowXavier Del Campo Romero2023-10-141-2/+2
| | | | | | | | For platforms where int is a 16-bit data type, this operation might overflow and possibly cause either unexpected behaviour and/or a compiler warning. Therefore, it is safer to promote each integer constant accordingly.
* Apply slweb renaming to libwebXavier Del Campo Romero2023-10-111-1/+1
|
* auth.c: Add missing includeXavier Del Campo Romero2023-09-151-0/+1
| | | | | As opposed to other integer constants such as ULLONG_MAX, SIZE_MAX is defined by stdint.h, not limits.h.
* Adapt to slweb's include pathsXavier Del Campo Romero2023-07-211-1/+1
| | | | | slweb puts its header files into its own directory in order to avoid potential name clashing.
* auth.c: Fix wrong size checkXavier Del Campo Romero2023-05-281-1/+1
| | | | Otherwise, sb.st_size + 1 would exceed SIZE_MAX.
* auth.c: Ensure absolute path for a->dirXavier Del Campo Romero2023-03-251-13/+64
| | | | | Otherwise, slcl would create broken symbolic links if the user passes a relative path as command line argument.
* auth.c: Add friendly reminderXavier Del Campo Romero2023-03-161-1/+2
|
* Move decode_hex into its own fileXavier Del Campo Romero2023-03-091-22/+7
| | | | | | | - Error detection against strotul(3) has been improved, as done in other places. - New function encode_hex has been implemented, which will be used by future commits.
* Perform some minor optimizationsXavier Del Campo Romero2023-03-061-1/+1
|
* Implement user quotaXavier Del Campo Romero2023-03-061-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature allows admins to set a specific quota for each user, in MiB. This feature is particularly useful for shared instances, where unlimited user storage might be unfeasible or even dangerous for the server. Also, a nice HTML5 <progress> element has been added to the site that shows how much of the quota has been consumed. If no quota is set, slcl falls back to the default behaviour i.e., assume unlimited storage. Limitations: - While HTTP does specify a Content-Length, which determines the length of the whole request, it does not specify how many files are involved or their individual sizes. - Because of this, if multiple files are uploaded simultaneously, the whole request would be dropped if user quota is exceeded, even if not all files exceeded it. - Also, Content-Length adds the length of some HTTP boilerplate (e.g.: boundaries), but slcl must rely on this before accepting the whole request. In other words, this means some requests might be rejected by slcl because of the extra bytes caused by such boilerplate. - When the quota is exceeded, slcl must close the connection so that the rest of the transfer is cancelled. Unfortunately, this means no HTML can be sent back to the customer to inform about the situation.
* Initial commitXavier Del Campo Romero2023-02-281-0/+472