seafree has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I'm using Centos 7 and I had been to execute mkdir in perl from web, but it's not executed, the /etc/profile has:
if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; +then umask 002 else umask 022 fi

1er. condition:


2do. Condición:


The condition is false, so umask=022

File permissions for upload files: first I created a directory using mkdir from perl but it's not create:

my @archivos = $cgi->param("archivos"); my $inst = $cgi->param("inst"); my $fecha = $cgi->param("date1"); my $anio=substr($fecha,2,2); my $mes=substr($fecha,5,2); my $dia=substr($fecha,8,2); my @nombre_archivos = ("NI","RP","RDZ","CRF"); my $upload_dir = "/var/www/html/public_html/rev/$inst/$anio-$mes-$dia" +; mkdir $upload_dir, 0775;


Please will you help me? The permissons that I had been set are:

#/var/www/html drwxr-xr-x. 5 apache apache 4096 Dec 20 15:00 public_html

The error web messages is:

Software error: No such file or directory at /var/www/cgi-bin/programs/upload_modif_ok +.cgi line 49.

Line 49 is:

open ( UPLOADFILE, ">$upload_dir/$anio-$mes-$dia-$nombre_archivos[$ind +]" ) or die "$!";
For help, please send mail to the webmaster (root@localhost), giving t +his error message and the time and date of the error.

The /varlog/http/error has:

[Tue Jan 08 09:43:34.876310 2019] [cgi:error] [pid 31695] [client...] +AH01215: [Tue Jan 8 09:43:34 2019] upload_modif_ok.cgi: No such file + or directory at /var/www/cgi-bin/programs/upload_modif_ok.cgi line 4 +9., referer: http://...

Thanks a lot.

Regards. Seafree