httpdirfs icon indicating copy to clipboard operation
httpdirfs copied to clipboard

Segmentation fault if HOME not set

Open koebi001 opened this issue 1 year ago • 1 comments

Version:

1.2.5-1 from debian bookworm

What is happening:

If HOME is not set I am getting a Segmentation fault. I am using it in a bash script which I execute using salt-stack therefore the environmen does not contain what someone would expect to be always set. My command looks like this:

httpdirfs --cache --cache-location /tmp/httpdirfs --single-file-mode  https://webserver/file /mnt/file

What do I expect:

Write an error message to stderr and exit whit exit status != 0

Workaround:

Set HOME before running httpdirfs For example:

HOME=/tmp httpdirfs --cache --cache-location /tmp/httpdirfs --single-file-mode  https://webserver/file /mnt/file

koebi001 avatar Jun 12 '24 16:06 koebi001

That's understandable. I never expected people to use this without a home directory... I will fix this eventually. Feel free to submit a patch though!

fangfufu avatar Jun 14 '24 00:06 fangfufu

I just want to add that the root cause of this problem is this: https://github.com/fangfufu/httpdirfs/blob/e3f8bc2ceb462926f247d8dd35d356b02ca727c6/src/cache.c#L43-L47

fangfufu avatar Aug 29 '24 22:08 fangfufu