Commit 46175ff8 authored by Lev Walkin's avatar Lev Walkin

per support

parent 1b6d63d1
...@@ -12,6 +12,7 @@ $TMPDIR = '/tmp/asn1c-cgi-jail/'; ...@@ -12,6 +12,7 @@ $TMPDIR = '/tmp/asn1c-cgi-jail/';
$SUIDHelper = './asn1c-suid-helper'; $SUIDHelper = './asn1c-suid-helper';
$SkeletonsDir = '/usr/local/share/asn1c'; # Will be needed only once $SkeletonsDir = '/usr/local/share/asn1c'; # Will be needed only once
$CompilerLocation = '/usr/local/bin/asn1c'; # asn1c binary location $CompilerLocation = '/usr/local/bin/asn1c'; # asn1c binary location
$GNUTar = '/usr/local/bin/gtar'; # GNU tar utility
$HelpDBFile = $TMPDIR . '/var/db/Help-DB'; # Help requests database $HelpDBFile = $TMPDIR . '/var/db/Help-DB'; # Help requests database
$HashProgramPath = 'md5'; # Program to hash the input $HashProgramPath = 'md5'; # Program to hash the input
$DM = 0750; # Directory mode for all mkdirs $DM = 0750; # Directory mode for all mkdirs
...@@ -289,7 +290,7 @@ sub makeArchive($$) { ...@@ -289,7 +290,7 @@ sub makeArchive($$) {
. " fi done" . " fi done"
. " && find . -name '*.[ch]' -print0" . " && find . -name '*.[ch]' -print0"
. " > ./+tmp." . $$ . ".files" . " > ./+tmp." . $$ . ".files"
. " && tar --dereference --ignore-failed-read --owner nobody --group nobody -zcf +tmp." . $$ . ".arch --null --files-from +tmp." . $$ . ".files Makefile* +Compiler.Log *.asn *.asn1 *.ber *.cer *.der *.bin *.dat *.mhg *.txt" . " && $GNUTar --dereference --ignore-failed-read --owner nobody --group nobody -zcf +tmp." . $$ . ".arch --null --files-from +tmp." . $$ . ".files Makefile* +Compiler.Log *.asn *.asn1 *.ber *.cer *.der *.bin *.dat *.mhg *.txt 2>/dev/null"
. " && (cat ./+tmp.". $$ .".files | xargs -0 rm -f)" . " && (cat ./+tmp.". $$ .".files | xargs -0 rm -f)"
. " && rm -f ./Makefile* ./+tmp.". $$ .".files" . " && rm -f ./Makefile* ./+tmp.". $$ .".files"
. " && mv ./+tmp." . $$ . ".arch $archName" . " && mv ./+tmp." . $$ . ".arch $archName"
...@@ -547,6 +548,7 @@ if($#gotSafeNames >= 0) { ...@@ -547,6 +548,7 @@ if($#gotSafeNames >= 0) {
$specOpts{asn1} .= " -EF" if optGet('optEF'); $specOpts{asn1} .= " -EF" if optGet('optEF');
$specOpts{asn1} .= " -fnative-types" if optGet('optNT'); $specOpts{asn1} .= " -fnative-types" if optGet('optNT');
$specOpts{asn1} .= " -fcompound-names" if optGet('optCN'); $specOpts{asn1} .= " -fcompound-names" if optGet('optCN');
$specOpts{asn1} .= " -gen-PER" if optGet('optPER');
$specOpts{ber} .= " -s4 -1" if optGet('optIgnFrame'); $specOpts{ber} .= " -s4 -1" if optGet('optIgnFrame');
$specOpts{ber} .= " -m" if optGet('optMin'); $specOpts{ber} .= " -m" if optGet('optMin');
my $CompileASN = "$TMPDIR/bin/asn1c -v 2>&1 | sed -e 's/^/-- /'" my $CompileASN = "$TMPDIR/bin/asn1c -v 2>&1 | sed -e 's/^/-- /'"
...@@ -631,11 +633,9 @@ function conditionalDisplay(d, cond) { ...@@ -631,11 +633,9 @@ function conditionalDisplay(d, cond) {
if(cond) { if(cond) {
d.style.display = "block"; d.style.display = "block";
d.style.position = "relative"; d.style.position = "relative";
d.style.visibility = "visible";
} else { } else {
d.style.display = "none"; d.style.display = "none";
d.style.position = "fixed"; d.style.position = "fixed";
d.style.visibility = "hidden";
} }
} }
function fileTypeChanged(s) { function fileTypeChanged(s) {
...@@ -704,7 +704,7 @@ function explanation(id, showFull) { ...@@ -704,7 +704,7 @@ function explanation(id, showFull) {
<FORM METHOD=POST NAME=form ACTION=$myName ENCTYPE="multipart/form-data"> <FORM METHOD=POST NAME=form ACTION=$myName ENCTYPE="multipart/form-data">
<DIV STYLE="width: 100%;"> <DIV STYLE="width: 100%;">
<DIV ID=arrow>&rArr;</DIV><DIV ID=aarr><b>Pick</b> the ASN.1 module text or binary encoded data file:<BR> <DIV class=arrow>&rArr;</DIV><DIV class=aarr><b>Pick</b> the ASN.1 module text or binary encoded data file:<BR>
<SELECT NAME=fileType onchange="return fileTypeChanged(this);"> <SELECT NAME=fileType onchange="return fileTypeChanged(this);">
<OPTION VALUE=auto>Autodetect file type... <OPTION VALUE=auto>Autodetect file type...
<OPTION VALUE=asn1>ASN.1 specification text ... <OPTION VALUE=asn1>ASN.1 specification text ...
...@@ -717,7 +717,7 @@ foreach my $t (sort { $binaryDecoders{$a}{shorder} ...@@ -717,7 +717,7 @@ foreach my $t (sort { $binaryDecoders{$a}{shorder}
my $description = $dec{description}; my $description = $dec{description};
if(!$notauto && $dec{order} < 0) { if(!$notauto && $dec{order} < 0) {
$notauto = 1; $notauto = 1;
$form .= "<OPTION ID=noauto VALUE=no DISABLED=\"disabled\">"; $form .= "<OPTION VALUE=no DISABLED=\"disabled\">";
$form .= "--- not autodetectable (PER): ---"; $form .= "--- not autodetectable (PER): ---";
$form .= "\n"; $form .= "\n";
next; next;
...@@ -731,8 +731,8 @@ $form .= << "EOM"; ...@@ -731,8 +731,8 @@ $form .= << "EOM";
</SELECT>&nbsp;&nbsp;<INPUT TYPE=file NAME=file SIZE=13> </SELECT>&nbsp;&nbsp;<INPUT TYPE=file NAME=file SIZE=13>
</DIV> </DIV>
<DIV ID="options-asn" STYLE="visibility: visible;"> <DIV ID="options-asn">
<DIV ID=arrow>&rArr;</DIV><DIV ID=aarr><b>Or paste</b> the ASN.1 text into the area below:$rtt <DIV class=arrow>&rArr;</DIV><DIV class=aarr><b>Or paste</b> the ASN.1 text into the area below:$rtt
<BR> <BR>
<TEXTAREA NAME=text ROWS=16 COLS=60 STYLE="font-family: courier; font-size: 11px;"> <TEXTAREA NAME=text ROWS=16 COLS=60 STYLE="font-family: courier; font-size: 11px;">
EOM EOM
...@@ -759,17 +759,21 @@ if(open(T, '< ' . $sessionDir . '/lastText')) { ...@@ -759,17 +759,21 @@ if(open(T, '< ' . $sessionDir . '/lastText')) {
; ;
} }
my $freeSpace = `df -hn $TMPDIR | awk '{print \$4}' | tail -1`;
chomp $freeSpace;
$form .= << "EOM"; $form .= << "EOM";
</TEXTAREA> </TEXTAREA>
</DIV> </DIV>
<DIV CLASS=options> <DIV class=options>
<DIV ID=optsbar-lite CLASS=optsbar> <DIV ID=optsbar-lite CLASS=optsbar>
These options may be used to control the compiler's behavior:<BR> These options may be used to control the compiler's behavior:<BR>
<INPUT TYPE=checkbox NAME=optDebugL> Debug lexer (<I>-Wdebug-lexer</I>)<BR> <INPUT TYPE=checkbox NAME=optDebugL> Debug lexer (<I>-Wdebug-lexer</I>)<BR>
<INPUT TYPE=checkbox NAME=optE> Just parse and dump (do not verify) (<I>-E</I>)<BR> <INPUT TYPE=checkbox NAME=optE> Just parse and dump (do not verify) (<I>-E</I>)<BR>
<INPUT TYPE=checkbox NAME=optEF> Parse, verify validity, and dump (<I>-E -F</I>)<BR> <INPUT TYPE=checkbox NAME=optEF> Parse, verify validity, and dump (<I>-E -F</I>)<BR>
<INPUT TYPE=checkbox NAME=optNT CHECKED=on> Use native machine types (e.g. <b>double</b> instead of <b>REAL_t</b>) (<I>-fnative-types</I>)<BR> <INPUT TYPE=checkbox NAME=optNT CHECKED=on> Use native machine types (e.g. <b>double</b> instead of <b>REAL_t</b>) (<I>-fnative-types</I>)<BR>
<INPUT TYPE=checkbox NAME=optPER> Generate PER support (<I>-gen-PER</I>), default is BER, DER and XER<BR>
<INPUT TYPE=checkbox NAME=optCN> Prevent name clashes in compiled output (<I>-fcompound-names</I>)<BR> <INPUT TYPE=checkbox NAME=optCN> Prevent name clashes in compiled output (<I>-fcompound-names</I>)<BR>
<I>... the command line ASN.1 compiler, <A HREF="$ASN1C_Page">asn1c</A>, supports many other parameters</I>. <I>... the command line ASN.1 compiler, <A HREF="$ASN1C_Page">asn1c</A>, supports many other parameters</I>.
</DIV> </DIV>
...@@ -790,8 +794,8 @@ These options may be used to control the compiler's behavior:<BR> ...@@ -790,8 +794,8 @@ These options may be used to control the compiler's behavior:<BR>
</DIV> </DIV>
</DIV> <!-- options-ber --> </DIV> <!-- options-ber -->
<DIV ID=arrow>&rArr;</DIV><DIV ID=aarr><INPUT TYPE=submit ID=proceed VALUE="Proceed with ASN.1 compilation" onClick="return formSubmit();"> <DIV class=arrow>&rArr;</DIV><DIV class=aarr><INPUT TYPE=submit ID=proceed VALUE="Proceed with ASN.1 compilation" onClick="return formSubmit();">
(<A HREF=$ASN1C_Page>What is ASN.1?</A>) <span class="extrasmall">(Available disk space: $freeSpace)</span>
</DIV> </DIV>
</DIV> </DIV>
</FORM> </FORM>
...@@ -843,7 +847,7 @@ foreach my $trans (sort { $b cmp $a } @transactions) { ...@@ -843,7 +847,7 @@ foreach my $trans (sort { $b cmp $a } @transactions) {
local $_ = "<A HREF=\"$myName?time=" local $_ = "<A HREF=\"$myName?time="
. escapeHTML($origTime) . escapeHTML($origTime)
. "&file=$f" . "&file=$f"
. "&fetch=$safeNames[$i]\" ID=modrefs>" . "&fetch=$safeNames[$i]\" class=modrefs>"
. escapeHTML($Names[$i]) . escapeHTML($Names[$i])
. "</A>"; . "</A>";
@markedNames = (@markedNames, $_); @markedNames = (@markedNames, $_);
...@@ -955,8 +959,8 @@ foreach my $trans (sort { $b cmp $a } @transactions) { ...@@ -955,8 +959,8 @@ foreach my $trans (sort { $b cmp $a } @transactions) {
$trColor = ' BGCOLOR=#d0ffe0' if $CountHistoryItems == 1; $trColor = ' BGCOLOR=#d0ffe0' if $CountHistoryItems == 1;
$history .= "<TR $trColor>" $history .= "<TR $trColor>"
. "<TH ALIGN=center ID=num>$tNum" . "<TH ALIGN=center CLASS=num>$tNum"
. "<BR><FONT FACE=serif>[<A ID=modrefs " . "<BR><FONT FACE=serif>[<A class=modrefs "
. "HREF=\"$myName?time=" . "HREF=\"$myName?time="
. escapeHTML($origTime) . escapeHTML($origTime)
. "&file=$f&remove=$tNum\"" . "&file=$f&remove=$tNum\""
...@@ -965,7 +969,7 @@ foreach my $trans (sort { $b cmp $a } @transactions) { ...@@ -965,7 +969,7 @@ foreach my $trans (sort { $b cmp $a } @transactions) {
. "<TD ALIGN=center>" . "<TD ALIGN=center>"
. join(", ", @markedNames) . join(", ", @markedNames)
. "</TD></TD>" . "</TD></TD>"
. "<FORM METHOD=POST ACTION=$myName><TD ID=extrasmall>" . "<FORM METHOD=POST ACTION=$myName><TD class=extrasmall>"
. $results . $results
. "</TD></FORM>" . "</TD></FORM>"
. "</TR>" . "</TR>"
...@@ -1026,7 +1030,7 @@ unless($history) { ...@@ -1026,7 +1030,7 @@ unless($history) {
} }
$content .= $content .=
"<TABLE WIDTH=100% BORDER=0 CELLSPACING=5 CELLPADDING=5><TR><TD ID=inputbox VALIGN=top ROWSPAN=2 WIDTH=40%>\n" "<TABLE WIDTH=100% BORDER=0 CELLSPACING=5 CELLPADDING=5><TR><TD class=inputbox VALIGN=top ROWSPAN=2 WIDTH=40%>\n"
. "<H3 ALIGN=center>ASN.1 Input</H3>\n" . "<H3 ALIGN=center>ASN.1 Input</H3>\n"
. "$form" . "$form"
. "</TD><TD WIDTH=60% HEIGHT=50% ALIGN=center VALIGN=$histValign>$history \n" . "</TD><TD WIDTH=60% HEIGHT=50% ALIGN=center VALIGN=$histValign>$history \n"
...@@ -1064,7 +1068,7 @@ $redirect ...@@ -1064,7 +1068,7 @@ $redirect
color: #404040; color: #404040;
font-family: monospace; font-family: monospace;
} }
TH#num { TH.num {
font-size: 8pt; font-size: 8pt;
font-family: sans-serif; font-family: sans-serif;
} }
...@@ -1072,14 +1076,14 @@ $redirect ...@@ -1072,14 +1076,14 @@ $redirect
font-size: 10pt; font-size: 10pt;
font-family: sans-serif; font-family: sans-serif;
} }
TD#inputbox { TD.inputbox {
border-right: dashed 1px rgb(200, 200, 200); border-right: dashed 1px rgb(200, 200, 200);
} }
DIV { DIV {
font-size: 10pt; font-size: 10pt;
font-family: sans-serif; font-family: sans-serif;
} }
DIV#extrasmall { .extrasmall {
font-size: 7pt; font-size: 7pt;
font-family: sans-serif; font-family: sans-serif;
} }
...@@ -1091,11 +1095,11 @@ $redirect ...@@ -1091,11 +1095,11 @@ $redirect
margin-left: 1em; margin-left: 1em;
} }
DIV.options#options-bin { DIV.options#options-bin {
visibility: hidden; display: none;
position: fixed; position: fixed;
} }
DIV.options#options-ber { DIV.options#options-ber {
visibility: hidden; display: none;
position: fixed; position: fixed;
} }
DIV.optsbar#optsbar-lite { font-size: 7pt; } DIV.optsbar#optsbar-lite { font-size: 7pt; }
...@@ -1107,26 +1111,26 @@ $redirect ...@@ -1107,26 +1111,26 @@ $redirect
border-left: dashed 1px rgb(200, 200, 200); border-left: dashed 1px rgb(200, 200, 200);
} }
DIV#arrow { DIV.arrow {
float: left; float: left;
color: rgb(160,160,160); color: rgb(160,160,160);
} }
DIV#aarr { DIV.aarr {
display: block; display: block;
margin-left: 1em; margin-left: 1em;
padding-bottom: 5px; padding-bottom: 5px;
padding-left: 2pt; padding-left: 2pt;
} }
A#modrefs { A.modrefs {
color: #606060; color: #606060;
text-decoration: none; text-decoration: none;
} }
A:hover#modrefs { A:hover.modrefs {
text-decoration: underline; text-decoration: underline;
} }
A:visited#modrefs { A:visited.modrefs {
color: #b06060; color: #b06060;
} }
</STYLE> </STYLE>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment