i-nex / I-Nex

System information tool written in gambas3, python, bash
http://i-nex.linux.pl/
174 stars 24 forks source link

files which are not an executable or a script shouldn't have write permissions - #40

Closed shirishag75 closed 7 years ago

shirishag75 commented 7 years ago

According to lintian -


W: i-nex: executable-not-elf-or-script etc/i-nex/Database/amd.json
N: 
N:    This executable file is not an ELF format binary, and does not start
N:    with the #! sequence that marks interpreted scripts. It might be a sh
N:    script that fails to name /bin/sh as its shell, or it may be incorrectly
N:    marked as executable. Sometimes upstream files developed on Windows are
N:    marked unnecessarily as executable on other systems.
N:    
N:    If you are using debhelper to build your package, running dh_fixperms
N:    will often correct this problem for you.
N:    
N:    Refer to Debian Policy Manual section 10.4 (Scripts) for details.
N:    
N:    Severity: normal, Certainty: certain
N:    
N:    Check: scripts, Type: binary
N: 
W: i-nex: executable-not-elf-or-script usr/share/i-nex/pastebinit/release.conf
W: i-nex: executable-not-elf-or-script etc/i-nex/SIV/pcmdevs.txt
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/i7.json
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/NULLD.json
W: i-nex: executable-not-elf-or-script etc/i-nex/SIV/usbdevs.txt
W: i-nex: executable-not-elf-or-script etc/i-nex/SIV/pcidevs.txt
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/atom.json
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/intel.json
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/Xeon.json
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/intel_Core_2_Duo.json
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/i5.json
W: i-nex: executable-not-elf-or-script usr/share/i-nex/pastebinit/pastebinit.xml
W: i-nex: executable-not-elf-or-script etc/i-nex/SIV/mondevs.txt
W: i-nex: executable-not-elf-or-script etc/i-nex/SIV/pnpdevs.txt
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/i2c/devices.json
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/A6.json
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/i3.json
W: i-nex: executable-not-elf-or-script etc/i-nex/Database/Opteron.json

I investigated and found it to be true, please fix the above -

┌─[shirish@debian] - [~] - [10110]
└─[$] dpkg -L clutter-1.0-tests | grep json                                                                                      
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-state-1.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-timeline-markers.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-single.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-object-property.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-named-object.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-model.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-margin.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-layout-property.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-interval.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-implicit-alpha.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-child.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-script-animation.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-animator-3.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-animator-2.json
/usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-animator-1.json

Just taking one for example -

┌─[shirish@debian] - [~] - [10111]
└─[$] ll -h /usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-animator-1.json                                                

-rw-r--r-- 1 root root 75 Mar 26  2016 /usr/lib/clutter-1.0/installed-tests/clutter/scripts/test-animator-1.json

And yours -

┌─[shirish@debian] - [~/games] - [10248]
└─[$] dpkg -L i-nex | grep json                                                                                                    
/etc/i-nex/Database/A6.json
/etc/i-nex/Database/NULLD.json
/etc/i-nex/Database/Opteron.json
/etc/i-nex/Database/Xeon.json
/etc/i-nex/Database/amd.json
/etc/i-nex/Database/atom.json
/etc/i-nex/Database/i2c/devices.json
/etc/i-nex/Database/i3.json
/etc/i-nex/Database/i5.json
/etc/i-nex/Database/i7.json
/etc/i-nex/Database/intel.json
/etc/i-nex/Database/intel_Core_2_Duo.json
┌─[shirish@debian] - [~/games] - [10249]
└─[$] ll -h /etc/i-nex/Database/A6.json                                                                                             
-rwxr-xr-x 1 root root 20K Dec  7  2015 /etc/i-nex/Database/A6.json

AFAIK they don't need need executable rights as it is data which would be used by libcpuid to figure out what processor is there so they don't need executable rights/permissions.

eloaders commented 7 years ago

This is the data in JSON format. And they are not in any way related to libcpuid. These data i-nex needs to show the manufacturer's information on the processor.

shirishag75 commented 7 years ago

you are right, it is not related to libcpuid but still does the json data need to have executable rights in order to do the job, is it necessary on any GNU/Linux/BSD/Unix platform ?

eloaders commented 7 years ago

Before compilation law json files are fine. After building the package, the rights themselves are changing. You need to do now so that they do not have the rights to execution.

shirishag75 commented 7 years ago

hmm... just saw your commits and tried to build. It fails at -

Install database files...
make -C Database install
make[2]: Entering directory '/home/shirish/games/I-Nex'
make[2]: *** Database: No such file or directory.  Stop.
make[2]: Leaving directory '/home/shirish/games/I-Nex'
Makefile:81: recipe for target 'install-database' failed
make[1]: *** [install-database] Error 2
make[1]: Leaving directory '/home/shirish/games/I-Nex'
dh_auto_install: make -j1 install DESTDIR=/home/shirish/games/I-Nex/debian/i-nex AM_UPDATE_INFO_DIR=no returned exit code 2
debian/rules:23: recipe for target 'binary' failed
make: *** [binary] Error 2
eloaders commented 7 years ago

Is bug has been fixed? If so, please closing.

shirishag75 commented 7 years ago

yup, it did get fixed but I got this while installing it -

Unpacking i-nex (7.4.0.1) over (7.4.0.1) ...
dpkg: warning: unable to delete old directory '/etc/i-nex/SIV': Directory not empty
dpkg: warning: unable to delete old directory '/etc/i-nex/Database/i2c': Directory not empty
dpkg: warning: unable to delete old directory '/etc/i-nex/Database/Logos': Directory not empty
dpkg: warning: unable to delete old directory '/etc/i-nex/Database/Distlogos': Directory not empty
dpkg: warning: unable to delete old directory '/etc/i-nex/Database': Directory not empty
dpkg: warning: unable to delete old directory '/etc/i-nex': Directory not empty

But I fixed that by manually emptying the directories under /etc/i-nex and again installing the debian packages.

Btw it would be nice/good if you bump up the minor release numbers when you make changes once in a while, for e.g. from 7.4.0.1 - 7.4.0.2 (/suggestion)

eloaders commented 7 years ago

The changes will go to 7.6.0 after the repair all errors.