eniocarboni / p7m

p7m è uno script per la gestione dei file con firma digitale nel formato CADES
https://quoll.it/firma-digitale-p7m-come-estrarre-il-contenuto/
GNU General Public License v3.0
48 stars 5 forks source link

cannot create directory '/.config' Permission denied #16

Closed pfloriginale closed 3 years ago

pfloriginale commented 3 years ago

Hi Mr. Carboni, thanks a lot for your project that, for Italy invoice are really better than openssl!

Everythings works fine, just receive this message

mkdir: cannot create directory '/.config': Permission denied
mkdir: cannot create directory '/.config': Permission denied
P7M
Unable to create the .p7m directory in your HOME
P7M
Starting download fatturapa_v1.2.1.xsl ... wait, please
touch: cannot touch '/.config/p7m/.dwn.log': No such file or directory
wget: /.config/p7m/.dwn.log: No such file or directory

Extract the file in 'ade_fe/4/ricevute/it01336610587_0diax.xml'
[tipo: application/xml]int(0)

Do you think is important? thanks a lot

Paolo

eniocarboni commented 3 years ago

Hi @pfloriginale , It would appear that you are running "p7m" with a user who does not have the home directory, for example a system user or a web user. If so try editing line 30 and replacing "${HOME}/.Config/p7m" with a writable directory for your user.

Let me know if you can fix it and thanks for using p7m

pfloriginale commented 3 years ago

Wow Enio, you are so reactive in answer me!

Do you thinks will be a problem if I leavi script with this problem? Now it works fine, and I don't understand the difference

eniocarboni commented 3 years ago

Hi @pfloriginale, if you are only interested in extracting the file contained in the p7m, without verifying the signature and the certificate, then there are no problems. The only thing to note is that you will continue to have notification messages like in your first post.

pfloriginale commented 3 years ago

IT08806580968_1ERS4.xml.p7m.zip

Dear Enio, today, when I process this .p7m (italian elettronic invoice from one of partner), I receive error "bad file".

If I try it on a .p7m online viewer it works fine

Could you help me?

eniocarboni commented 3 years ago

There appears to be a problem on some p7m files highlighted by your file. For now use this command for this file: openssl cms -verify -noverify -in "IT08806580968_1ERS4.xml.p7m" -inform DER -out IT08806580968_1ERS4.xml

pfloriginale commented 3 years ago

Thanks, I know openssl, but, for some .p7m dosen't works!

This is why I find you!

If your scritp fail with the message "bad file", the file is deleted.

Do you know some workaround? I'm just looking for a universal solution... like this website https://www.amministrazionicomunali.it/fatturexml/

eniocarboni commented 3 years ago

Hi @pfloriginale I should have solved with the latest commit. if you want you can download the latest version.