Commit Graph

466 Commits

Author SHA1 Message Date
Hiltjo Posthuma
e45e64491e Only check errno if getpwuid() fails
Checking errno otherwise is unspecified.
2014-07-09 15:08:11 +01:00
Hiltjo Posthuma
291aedb875 code consistency fixes 2014-07-09 15:08:01 +01:00
Hiltjo Posthuma
c50f7a3a27 login: separate write utmp in a separate function
write utmp entry (as root) before setuid.
2014-07-09 15:07:53 +01:00
Hiltjo Posthuma
96f15f1d04 errno: check only errno if return value was NULL 2014-07-09 15:07:34 +01:00
Hiltjo Posthuma
528f10be6c util/passwd.c: check errno only if spw is NULL
this is more reliable. there is a difference between glibc and musl
errno if /etc/tcb/<name>/shadow doesn't exist.
2014-07-09 15:07:19 +01:00
sin
10c8b71fd2 Kick off respawn in its own session 2014-07-06 21:36:28 +01:00
sin
ce59961f19 respawn: kill child process upon SIGTERM
We might revisit this and be more strict i.e. kill the child
process even if it is in a new process session/group.

For now this is probably a good enough balance.

This patch changes the existing semantics of respawn, the child
process is now part of the same process session as respawn.
2014-07-06 21:15:09 +01:00
Hiltjo Posthuma
d9aaa0f501 pidof: fix typo, argv[0] -> argv[i] 2014-07-05 16:26:55 +01:00
Hiltjo Posthuma
2557104494 util/proc: theoretical underflow 2014-07-05 12:00:24 +01:00
Hiltjo Posthuma
5a06a9f7e1 pidof: match on full name and basename
busybox doesn't do this, but procps does.
2014-07-05 12:00:17 +01:00
sin
55dd1076fe Print header after trying to open /proc/modules
This fails on kernels compiled without module support or
if procfs is not mounted.
2014-07-04 11:52:09 +01:00
sin
1ec0073bb8 Remove entries from TAILQ when free-ing 2014-07-03 14:29:45 +01:00
sin
c9609ea5ff Only call fwrite() and fclose() when fp is not NULL
Spotted by Hiltjo.
2014-07-02 12:09:01 +01:00
sin
3669fa4117 More error checking for fwrite() 2014-07-02 12:06:26 +01:00
sin
53547b7835 Just die if ttyname() fails 2014-07-02 12:06:16 +01:00
sin
2832db2368 Set UTMP_PATH in config.def.h 2014-07-02 12:06:07 +01:00
sin
d0145aaf1f login: Write utmp entry 2014-07-02 12:05:58 +01:00
sin
ae8ca1598b Clear utmp entries for the specified tty in getty(8) 2014-07-02 12:05:41 +01:00
sin
8d187be64a Replace fprintf(stderr, ...) calls with weprintf() 2014-06-30 22:44:48 +01:00
sin
135f6012cb Incomplete output is not an error 2014-06-30 22:44:26 +01:00
sin
29bc0ce130 No need to skip stdin in chvt(1) 2014-06-30 19:18:49 +01:00
sin
d04d030367 Use EXIT_FAILURE 2014-06-30 19:16:15 +01:00
sin
86060b535c Fix includes across all tools 2014-06-30 19:04:47 +01:00
sin
b03a021983 List function decls in alphabetical order 2014-06-30 18:42:49 +01:00
sin
55dbbb7b3f Use estrtol() instead of atoi()
Some more stylistic fixes.
2014-06-30 16:57:22 +01:00
sin
643a714256 Simplify dmesg_show()
The code was way too complicated.  We do not currently filter out
the priority level, so we default to raw output.
2014-06-30 16:50:38 +01:00
sin
5aede71236 Use a bitwise-xor to determine incompatible flags 2014-06-30 16:40:52 +01:00
sin
06dcf39b3a Add some error checking to util/recurse.c
Some more stylistic changes and simplification.
2014-06-30 16:06:15 +01:00
sin
968ccce951 Sync util/recurse.c with that of sbase 2014-06-30 15:45:16 +01:00
sin
693de34f88 Mention config.h in README 2014-06-30 14:23:08 +01:00
sin
fc26e2932d Add comment to clarify "$6$" 2014-06-30 14:22:08 +01:00
sin
4cce54b8e9 Add readahead.8 2014-06-30 14:19:57 +01:00
sin
22e7bed99b Add David to LICENSE 2014-06-30 14:13:00 +01:00
sin
67d38a7e43 Import strl{cpy,cat}() from sbase 2014-06-30 14:10:51 +01:00
sin
f5ebc6350b Import sys/queue.h and move over existing tools
We should stop rolling data structure implementations in every
tool.
2014-06-30 13:06:07 +01:00
sin
716321e765 Update TODO 2014-06-28 23:43:29 +01:00
sin
4c967b5995 Update README 2014-06-28 21:03:39 +01:00
sin
1e7acf4c54 No need to include sys/ioctl.h in watch(1) 2014-06-28 11:29:21 +01:00
sin
88c61c17e8 Check some more ioctl() calls for errors 2014-06-28 11:29:15 +01:00
sin
debcf4447d Add readahead(8) 2014-06-27 17:07:56 +01:00
sin
32efa14595 Fix switch_root delete_content() 2014-06-27 12:55:33 +01:00
sin
941ffd2aed Bail out on path truncation 2014-06-27 11:52:17 +01:00
sin
b5c3bcda7d Ensure that path[0] == '\0' upon entry to delete_content()
As a quick fix, staticise path to ensure that it is zero-filled
upon initial entry to the function.

In rare cases there's a possible buffer overflow and/or path
mess up on the first call to strlcat() with path[0] != '\0'.

The proper fix is to utilize util/recurse.c but the traversal
order cannot be specified at the moment.

Expect a better fix in the future.
2014-06-27 11:52:10 +01:00
sin
32bc548228 Update program list in TODO 2014-06-26 16:42:58 +01:00
sin
9a0cf7c359 Add a misc section in TODO 2014-06-26 16:39:51 +01:00
sin
36049e2925 Add more programs to TODO 2014-06-26 16:33:48 +01:00
sin
23678b96cd Check FIFREEZE/FITHAW ioctl for failure 2014-06-26 16:26:20 +01:00
sin
c88ba3750e Add freeramdisk(8) 2014-06-26 16:26:14 +01:00
sin
35a9479141 Style fix for insmod.8 2014-06-26 16:09:01 +01:00
sin
c1a96ddb4c Add fsfreeze.8 2014-06-26 16:07:11 +01:00