Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
aa5fc1bf
Commit
aa5fc1bf
authored
Mar 06, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inc/system: tmp_path extermination
parent
a47ad5e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
system.inc
src/etc/inc/system.inc
+16
-18
No files found.
src/etc/inc/system.inc
View file @
aa5fc1bf
...
...
@@ -385,7 +385,7 @@ function system_routing_configure($interface = '')
$foundgwv6
=
false
;
/* tack on all the hard defined gateways as well */
if
(
is_array
(
$config
[
'gateways'
][
'gateway_item'
]))
{
array_map
(
'unlink'
,
glob
(
"
{
$g
[
'tmp_path'
]
}
/*_defaultgw
{
,v6
}
"
,
GLOB_BRACE
));
array_map
(
'unlink'
,
glob
(
'/tmp/*_defaultgw{,v6}'
,
GLOB_BRACE
));
foreach
(
$config
[
'gateways'
][
'gateway_item'
]
as
$gateway
)
{
if
(
isset
(
$gateway
[
'defaultgw'
]))
{
if
(
$gateway
[
'ipprotocol'
]
!=
"inet6"
&&
(
is_ipaddrv4
(
$gateway
[
'gateway'
])
||
$gateway
[
'gateway'
]
==
"dynamic"
))
{
...
...
@@ -398,7 +398,7 @@ function system_routing_configure($interface = '')
if
(
!
empty
(
$gateway
[
'interface'
]))
{
$defaultif
=
get_real_interface
(
$gateway
[
'interface'
]);
if
(
$defaultif
)
@
file_put_contents
(
"
{
$g
[
'tmp_path'
]
}
/
{
$defaultif
}
_defaultgw"
,
$gateway
[
'gateway'
]);
@
file_put_contents
(
"
/tmp
/
{
$defaultif
}
_defaultgw"
,
$gateway
[
'gateway'
]);
}
$foundgw
=
true
;
}
else
if
(
$gateway
[
'ipprotocol'
]
==
"inet6"
&&
(
is_ipaddrv6
(
$gateway
[
'gateway'
])
||
$gateway
[
'gateway'
]
==
"dynamic"
))
{
...
...
@@ -409,7 +409,7 @@ function system_routing_configure($interface = '')
if
(
!
empty
(
$gateway
[
'interface'
]))
{
$defaultifv6
=
get_real_interface
(
$gateway
[
'interface'
]);
if
(
$defaultifv6
)
@
file_put_contents
(
"
{
$g
[
'tmp_path'
]
}
/
{
$defaultifv6
}
_defaultgwv6"
,
$gateway
[
'gateway'
]);
@
file_put_contents
(
"
/tmp
/
{
$defaultifv6
}
_defaultgwv6"
,
$gateway
[
'gateway'
]);
}
$foundgwv6
=
true
;
}
...
...
@@ -422,13 +422,13 @@ function system_routing_configure($interface = '')
$defaultif
=
get_real_interface
(
"wan"
);
$interfacegw
=
"wan"
;
$gatewayip
=
get_interface_gateway
(
"wan"
);
@
touch
(
"
{
$g
[
'tmp_path'
]
}
/
{
$defaultif
}
_defaultgw"
);
@
touch
(
"
/tmp
/
{
$defaultif
}
_defaultgw"
);
}
if
(
$foundgwv6
==
false
)
{
$defaultifv6
=
get_real_interface
(
"wan"
);
$interfacegwv6
=
"wan"
;
$gatewayipv6
=
get_interface_gateway_v6
(
"wan"
);
@
touch
(
"
{
$g
[
'tmp_path'
]
}
/
{
$defaultif
}
_defaultgwv6"
);
@
touch
(
"
/tmp
/
{
$defaultif
}
_defaultgwv6"
);
}
$dont_add_route
=
false
;
/* if OLSRD is enabled, allow WAN to house DHCP. */
...
...
@@ -915,8 +915,7 @@ function system_generate_lighty_config(
{
global
$config
,
$g
;
if
(
!
is_dir
(
"
{
$g
[
'tmp_path'
]
}
/lighttpdcompress"
))
mkdir
(
"
{
$g
[
'tmp_path'
]
}
/lighttpdcompress"
);
@
mkdir
(
'/tmp/lighttpdcompress'
);
if
(
$captive_portal
!==
false
)
{
$captiveportal
=
",
\"
mod_rewrite
\"
,
\"
mod_evasive
\"
"
;
...
...
@@ -927,16 +926,15 @@ function system_generate_lighty_config(
$maxprocperip
=
10
;
$captive_portal_mod_evasive
=
"evasive.max-conns-per-ip =
{
$maxprocperip
}
"
;
$server_upload_dirs
=
"server.upload-dirs = (
\"
{
$g
[
'tmp_path'
]
}
/captiveportal/
\"
)
\n
"
;
if
(
!
is_dir
(
"
{
$g
[
'tmp_path'
]
}
/captiveportal"
))
@
mkdir
(
"
{
$g
[
'tmp_path'
]
}
/captiveportal"
,
0555
);
$server_upload_dirs
=
"server.upload-dirs = (
\"
/tmp/captiveportal/
\"
)
\n
"
;
@
mkdir
(
'/tmp/captiveportal'
,
0555
);
$server_max_request_size
=
"server.max-request-size = 384"
;
$cgi_config
=
""
;
}
else
{
$captiveportal
=
",
\"
mod_cgi
\"
"
;
$captive_portal_rewrite
=
""
;
$captive_portal_mod_evasive
=
""
;
$server_upload_dirs
=
"server.upload-dirs = (
\"
{
$g
[
'upload_path'
]
}
/
\"
,
\"
{
$g
[
'tmp_path'
]
}
/
\"
,
\"
/var/
\"
)
\n
"
;
$server_upload_dirs
=
"server.upload-dirs = (
\"
{
$g
[
'upload_path'
]
}
/
\"
,
\"
/tmp
/
\"
,
\"
/var/
\"
)
\n
"
;
$server_max_request_size
=
"server.max-request-size = 2097152"
;
$cgi_config
=
"cgi.assign = (
\"
.cgi
\"
=>
\"\"
)"
;
}
...
...
@@ -983,12 +981,13 @@ server.errorlog-use-syslog="enable"
EOD;
}
if
(
$captive_portal
!==
false
)
$fast_cgi_path
=
"
{
$g
[
'tmp_path'
]
}
/php-fastcgi-
{
$captive_portal
}
.socket"
;
else
$fast_cgi_path
=
"
{
$g
[
'tmp_path'
]
}
/php-fastcgi.socket"
;
if
(
$captive_portal
!==
false
)
{
$fast_cgi_path
=
"/tmp/php-fastcgi-
{
$captive_portal
}
.socket"
;
}
else
{
$fast_cgi_path
=
"/tmp/php-fastcgi.socket"
;
}
$fastcgi_config
=
<<<EOD
$fastcgi_config
=
<<<EOD
#### fastcgi module
## read fastcgi.txt for more info
fastcgi.server = ( ".php" =>
...
...
@@ -1007,7 +1006,6 @@ fastcgi.server = ( ".php" =>
EOD;
$lighty_config
=
<<<EOD
#
# lighttpd configuration file
...
...
@@ -1156,7 +1154,7 @@ debug.log-request-handling = "disable"
debug.log-file-not-found = "disable"
# gzip compression
compress.cache-dir = "
{$g['tmp_path']}
/lighttpdcompress/"
compress.cache-dir = "
/tmp
/lighttpdcompress/"
compress.filetype = ("text/plain","text/css", "text/xml", "text/javascript" )
{$server_upload_dirs}
...
...
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