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
The snap command to list backups uses an asterisk (*) to attempt to list all files in a directory, which is a feature of some shells, known as file globbing - more info here: http://wiki.bash-hackers.org/syntax/expansion/globs
However this command is run directly and not passed through a shell, so the called executable looks for a file with the literal name of "*", and fails - as can be seen if you check the command with strace:
lstat("/var/snap/wekan/common/db-backups/*", 0x140b690) = -1 ENOENT (No such file or directory)
I did a quick test with a file named "*", which was picked up by the command:
root@wekan:/var/snap/wekan/common/db-backups# python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open('*', 'w')
>>> f.write("hey hey")
>>> f.close()
>>> exit()
root@wekan:/var/snap/wekan/common/db-backups# ls -lah
total 920K
drwxrwxrwx 2 root root 131 Jan 31 13:30 .
drwxr-xr-x 5 root root 8.0K Jan 31 13:23 ..
-rw-r--r-- 1 root root 7 Jan 31 13:30 *
-rw-r--r-- 1 root root 281K Jan 29 16:59 wekan-20180129T165611.backup
-rw-r--r-- 1 root root 306K Jan 30 14:50 wekan-20180130T145015.backup
-rw-r--r-- 1 root root 309K Jan 31 03:00 wekan-20180131T030001.backup
root@wekan:/var/snap/wekan/common/db-backups# wekan.database-list-backups
-rw-r--r-- 1 root root 7 Jan 31 13:30 /var/snap/wekan/common/db-backups/*
Obviously, this is not the intended behaviour. I haven't had a chance to test it yet, but I believe changing the database-list-backups command to use ls -al $SNAP_COMMON/db-backups/ instead of ls -ald $SNAP_COMMON/db-backups/* should work. the -d flag is unnecessary since backups are files, not directories.
This testing was done on a Ubuntu 16.04.3 VM, with snapd version 2.29.4.2, if that makes a difference.
Regards, Anthony.
The text was updated successfully, but these errors were encountered:
Hi,
The snap command to list backups uses an asterisk (*) to attempt to list all files in a directory, which is a feature of some shells, known as file globbing - more info here: http://wiki.bash-hackers.org/syntax/expansion/globs
However this command is run directly and not passed through a shell, so the called executable looks for a file with the literal name of "*", and fails - as can be seen if you check the command with strace:
lstat("/var/snap/wekan/common/db-backups/*", 0x140b690) = -1 ENOENT (No such file or directory)
I did a quick test with a file named "*", which was picked up by the command:
Obviously, this is not the intended behaviour. I haven't had a chance to test it yet, but I believe changing the database-list-backups command to use
ls -al $SNAP_COMMON/db-backups/
instead ofls -ald $SNAP_COMMON/db-backups/*
should work. the-d
flag is unnecessary since backups are files, not directories.This testing was done on a Ubuntu 16.04.3 VM, with snapd version 2.29.4.2, if that makes a difference.
Regards, Anthony.
The text was updated successfully, but these errors were encountered: