Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
f65f108f
Commit
f65f108f
authored
Jan 16, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamic history support
parent
4f0fb003
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
10 deletions
+52
-10
asn1c/webcgi/asn1c.cgi
asn1c/webcgi/asn1c.cgi
+52
-10
No files found.
asn1c/webcgi/asn1c.cgi
View file @
f65f108f
...
@@ -12,8 +12,10 @@ $TMPDIR = '/tmp/asn1c-cgi-jail/';
...
@@ -12,8 +12,10 @@ $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
$MD5ProgramPath
=
'
md5
';
$HashProgramPath
=
'
md5
';
# Program to hash the input
$DM
=
0750
;
# Directory mode for all mkdirs.
$DM
=
0750
;
# Directory mode for all mkdirs.
$MaxHistoryItems
=
5
;
# Number of items in History
$DynamicHistory
=
'
yes
';
# Full/Short history
$warn
=
'
<CENTER><FONT SIZE=+1><B>
';
$warn
=
'
<CENTER><FONT SIZE=+1><B>
';
$unwarn
=
'
</B></FONT></CENTER>
';
$unwarn
=
'
</B></FONT></CENTER>
';
...
@@ -116,6 +118,21 @@ sub prepareChrootEnvironment() {
...
@@ -116,6 +118,21 @@ sub prepareChrootEnvironment() {
my
$EnvironmentSetOK
=
prepareChrootEnvironment
();
my
$EnvironmentSetOK
=
prepareChrootEnvironment
();
#
# Check if full history requested.
#
$HistoryShow
=
cookie
('
HistoryShow
');
$tmpHSParam
=
param
('
history
');
# Control cookie setting
if
(
defined
(
$tmpHSParam
)
&&
$tmpHSParam
ne
$HistoryShow
&&
$tmpHSParam
=~
/^(full|short)$/
)
{
$HistoryShow
=
$tmpHSParam
;
local
$ck
=
cookie
(
-
name
=>
'
HistoryShow
',
-
value
=>
$HistoryShow
,
-
path
=>
'
/
',
-
expires
=>
'
+1h
');
print
"
Set-Cookie:
"
.
$ck
.
"
\n
";
}
#
#
# Prepare the session and create the session directory.
# Prepare the session and create the session directory.
# If session exists, perfom arguments checking and execute historic views.
# If session exists, perfom arguments checking and execute historic views.
...
@@ -132,7 +149,7 @@ unless($session) {
...
@@ -132,7 +149,7 @@ unless($session) {
}
}
my
$pid
=
open
(
R
,
"
-|
");
my
$pid
=
open
(
R
,
"
-|
");
if
(
$pid
==
0
)
{
# Child
if
(
$pid
==
0
)
{
# Child
open
(
W
,
"
|
$
MD5
ProgramPath
")
or
die
;
open
(
W
,
"
|
$
Hash
ProgramPath
")
or
die
;
print
W
$session
;
print
W
$session
;
exit
(
0
);
exit
(
0
);
}
}
...
@@ -143,7 +160,7 @@ unless($session) {
...
@@ -143,7 +160,7 @@ unless($session) {
mkdir
(
$sessionDir
,
$DM
)
or
bark
(
$SandBoxInitFailed
);
mkdir
(
$sessionDir
,
$DM
)
or
bark
(
$SandBoxInitFailed
);
my
$ck
=
cookie
(
-
name
=>
'
SessionID
',
-
value
=>
$session
,
my
$ck
=
cookie
(
-
name
=>
'
SessionID
',
-
value
=>
$session
,
-
path
=>
'
/
',
-
expires
=>
'
+1y
');
-
path
=>
'
/
',
-
expires
=>
'
+1y
');
print
header
(
-
expires
=>
'
-1
d
',
-
cookie
=>
$ck
);
print
header
(
-
expires
=>
'
-1
y
',
-
cookie
=>
$ck
);
$HTTPHeaderGenerated
=
1
;
$HTTPHeaderGenerated
=
1
;
}
else
{
}
else
{
$session
=~
s/[^a-f0-9]//ig
;
$session
=~
s/[^a-f0-9]//ig
;
...
@@ -322,7 +339,7 @@ foreach my $trans (sort { $b cmp $a } @transactions) {
...
@@ -322,7 +339,7 @@ foreach my $trans (sort { $b cmp $a } @transactions) {
local
(
$t
,
$f
)
=
(
$1
,
$2
);
local
(
$t
,
$f
)
=
(
$1
,
$2
);
local
$origTime
=
$t
;
local
$origTime
=
$t
;
$t
=~
s/T/ /
;
#
1999-01-02T13:53:12 => 1999-01-02 13:53:12
$t
=~
s/T/ /
;
#
"1999-01-02T13:53:12" => "1999-01-02 13:53:12"
# Global transaction number
# Global transaction number
local
$tNum
=
1
+
$#transactions
-
$CountHistoryItems
;
local
$tNum
=
1
+
$#transactions
-
$CountHistoryItems
;
...
@@ -381,7 +398,7 @@ foreach my $trans (sort { $b cmp $a } @transactions) {
...
@@ -381,7 +398,7 @@ foreach my $trans (sort { $b cmp $a } @transactions) {
.
"
transaction
$tNum
(
"
.
"
transaction
$tNum
(
"
.
join
('
,
',
@safeNames
)
.
join
('
,
',
@safeNames
)
.
"
) failed with code
$ec
"
.
"
) failed with code
$ec
"
.
'
&body=leave body empty or add more comments">Help me fix it!</A>
'
.
'
&body=leave body empty or add more comments">Help me fix it!</A>
(See bottom line)
'
.
'
</FONT>
'
.
'
</FONT>
'
;
;
$atLeastOneError
=
1
;
$atLeastOneError
=
1
;
...
@@ -399,10 +416,35 @@ foreach my $trans (sort { $b cmp $a } @transactions) {
...
@@ -399,10 +416,35 @@ foreach my $trans (sort { $b cmp $a } @transactions) {
.
"
<TD><FONT SIZE=-2 FACE=Helvetica>
"
.
"
<TD><FONT SIZE=-2 FACE=Helvetica>
"
.
$results
.
$results
.
"
</TD>
"
.
"
</TD>
"
.
"
</TR>
";
.
"
</TR>
\n
";
last
unless
(
++
$CountHistoryItems
<
5
);
last
if
(
++
$CountHistoryItems
>=
$MaxHistoryItems
&&
$HistoryShow
ne
'
full
');
}
}
if
(
$DynamicHistory
eq
'
yes
')
{
# [Un-]limit number of history items
$HistoryItemsHidden
=
1
+
$#transactions
-
$CountHistoryItems
;
if
(
$HistoryItemsHidden
>
0
)
{
# Propose to expand the list.
local
$item
=
'
item
';
$HistoryItemsHidden
==
1
or
$item
=
'
items
';
$history
.=
"
<TR BGCOLOR=white><TD COLSPAN=3 ALIGN=center>
"
.
"
<FONT SIZE=-1><A HREF=
\"
$myName
?history=full
\"
>
"
.
"
Show full history</A>
"
.
"
(
$HistoryItemsHidden
hidden
$item
)
"
.
"
</FONT></TD></TR>
\n
";
}
elsif
(
$HistoryShow
eq
"
full
"
&&
$#transactions
>=
$MaxHistoryItems
)
{
# Propose to shorten the list.
local
$item
=
'
item
';
$MaxHistoryItems
==
1
or
$item
=
'
items
';
$history
.=
"
<TR BGCOLOR=white><TD COLSPAN=3 ALIGN=center>
"
.
"
<FONT SIZE=-1><A HREF=
\"
$myName
?history=short
\"
>
"
.
"
Short history</A> (
$MaxHistoryItems
$item
)
"
.
"
</FONT></TD></TR>
\n
";
}
}
if
(
$history
)
{
if
(
$history
)
{
$history
=
"
<H3>History</H3>
"
$history
=
"
<H3>History</H3>
"
.
"
<TABLE CELLPADDING=0 CELLSPACING=0 BGCOLOR=#404040 WIDTH=100%><TR><TD>
"
.
"
<TABLE CELLPADDING=0 CELLSPACING=0 BGCOLOR=#404040 WIDTH=100%><TR><TD>
"
...
@@ -457,7 +499,7 @@ print LOG "\n"; # Finalize logging record
...
@@ -457,7 +499,7 @@ print LOG "\n"; # Finalize logging record
PRINTOUT:
PRINTOUT:
print
header
(
-
expires
=>
'
-1
d
')
unless
(
$HTTPHeaderGenerated
);
print
header
(
-
expires
=>
'
-1
y
')
unless
(
$HTTPHeaderGenerated
);
# If environment has never been set up completely, remove it.
# If environment has never been set up completely, remove it.
if
(
$EnvironmentSetOK
!=
1
&&
$TMPDIR
ne
"
/
")
{
if
(
$EnvironmentSetOK
!=
1
&&
$TMPDIR
ne
"
/
")
{
...
@@ -484,7 +526,7 @@ $content
...
@@ -484,7 +526,7 @@ $content
<HR WIDTH=70%>
<HR WIDTH=70%>
<CENTER><ADDRESS><FONT SIZE=-1 FACE=Courier COLOR=#404040>
<CENTER><ADDRESS><FONT SIZE=-1 FACE=Courier COLOR=#404040>
<A HREF=http://lionet.info/asn1c>The ASN.1 Compiler</A>
<A HREF=http://lionet.info/asn1c>The ASN.1 Compiler</A>
Copyright © 2003, 2004
Copyright © 2003, 2004
, 2005
Lev Walkin <<A HREF=mailto:vlm@lionet.info?Subject=asn1c>vlm@lionet.info</A>>
Lev Walkin <<A HREF=mailto:vlm@lionet.info?Subject=asn1c>vlm@lionet.info</A>>
</FONT></ADDRESS></CENTER>
</FONT></ADDRESS></CENTER>
</BODY>
</BODY>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment