chmod is broken and insecure

Bug #1021725 reported by Sergey "Shnatsel" Davidoff
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scratch
Fix Released
Critical
Mario Guerriero

Bug Description

I appreciate attempting to make some files executable on initial save, but the way it's currently implemented is really ugly. You're using a wrapper to system() syscall instead of using chmod() UNIX function. Besides being broken (here's what I get in console on saving:
"chmod: missing operand after `+x'
Try `chmod --help' for more information." ) it presents a potential security vulnerability.
Please use chmod() unix function instead.

Changed in scratch:
milestone: none → luna-beta1
summary: - chmod is broken and ugly
+ chmod is broken and insecure
Revision history for this message
Mario Guerriero (mefrio-g) wrote :

yeah it is a very very ugly implementation

Changed in scratch:
status: New → Confirmed
Revision history for this message
xapantu (xapantu) wrote :

It doesn't need to be private...

Revision history for this message
Mario Guerriero (mefrio-g) wrote :

Yes it can be public

Changed in scratch:
assignee: nobody → Mario Guerriero (mefrio-g)
security vulnerability: yes → no
visibility: private → public
Changed in scratch:
status: Confirmed → Fix Committed
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Setting permissions to fixed permissive 777 is not good enough AFAIK. By default files get 664 permissions, so what you want to set is probably 775

Changed in scratch:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.