Commit Graph

2436 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen f744e80b88 Fix memory leak in mkinitrd(1) AddRulesFromFile error path. 2018-08-06 23:59:35 +02:00
Jonas 'Sortie' Termansen e8a9d3dc04 Fix code assuming struct winsize fields are size_t. 2018-08-06 23:59:35 +02:00
Jonas 'Sortie' Termansen 8467102662 Fix ls(1) not checking stat_record()'s error correctly. 2018-08-06 23:59:34 +02:00
Jonas 'Sortie' Termansen db90720c01 Fix code relying on <stdio.h> including <stdarg.h>. 2018-08-06 23:59:34 +02:00
Jonas 'Sortie' Termansen 29555d72bb Fix <fcntl.h> including <sys/stat.h> namespace pollution.
POSIX allows <fcntl.h> to include <sys/stat.h>, but doesn't require it.
There's little reason to do that, since they are separate headers, and
<fcntl.h> just needs the mode_t constants. Fix the code accidentally
relying on <fcntl.h> including <sys/stat.h>. The mode_t constants are now
provided in their own kernel header <sortix/mode.h>.

Additionally fix <sys/stat.h> pulling in all of <sys/types.h>, which is not
allowed by POSIX, which only requires a few types to be declared. Fix the
code accidentally relying on <sys/stat.h> including <sys/types.h>.

Finally fix <dirent.h> pulling in <stdint.h> through <sortix/dirent.h>.

The <sortix/__/dt.h> and <sortix/__/stat.h> headers are no longer required
and their contents have been merged into <sortix/__/dirent.h>.
2018-08-06 23:59:34 +02:00
Jonas 'Sortie' Termansen 9c3af039ca Fix <stdio.h> pulling in <pthread.h> through <FILE.h> when __is_sortix_libc. 2018-07-17 12:25:52 +02:00
Jonas 'Sortie' Termansen b8a330af3b Fix carray(1) wrongly mentioning the -i option that is currently compatibility. 2018-07-17 12:25:52 +02:00
Shikhin Sethi 64f4f5701c Fix typos in sort(1). 2018-04-15 18:06:49 +02:00
Jonas 'Sortie' Termansen 29587a27ca Include <strings.h> in rw(1) to get strcasecmp(3). 2018-04-15 18:06:49 +02:00
Jonas 'Sortie' Termansen 02d9d888f1 Fix more typos in rw(1). 2018-04-15 18:06:48 +02:00
Juhani Krekelä 3261f766b6 Fix typo when sysinstall(8) says have to set up bootloading yourself. 2018-04-08 21:38:50 +02:00
Jonas 'Sortie' Termansen 3654b370f1 Add -R option to sort(1). 2018-04-08 20:56:46 +02:00
Jonas 'Sortie' Termansen a209c89233 Fix POSIX comformance issues in sort(1).
Fix -C disabling checking rather than checking quietly.

Fix sort(1) exiting 1 on certain errors, as POSIX requires sort(1) to only
exit if the input wasn't sorted when -c.

Fix -o opening the output file for truncation before all the input has been
read, as POSIX requires allowing -o to be an input file.

POSIX requires sort(1) to handle input errors by either erroring with no
output, or by erroring and sorting the input read so far. Change the current
behavior of continuing to the next file to simply failing hard on the first
input error.

Don't increment the last line number on the end of the standard input.

Report -c/-C as incompatible with -o.

Exit unsuccessfully on any output errors.

