Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

FTP permissions upload problem

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

sutne
Posts: 577
Joined: Sun 14 Oct 2012 4:23 pm
Weather Station: HP2560 (WS80) and HP2550 (WS90)
Operating System: Raspbian Bullseye and Bookworm
Location: Rjoanddalen and Kronstad, Norway
Contact:

Re: FTP permissions upload problem

Post by sutne »

Carbonara wrote: Sat 15 Jun 2024 7:02 pm yes, i need them because i've a custom cms who need to read the file …
You are not answering why you need executable permission.
You cannot execute .json and .txt files.
User avatar
Carbonara
Posts: 53
Joined: Mon 16 Nov 2020 10:27 pm
Weather Station: Davis and Ecowitt
Operating System: DietPi 7.5.2 ( debian bullseye)

Re: FTP permissions upload problem

Post by Carbonara »

so, this is the log
log_ftp_new_version.png
the client.txt file is a file I created with the webtags, but the same thing happens with the original realtime.txt file from cumulus, and with the json files of the graphs. At a certain point, I read that it was deleted and that recreated, or i'm wrong ?
delete_no.png
if so then it is normal for it to be loaded with 644 permissions by default. But I turned off this option in the menu. Unfortunately the ftp log does not start on the old version of cumulus :bash:
You do not have the required permissions to view the files attached to this post.
User avatar
Carbonara
Posts: 53
Joined: Mon 16 Nov 2020 10:27 pm
Weather Station: Davis and Ecowitt
Operating System: DietPi 7.5.2 ( debian bullseye)

Re: FTP permissions upload problem

Post by Carbonara »

ok started the log from 3184 version, and the difference is clear , here doesn't delete anything
old_ftp.png
You do not have the required permissions to view the files attached to this post.
SamiS
Posts: 510
Joined: Sun 27 Feb 2011 5:13 pm
Weather Station: Ecowitt HP2551 & GW1100
Operating System: Raspberry Pi OS
Location: Kangasala, Finland

Re: FTP permissions upload problem

Post by SamiS »

Well, in my eyes it looks like a bug that file is deleted before upload even when delete is disabled. I think this needs input from @mcrossley.

But actually the log from the old version looks like it is using ftp rename (file with extension .txttmp). So maybe you could achieve a similar result by enabling rename?
User avatar
Carbonara
Posts: 53
Joined: Mon 16 Nov 2020 10:27 pm
Weather Station: Davis and Ecowitt
Operating System: DietPi 7.5.2 ( debian bullseye)

Re: FTP permissions upload problem

Post by Carbonara »

No, is not the rename option. Is a temporary file created by the system.
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: FTP permissions upload problem

Post by broadstairs »

OK so it is possible that there is a bug where it deletes the file before upload even when that option is off.

However there is no reason for the data files to have the execute bit set on, in fact every FTP system I've seen does not allow the execute bit to be set on an uploaded file as it is a security exposure. I run lots of php code on my website and all that is set to 644 and that is because it is not executed directly but by (in my case) Apache which loads the code and runs it.

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
User avatar
Carbonara
Posts: 53
Joined: Mon 16 Nov 2020 10:27 pm
Weather Station: Davis and Ecowitt
Operating System: DietPi 7.5.2 ( debian bullseye)

Re: FTP permissions upload problem

Post by Carbonara »

hope it can be fixed
SamiS
Posts: 510
Joined: Sun 27 Feb 2011 5:13 pm
Weather Station: Ecowitt HP2551 & GW1100
Operating System: Raspberry Pi OS
Location: Kangasala, Finland

Re: FTP permissions upload problem

Post by SamiS »

Carbonara wrote: Sun 16 Jun 2024 9:21 am hope it can be fixed
Hard to say, probably yes, but it will also probably take at least a month until it will even be looked at since Mark is away for a summer vacation.

However, even many others have said before, I’ll say it too. It is extremely strange why your server requires ”5- read and execute” permissions for a text input file. It really should work with ”4-read only” since the file does not contain anything executable. So you really should investigate and fix that regardless of the possible bug in Cumulus.
User avatar
mcrossley
Posts: 14384
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: FTP permissions upload problem

Post by mcrossley »

I have the odd bits of time this week - none from Saturday onwards again.

You can see the request from CMX is to overwrite, but the library is doing a delete + write...
Screenshot 2024-06-18 143548.png
Indeed looking at the FTP source code that is now the intended behaviour. I have raised an issue about this on FluentFTP.

Meantime the only solution I can think of is to try setting the destination folder permissions to 755 and the uploaded files should inherit those permissions?
You do not have the required permissions to view the files attached to this post.
freddie
Posts: 2870
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 24.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: FTP permissions upload problem

Post by freddie »

Meantime the only solution I can think of is to try setting the destination folder permissions to 755 and the uploaded files should inherit those permissions?
Doesn't quite work like that. You'll need to change the umask setting for the user that is used to upload the files, and change the default to 755. That is where the perms come from. Crazy solution, though, as it shouldn't make any difference to the consumer of the file whether the execute bit is set - unless the file is to be executed. It is also a security risk, as you'll effectively set the execute bit on all files created by that user, which could be very helpful to an intruder or bad actor.
Freddie
Image
User avatar
mcrossley
Posts: 14384
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: FTP permissions upload problem

Post by mcrossley »

I agree, I'm still not seeing the need for the execute bit being set, but there seems to be a reason.
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: FTP permissions upload problem

Post by broadstairs »

I am puzzled as to why the OP has not enlightened us as to the reason for the execute bit? As everyone says it is not necessary for a data file which does not contain anything executable. I must admit that I see nothing wrong here from a CMX or FTP standpoint.

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
SamiS
Posts: 510
Joined: Sun 27 Feb 2011 5:13 pm
Weather Station: Ecowitt HP2551 & GW1100
Operating System: Raspberry Pi OS
Location: Kangasala, Finland

Re: FTP permissions upload problem

Post by SamiS »

broadstairs wrote: Tue 18 Jun 2024 4:05 pm I am puzzled as to why the OP has not enlightened us as to the reason for the execute bit? As everyone says it is not necessary for a data file which does not contain anything executable. I must admit that I see nothing wrong here from a CMX or FTP standpoint.
Agreed. But on the other hand, if overwrite (without delete) is requested, and yet the ftp library still does delete the file, there is definitely something wrong regardless of the specific case in hand.
User avatar
mcrossley
Posts: 14384
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: FTP permissions upload problem

Post by mcrossley »

I've looked further at the source code, the only way I can see currently to perform a true overwrite is to use the low-level FTP functions to open a stream directly and set the file position to zero before writing the contents. Not a hole I want to go down at the moment.

I think they changed the default behaviour because not all servers support overwriting.
User avatar
mcrossley
Posts: 14384
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: FTP permissions upload problem

Post by mcrossley »

OK, I have a fix for this, it will be in v4.1.1
Post Reply