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:

apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin

2do. Condición:

root=root

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;

BUT THE DIRECTORY WASN'T BEEN CREATE.

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


In reply to mkdir permission by seafree

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.