VirtualBox

Opened 4 years ago

#20061 new defect

"Permission denied" error at linux-guest on Windows10-host when execute a file on a shared folders immediately after creation or 'chmod +x'

Reported by: progger98 Owned by:
Component: shared folders Version: VirtualBox 6.1.14
Keywords: Permission denied Cc:
Guest type: Linux Host type: Windows

Description

Following script reproduces the error on my virtual linux-machine when working on a share folder (in my case the '/vagrant'):

Script:

set -x

# switch to shared folder
cd /vagrant/ || exit 1

# create simple script
echo "echo 'Hello World'">PrintHelloWorld.sh
cat PrintHelloWorld.sh || exit 1
ls -l PrintHelloWorld.sh || exit 1

echo "start failing tests..."
touch PrintHelloWorld.sh
./PrintHelloWorld.sh

chmod +x PrintHelloWorld.sh
./PrintHelloWorld.sh

chmod +r PrintHelloWorld.sh
./PrintHelloWorld.sh

Output:

++ cd /vagrant/
++ echo 'echo '\''Hello World'\'''
++ cat PrintHelloWorld.sh
echo 'Hello World'
++ ls -l PrintHelloWorld.sh
-rwxrwxrwx 1 vagrant vagrant 19 Nov 24  2020 PrintHelloWorld.sh
++ echo 'start failing tests...'
start failing tests...
++ touch PrintHelloWorld.sh
++ ./PrintHelloWorld.sh
/vagrant/RunCommands.sh: line 14: ./PrintHelloWorld.sh: Permission denied
++ chmod +x PrintHelloWorld.sh
++ ./PrintHelloWorld.sh
/vagrant/RunCommands.sh: line 17: ./PrintHelloWorld.sh: Permission denied
++ chmod +r PrintHelloWorld.sh
++ ./PrintHelloWorld.sh
/vagrant/RunCommands.sh: line 20: ./PrintHelloWorld.sh: Permission denied

The second part of the script shows some 'workarounds' to the problem:

echo "start successful tests..."
touch PrintHelloWorld.sh
sleep 1
./PrintHelloWorld.sh

touch PrintHelloWorld.sh
cat PrintHelloWorld.sh
./PrintHelloWorld.sh

echo "echo 'Hello World'">PrintHelloWorld2.sh
./PrintHelloWorld2.sh

echo "cleanup..."
rm PrintHelloWorld.sh
rm PrintHelloWorld2.sh

and creates following output:

++ echo 'start successful tests...'
start successful tests...
++ touch PrintHelloWorld.sh
++ sleep 1
++ ./PrintHelloWorld.sh
Hello World
++ touch PrintHelloWorld.sh
++ cat PrintHelloWorld.sh
echo 'Hello World'
++ ./PrintHelloWorld.sh
Hello World
++ echo 'echo '\''Hello World'\'''
++ ./PrintHelloWorld2.sh
Hello World
++ echo cleanup...
cleanup...
++ rm PrintHelloWorld.sh
++ rm PrintHelloWorld2.sh

The complete repro-environment including script and logs are attached.

Attachments (1)

VBoxBug.zip (21.9 KB ) - added by progger98 4 years ago.
Test-environment + TestOutput + VBox-machine-logs

Download all attachments as: .zip

Change History (1)

by progger98, 4 years ago

Attachment: VBoxBug.zip added

Test-environment + TestOutput + VBox-machine-logs

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use