Update to current coding conventions and add documentation while here.
2018-04-08 20:56:46 +02:00
Jonas 'Sortie' Termansen 53592a6e3f Fix getdelim(3) not returning a final line without a delimiter. 2018-04-08 20:35:30 +02:00
Jonas 'Sortie' Termansen 6d15ed575f Fix incorrect check for zero output block size in rw(1). 2018-04-02 14:54:11 +02:00
Jonas 'Sortie' Termansen 23438327b5 Fix quantity typo and clarify block size options in rw(1). 2018-03-31 18:22:43 +02:00
Shikhin Sethi a0aed89d0a Fix typos in rw(1)'s comments. 2018-03-31 16:24:52 +02:00
Jonas 'Sortie' Termansen 397bac9862 Add support for modifying release iso images. 2018-03-31 00:55:33 +02:00
Jonas 'Sortie' Termansen d1c3433353 Add rw(1). 2018-03-31 00:55:33 +02:00
Jonas 'Sortie' Termansen d393b67d72 Fix st_blksize and st_blocks kernel values. 2018-03-31 00:55:33 +02:00
Jonas 'Sortie' Termansen 13658db632 Fix byte unit suffixes being called prefixes in disked(8). 2018-03-30 23:42:37 +02:00
Jonas 'Sortie' Termansen d7e5539c35 Fix sysinstall(8) typo when selecting root filesystem. 2018-03-30 23:42:37 +02:00
Jonas 'Sortie' Termansen 66b35fb74c Fix incompatibilities in the kernel tar extraction. 2018-03-30 23:42:37 +02:00
Alexandros Alexandrou 5723610d0a Fix Ctrl+Down selecting text instead of moving cursor in editor(1). 2018-03-11 18:39:00 +02:00
Alexandros Alexandrou 82b98b4899 Fix indention in editor(1). 2018-03-11 18:10:09 +02:00
Jonas 'Sortie' Termansen 9380ed82ac Fix typo in getentropy(2). 2018-02-04 13:39:37 +01:00
Troy Martin 4335c7f001 Fix typos in initrd(7). 2018-02-04 13:39:37 +01:00
Jonas 'Sortie' Termansen 7df3f9308a The man program in the mdocml port can now handle non-installed manuals. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen eca6246684 Use portable sort in linecount target. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen 0bb865a7d3 Add install(1) -d support. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen 7c91ea1b19 Add restartable system calls compatibility macro. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen c8ba4b0973 Add float formating and parsing compatibility macros. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen 645ab7689c Only mention tix-install destination if not the root directory. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen 48e41b36a3 Support the ^[[1~ for Home and ^[[4~ for End escape sequences in sh(1). 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen ca2969b033 Remove unused directory variables in favor of DOCDIR. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen d50b85591d Refactor testcase API. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen 590fd835d5 Fix hostname(1) manual page file being executable. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen e9d552867b Fix sysinstall(8) indention. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen 46b11b4b60 Fix update-initrd(8) not erroring on missing option arguments.
Remove unimplemented --help and --version options.
2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen 65a960dab0 Fix trailing slashes in manifests created by the kernel. 2017-12-04 23:56:46 +01:00
Jonas 'Sortie' Termansen 568c97c77f Fix SEEK_END, file offset overflow, and read/write/mkpartition syscall bugs.
Fix SEEK_END seeking twice as far as requested. Centralize lseek handling in
one place and avoid overflow bugs. Inode lseek handlers now only need to
handle SEEK_END with offset 0. Prevent the file offset from ever going below
zero or overflowing.

Character devices are now not seekable, but lseek will pretend they are, yet
always stay at the file offset 0. pread/pwrite on character devices will now
ignore the file offset and call read/write.

This change prevents character devices from being memory mapped, notably
/dev/zero can no longer be memory mapped. None of the current ports seem
to rely on this behavior and will work with just MAP_ANONYMOUS.

Refactor read and write system calls to have a shared return statement for
both seekable and non-seekable IO.

Fix file offset overflow bugs in read and write system calls.

Fix system calls returning EPERM instead of properly returning EBADF when
the file has not been opened in the right mode.

Truncate IO counts and total vector IO length so the IO operation does not
do any IO beyond OFF_MAX. Truncate also total vector IO length for recvmsg
and sendmsg. Fail with EINVAL if total vector IO length exceeds SSIZE_MAX.

Don't stop early if the total IO length is zero, so zero length IO now block
on any locks internal to the inode.

Handle reads at the maximum file offset with an end of file condition and
handle writes of at least one byte at the maximum file offset by failing
with EFBIG.

Refactor UtilMemoryBuffer to store the file size using off_t instead of
size_t to avoid casts and keep file sizes in the off_t type. Properly
handle errors in the code, such as failing with EROFS instead of EBADF if
the backing memory is not writeable, and failing with EFBIG if writing
beyond the end of the file.

Fix mkpartition not rejecting invalid partition start offsets and lengths.
Strictly enforce partition start and length checks in the partition code.
Enforce partitions exist within regular files or block devices.

Fix a few indention issues.
2017-12-04 23:56:46 +01:00
Jonas 'Sortie' Termansen f864c59d0d Mix in fresh randomness when writing out /boot/random.seed.
When entropy gathering is implemented, in the case of the installer and
upgrader, the system probably won't have any entropy when it begins. By the
time the system is installed, there will probably be a bit of entropy from
the user using the system and general system usage, so mix in some of that.
In the case of init, after an installed system has run for a while, a lot of
entropy will have gotten collected, but init will have its arc4random seeded
with initial boot entry, so mix in some fresh entropy, so the random seed
written on shutdown remains as entropic as possible.
2017-09-06 23:41:05 +02:00
Jonas 'Sortie' Termansen 4c2ef980b1 Refactor sysmerge(8) and sysupgrade(8) ABI and version comparisons. 2017-09-06 23:41:05 +02:00
Jonas 'Sortie' Termansen b0496023a1 Allow AF_UNSPEC family in socketpair(2). 2017-08-26 16:49:57 +02:00
Jonas 'Sortie' Termansen 3d356af8d2 Highlight installer, upgrader and disked interactive prompts. 2017-08-26 16:43:54 +02:00
Jonas 'Sortie' Termansen 46862b797f Fix command line parsing with expr(1) failing if the parameter is 0. 2017-08-20 12:44:59 +02:00
Jonas 'Sortie' Termansen 9ee05a5afc Fix kernel/addralloc.cpp file header comment. 2017-08-20 12:44:59 +02:00
Jonas 'Sortie' Termansen 724c035c99 Fix failed fix to pstree(1) vertical line drawing character.
The commit 0def94568a switched to the box
drawing light vertical (U+2502) character, but did not fix the now wrong
assumption that the line drawing character encoded to a single byte.
2017-08-20 12:44:34 +02:00
Jonas 'Sortie' Termansen 2f61df05c2 Fix <string.h> including <sys/__/types.h> in strict C mode. 2017-08-20 12:44:34 +02:00
Jonas 'Sortie' Termansen 515d91a31b Fix <stdlib.h> using long long in C89 mode. 2017-08-20 12:44:34 +02:00