lsh issueshttps://git.lysator.liu.se/lsh/lsh/-/issues2018-12-06T22:19:20Zhttps://git.lysator.liu.se/lsh/lsh/-/issues/1First time invocation: seed instructions on command line unsuccessful2018-12-06T22:19:20ZGhost UserFirst time invocation: seed instructions on command line unsuccessfulAfter installing [lsh 2.1-8](https://packages.ubuntu.com/xenial/lsh-client) on an Ubuntu 16.04 (xenial) system the first interactions with lsh results in a "Could not create lock file" error message when following instructions as output ...After installing [lsh 2.1-8](https://packages.ubuntu.com/xenial/lsh-client) on an Ubuntu 16.04 (xenial) system the first interactions with lsh results in a "Could not create lock file" error message when following instructions as output on the command line for creating the seed file;
```
$ lsh
No seed file. Please create one by running
lsh-make-seed -o "/home/miki/.lsh/yarrow-seed-file".
Usage: lsh [OPTION...] host
or: lsh [OPTION...] host command ...
Try `lsh --help' or `lsh --usage' for more information.
$ lsh-make-seed -o "/home/miki/.lsh/yarrow-seed-file"
lsh-make-seed: Reading system state...
lsh-make-seed: Got 141 bits of entropy from system state.
lsh-make-seed: Please type some random data. You better do this
lsh-make-seed: when connected directly to a console, typing over
lsh-make-seed: the network provides worse timing information, and
lsh-make-seed: more opportunities for eavesdropping.
----------------------------------------
........................................
lsh-make-seed: Got 165 keystrokes, estimating 200 bits of entropy.
lsh-make-seed: You can stop typing now.
lsh-make-seed: Could not create lock file `/home/miki/.lsh/yarrow-seed-file.lock' (errno = 2): No such file or directory
lsh-make-seed: Failed to lock file `/home/miki/.lsh/yarrow-seed-file'
$ ll .lsh
ls: cannot access '.lsh': No such file or directory
```
This seems to be caused by the ~/.lsh configuration directory not being created yet, and not done automatically when using the -o argument.
In contrast, when lsh-make-seed is run without arguments as [the manual instructs](https://www.lysator.liu.se/~nisse/lsh/lsh.html#lsh-make-seed) the directory is indeed created and the seed file written;
```
$ lsh-make-seed
lsh-make-seed: Reading system state...
lsh-make-seed: Got 141 bits of entropy from system state.
lsh-make-seed: Please type some random data. You better do this
lsh-make-seed: when connected directly to a console, typing over
lsh-make-seed: the network provides worse timing information, and
lsh-make-seed: more opportunities for eavesdropping.
----------------------------------------
........................................
lsh-make-seed: Got 216 keystrokes, estimating 201 bits of entropy.
lsh-make-seed: You can stop typing now.
$ ll .lsh
total 48
drwxr-xr-x 2 miki miki 4096 Dec 6 19:04 ./
drwxr-xr-x 441 miki miki 36864 Dec 6 19:04 ../
-rw------- 1 miki miki 32 Dec 6 19:04 yarrow-seed-file
```
It would improve the experience for new users, at least for people like me and also [some other people](https://unix.stackexchange.com/a/254070/141930), if these first steps were less cumbersome.
Here are some humble suggestions:
1. modify [cmd line instructions](https://git.lysator.liu.se/lsh/lsh/blob/master/src/unix_random.c#L294) to include lsh-make-seed with default output filename
1. automatically start the seed file generation if needed ([something like that](https://git.lysator.liu.se/lsh/lsh/blob/master/src/unix_random_user.c) is done in lsh-keygen in master branch, but not in 2.1)
1. modify lsh-make-seed to create the config dir regardless of whether an output filename has been specified on command line ([current behaviour seems to be a deliberate feature though](https://git.lysator.liu.se/lsh/lsh/blob/master/src/lsh-make-seed.c#L152))https://git.lysator.liu.se/lsh/lsh/-/issues/2Missing includes in configure test for working shutdown on AF_UNIX sockets2024-01-29T15:40:58ZRyan Carsten SchmidtMissing includes in configure test for working shutdown on AF_UNIX socketsThe configure test for working shutdown on AF_UNIX sockets uses `strerror` without including `<string.h>` and uses `exit` without including `<stdlib.h>`.
I could not fork the repository in order to send you a pull request because:
> Li...The configure test for working shutdown on AF_UNIX sockets uses `strerror` without including `<string.h>` and uses `exit` without including `<stdlib.h>`.
I could not fork the repository in order to send you a pull request because:
> Limit reached You cannot create projects in your personal namespace. Contact your GitLab administrator.
so here is a diff:
```diff
--- configure.ac.orig 2013-06-24 16:17:18.000000000 -0500
+++ configure.ac 2024-01-29 09:33:16.000000000 -0600
@@ -602,6 +602,8 @@
#include <sys/socket.h>
#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
```https://git.lysator.liu.se/lsh/lsh/-/issues/3Missing include in unix_process.c for logwtmp2024-01-29T15:51:52ZRyan Carsten SchmidtMissing include in unix_process.c for logwtmpConfiguring lsh 2.1 on macOS 12 finds `logwtmp`:
```
checking for logwtmp... yes
```
but compiling fails:
```
unix_process.c:330:3: error: implicit declaration of function 'logwtmp' is invalid in C99 [-Werror,-Wimplicit-function-decla...Configuring lsh 2.1 on macOS 12 finds `logwtmp`:
```
checking for logwtmp... yes
```
but compiling fails:
```
unix_process.c:330:3: error: implicit declaration of function 'logwtmp' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
logwtmp(lsh_get_cstring(self->line), "", "");
^
unix_process.c:461:3: error: implicit declaration of function 'logwtmp' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
logwtmp(lsh_get_cstring(cleanup->line),
^
2 errors generated.
```