IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
The old code used string substitution for every line of the
input string, while perl can also iterate over all matches
via the /g re modifier, and can turn ^ and $ to act as
beginning/end of line via the /m modifier.
Effectively allowing a "match over all lines" via a simple
while ($data =~ /^.*$/gm);
The situation is a little different in SectionConfig because
there's a nested loop invovled which doesn't work with /g.
For this there are two options and I chose the safer one by
simply doing a split on newlines first.
The alternative would be to open the data as a
filehandle-to-string and use <$fh> to read lines, however
I'd have to throw in an eval{} to be sure to close the
handle afterwards.
* __read_etc_interfaces:
Delete OVS ports from "allow-$OVS_BRIDGE" option lines in
order to prevent them from being duplicated or kept after
removing the port from the bridge.
* __write_etc_interfaces:
Deleting unused OVSPorts has the side effect of them not
being written out at all. If, however, they are
physical interfaces they'll reappear the next time the
configuration is read, because they're added from
/proc/net/dev.
Fix: if the deleted interface matches the same condition as
in read_etc_interfaces, readd it with the standard options:
{exists => 1, method => manual }
This is a purely aesthetical change in order to make sure a
write()->read()->write() chain doesn't produce two
different files each write().
read_etc_network_interfaces now opens all /proc files and
passes them as filehandles to the actual implementation
which is now is __read_etc_network_interfaces.
Similarly write_etc_network_interfaces now prints the
content string returned by the implementation now named
__write_etc_network_interfaces.
This way a testsuite can use the __* variants directly to
test the parser, passing its own versions of the /proc
files.
The header now mentions that the file is auto-generated and
should not be tempered with directly.
It now recommends to add custom network configurations via
source/source-directory lines.
* parsing ipv6 blocks
* parsing extra lines like source/source-directory/...
* merge multiple bridge_port lines into one
* write options only once
The returned config hash is not just the interface hash
anymore. Interfaces are now in its 'ifaces' member hash. All
unknown options (including mappings) end up in its 'options'
hash.
Added a comment describing the config hash's layout in
detail.
An interface can now have an ipv4 and an ipv6 entry, they
will be returned as a single interface with
address/netmask/gateway and address6/netmask6/gateway6
elements. Additionally a 'families' array is available
listing which families are available. Ideally we'll at some
point allow unhandled families to be kept too, however, now
that extra lines like 'source' and 'source-directory' are
preserved, it is recommended to move all custom
configuration into separate files to not interfere with our
interface parsing.
Options such as bridge ports or ovs_* will now be written
out only for the first interface. If multiple protocol
families of a bridge contain bridge_ports lines they will be
merged into the first interface.
*) Don't require indented lines, instead know when to end a
section.
*) Don't require empty lines between sections.
*) Fixed non-/greedy regex issue
And turned (.*)\s* into just (.*) as .* eats the whitespace
too.
Added some lines which make it possible to stop/start/restart daemon services with pve scripts,
avoiding the problem of systemd not recognizing the new status of the (re)started service processes.
The scripts now rely on systemctl.
Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
regexps are greedy so the first substitution eats up
multiple groups of double-colons up to the last one already.
So unless there's some intended hidden side effect this
statement has no obvious purpose.
A first step towards untangling some of the intermingled data and
functionality setup tasks for the daemons:
Daemon::new now only validates and untaints arguments, but doesn't
perform any actions such as setuid/setgid until the new Daemon::setup
method which is now executed from Daemon::start right before entering
Daemon::$server_run.
CLIHandler::handle_cmd now takes an optional $preparefunc which is
called after handling 'printmanpod' and 'verifyapi'.
spice-proxy used dns-name before which matches a combination of letters,
digits and dots, which happens to include ipv4 addresses but not ipv6
ones.
Since 'dns-name' sounds like it's only for names, I'm adding an address
format which is either a dns-name or an ip (including ipv6).
perl's IO::Socket::IP passes AI_ADDRCONFIG if no GetAddrInfoFlags are passed,
which is often useful but also causes it to error when explicitly trying to
bind to 127.0.0.1 when there are no _other_ IPv4 addresses present.
Instead of assuming a local address of 0.0.0.0, the next_*_port family
of functions now takes an optional packet family argument (AF_INET/AF_INET6),
used for ipv6 support.