MEGAcmd icon indicating copy to clipboard operation
MEGAcmd copied to clipboard

mega-permissions values ignored - always default to 600 (files) and 700 (folders)

Open vkononov opened this issue 1 year ago • 6 comments

I am running MegaCMD on CentOS Stream v8.

[centos@server ~]$ mega-version 
MEGAcmd version: 1.6.1.3: code 1060103

My file and folder permissions are set like this:

[centos@server ~]$ mega-permissions 
Default files permissions: 664
Default folders permissions: 775

However, new files and folders synced to the server have the following permissions:

[centos@server ~]$ ls -l
drwx------ 2 centos centos 4096 Sep  7 03:16 test
-rw------- 1 centos centos    0 Sep  7 03:16 test.txt

It appears that MegaCMD is completely ignoring the custom permissions I set. I have tried restarting the server, but the issue persists.

vkononov avatar Sep 07 '23 03:09 vkononov

I am noticing the same problem with mega-cmd in ubuntu, with versions 1.6.1 (where I started noticing the problem?) and 1.6.3 (which I tried after noticing the problem). No matter what value I set for "permissions" in mega-cmd, synced files default to 600 (files) and 700 (folders). The same if I create a folder using "mkdir" in mega-cmd.

sam-pf avatar Oct 05 '23 18:10 sam-pf

I have the same issue with versions 1.6.3.1 and 1.6.3.9 on Arch Linux. The output of mega-permissions matches the values in $HOME/.megaCMD/megacmd.cfg, but no further effect seems to happen.

reifmaxi avatar Nov 21 '23 13:11 reifmaxi

I have the same issue on debian (10, 11, 12). Every time a file is updated the permission 600 are set:

asidirop@asidirop-srv:~/MEGA/tmp/test$ chmod 644 test-file
asidirop@asidirop-srv:~/MEGA/tmp/test$ 
asidirop@asidirop-srv:~/MEGA/tmp/test$ ls -l
total 4
-rw-r--r-- 1 asidirop asidirop 20 Dec  5 15:04 test-file
asidirop@asidirop-srv:~/MEGA/tmp/test$ ls -la
total 12
drwxr-xr-x 2 asidirop asidirop 4096 Dec  5 15:04 .
drwxr-xr-x 8 asidirop asidirop 4096 Dec  5 14:58 ..
-rw-r--r-- 1 asidirop asidirop   20 Dec  5 15:04 test-file
asidirop@asidirop-srv:~/MEGA/tmp/test$  mega-permissions
Default files permissions: 644
Default folders permissions: 755
asidirop@asidirop-srv:~/MEGA/tmp/test$ umask
0022
asidirop@asidirop-srv:~/MEGA/tmp/test$ # Change it remotely from another client
asidirop@asidirop-srv:~/MEGA/tmp/test$ ls -la
total 12
drwxr-xr-x 2 asidirop asidirop 4096 Dec  5 15:05 .
drwxr-xr-x 8 asidirop asidirop 4096 Dec  5 14:58 ..
-rw------- 1 asidirop asidirop   30 Dec  5 15:05 test-file
asidirop@asidirop-srv:~/MEGA/tmp/test$ mega-version 
MEGAcmd version: 1.6.3.4: code 1060304
asidirop@asidirop-srv:~/MEGA/tmp/test$ more ~/.megaCmd/megacmd.cfg 
ask4storage=0
permissionsFiles=644
permissionsFolders=755
firstSyncConfigured=1

asidirop avatar Dec 05 '23 13:12 asidirop

I encountered the same issue on 1.6.1. (Ubuntu 22.04) It still works on 1.5.1 if you manage to compile it from source (no reliable .deb files to be found)

Here's` how I did after some trial and error:

sudo apt install autoconf libtool g++ libcrypto++-dev libz-dev libsqlite3-dev libssl-dev libcurl4-gnutls-dev libreadline-dev libpcre++-dev libsodium-dev libc-ares-dev libfreeimage-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libmediainfo-dev libzen-dev libuv1-dev
git clone https://github.com/meganz/MEGAcmd.git
cd MEGAcmd && git submodule update --init --recursive
git checkout 1.5.1_Linux
git submodule update
sh autogen.sh
 ./configure --without-freeimage
make
make install

This will install in /usr/local/bin. May need to update ldconfig too and add /usr/local/lib

tinmanjk avatar Feb 06 '24 02:02 tinmanjk

This is still unresolved... no official response.

ytoaa avatar May 20 '24 17:05 ytoaa

This appears to be fixed in v1.7.0 based on the changelog. I just tested with the Ubuntu 24.04 .deb (which was the only OS I could find with a v1.7.0 package in the downloads) and it is indeed working.

jasonccox avatar Jun 06 '24 02:06 jasonccox