You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a storage account that has a container named "$web" within it.
I believe this is very simply an issue where something is probably catching "$web" and interpreting it as a variable rather than being properly escaped.
Configuration
vi /etc/blobfuse2/config.yaml
#
# Refer ./setup/baseConfig.yaml for full set of config parameters
logging:
type: syslog
level: log_debug
components:
- libfuse
- file_cache
- attr_cache
- azstorage
libfuse:
attribute-expiration-sec: 120
entry-expiration-sec: 120
negative-entry-expiration-sec: 240
file_cache:
path: /mnt/blobfuse2tmp
timeout-sec: 120
max-size-mb: 4096
attr_cache:
timeout-sec: 7200
azstorage:
type: block
account-name: MYACCOUNT
sas: MYSAS
mode: sas
#
Test commands
mkdir ./test
blobfuse2 mount all ./test --read-only=true --config-file=/etc/blobfuse2/config.yaml
Result
Mounting container : $web to path test/$web
Failed to mount container $web : Error: invalid config file [open /root/.blobfuse2/config_.yaml: no such file or directory]
If you look in /root/.blobfuse2, you'll see these files:
total 20
drwxr-xr-x 2 root root 4096 Feb 13 01:47 ./
drwx------ 18 root root 4096 Feb 13 01:44 ../
-rw-r--r-- 1 root root 4 Feb 13 01:47 _home_admin_k_inventory.pid
-rw-r--r-- 1 root root 654 Feb 13 01:47 'config_$web.yaml'
-rw-r--r-- 1 root root 669 Feb 13 01:47 config_inventory.yaml
The other container "inventory" mounts successfully.
As you can see above, blobfuse2 is complaining about "/root/.blobfuse2/config_.yaml" not existing, but there is a file called 'config_$web.yaml', so I bet $web is not being escaped in some internal command and results in a blank value being used.
The text was updated successfully, but these errors were encountered:
@angrygreenfrogs, in blobfuse mount command, the config file name can be provided as a variable, and blobfuse resolve that variable first before running the command.
This is what's happening in your case.
$web is being considered a variable, which is being replaced by an empty value.
Are there any specific use case for using special character in your container name?
Apologies, but I don't believe that's entirely accurate.... I'm with you that the problem in my case is that my "$web" container is being incorrectly interpreted as a variable (which is blank in the environment), but I still believe this is a bug.
I've even found that I can work-around this issue in a hacky way by exporting a variable with that name, which tricks the executed shell command into working
web='$web'
export web
blobfuse2 mount all ./test --read-only=true --config-file=/etc/blobfuse2/config.yaml
I've never really done much with Go, but I suspect the problem is inside mountAllContainers(), which calls updateCliParams() to process CLI parameters that are called with exec.Command to execute the individual mount commands.
I believe this is simply a lack of escaping the parameters correctly - effectively allowing a shell injection issue.
It's not uncommon to have container names like $web - that's the default container name used by Azure for serving static web content from a storage container (which is what our container is being used for).
This failure not only comes with mountall command.
Even the command blobfuse2 mount ./test --read-only=true --config-file=/home/abc/.blobfuse2/config_$web.yaml also fails.
Reason being we resolve all the variables while evaluating the value of config_file.
We have a storage account that has a container named "$web" within it.
I believe this is very simply an issue where something is probably catching "$web" and interpreting it as a variable rather than being properly escaped.
Configuration
Test commands
Result
If you look in /root/.blobfuse2, you'll see these files:
The other container "inventory" mounts successfully.
As you can see above, blobfuse2 is complaining about "/root/.blobfuse2/config_.yaml" not existing, but there is a file called 'config_$web.yaml', so I bet $web is not being escaped in some internal command and results in a blank value being used.
The text was updated successfully, but these errors were encountered: