Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Failure to start for users with no home directory #223

Open
Kreeblah opened this issue Nov 1, 2023 · 1 comment
Open

Failure to start for users with no home directory #223

Kreeblah opened this issue Nov 1, 2023 · 1 comment

Comments

@Kreeblah
Copy link

Kreeblah commented Nov 1, 2023

When autoscan 1.4.0 runs under a user with no home directory, it fails with the following error:

panic: mkdirall: mkdir /nonexistent: permission denied

goroutine 1 [running]:
main.defaultConfigDirectory({0xace36e, 0x8}, {0xacf1e7, 0xa})
	github.com/cloudbox/autoscan/cmd/autoscan/config.go:27 +0x1d9
main.main()
	github.com/cloudbox/autoscan/cmd/autoscan/main.go:120 +0x2f4

This is even true when passing the --config, --database, and --log flags, so it seems to be hitting https://github.com/Cloudbox/autoscan/blob/master/cmd/autoscan/config.go#L26 and attempting to create directories before checking to see whether it's even relevant that the user has a home directory (which, obviously, is going to fail in this situation). This then causes it to fail to start when running on a system where it has its own user to run as a service, but without login permissions or a home directory, as is the case on FreeBSD.

@m-rots
Copy link
Collaborator

m-rots commented Nov 1, 2023

This definitely sounds like a mistake on our end! I’ll look into this over the weekend.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants