Commit Graph

408 Commits

Author SHA1 Message Date
Wolfgang Bumiller
952fd95e84 Tools: add unshare system call
Including the important CLONE_* constants.
2015-09-17 13:20:15 +02:00
Emmanuel Kasper
87cb0e6064 Allow top level devel domain name up to 63 characters in email adresses
This corrects the server side validation, and fixes the bug: https://bugzilla.proxmox.com/show_bug.cgi?id=716
2015-09-17 12:56:48 +02:00
Dietmar Maurer
2c3c3ffe88 update changelog 2015-09-16 10:51:29 +02:00
Alexandre Derumier
685a2528b1 add bridge_vlan_aware
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-16 10:48:52 +02:00
Dietmar Maurer
f3a423a8e0 bump version to 4.0-22 2015-09-16 09:11:48 +02:00
Wolfgang Bumiller
fcdc0cfc8a Tools::run_command: array of arrays special case
Passing an array of arrays to run_command will cause each
array to be treated like a command piped to the following
command. Each argument is shell-quoted unless its passed by
reference.
2015-09-16 09:08:53 +02:00
Wolfgang Bumiller
bd9c3a3654 document run_command 2015-09-16 09:07:42 +02:00
Dietmar Maurer
5de0dd1fbe bump version to 4.0-21 2015-09-15 09:04:24 +02:00
Dietmar Maurer
8f3712f87f CLIHandler: allow binaries with '-' in command name
We automatically replace '-' with '_' to get the class name (perl
class names may not contain '-').
2015-09-15 08:24:54 +02:00
Wolfgang Bumiller
21d32c95cd remove autostart property from bridge ports
Fixes #711
2015-09-14 12:42:47 +02:00
Dietmar Maurer
ef69578b74 bump version to 4.0-20 2015-09-09 09:14:05 +02:00
Dietmar Maurer
b78e40c095 avoid Exporter warning
Else we get the following warning:

Subroutine PVE::ProcFSTools::getcwd redefined at /usr/share/perl/5.20/Exporter.pm line 66.
 at /usr/share/perl5/PVE/ProcFSTools.pm line 9.
2015-09-09 09:10:15 +02:00
Dietmar Maurer
1fdc4565ef bump version to 4.0-19 2015-09-08 07:17:08 +02:00
Wolfgang Bumiller
11ade4ad45 is_mounted: use realpath on the mountpoint
This will avoid problmes with symlinks as well as paths
containing ./, ../ or trailing slashes.
2015-09-07 13:02:17 +02:00
Dietmar Maurer
638edfd429 add missing formatter property to method schema 2015-09-04 13:50:06 +02:00
Dietmar Maurer
2a8ced7bac run_cli: skip environment init for PVE::Service::* classes
This is done by the daemon implementation instead.
2015-09-04 12:32:44 +02:00
Dietmar Maurer
edf3d572aa CLIHandler: add support for services (PVE::Daemon), rename run to run_cli
And improve bash completion.
2015-09-04 11:10:52 +02:00
Dietmar Maurer
bb958629be generate_pod_manpage: fix for 'simple' commands 2015-09-04 09:39:50 +02:00
Dietmar Maurer
4347914633 get_options: avoid warning for -list format 2015-09-04 08:52:57 +02:00
Dietmar Maurer
7fe1f565b4 handle_simple_cmd: code cleanups
Add support for 'simple' commands in generate_pod_manpage().
2015-09-04 07:46:25 +02:00
Dietmar Maurer
c45707a0c9 CLIHandler: add helper to generate bash completion config 2015-09-04 06:19:05 +02:00
Dietmar Maurer
93ddd7bc6e add run() method to CLIHandler
we can reuse that code for several binaries.
2015-09-03 18:58:27 +02:00
Dietmar Maurer
1f130ba641 add helpers to verify API without starting the binary
In future, we want to have a separate PVE::CLI::$binname class
for each binary. We can then simply load that class to verify
the API:

 use PVE::CLI::pct;

 PVE::CLI::pct->verify_api();

or to generate the docs:

 PVE::CLI::pct->generate_pod_manpage();
2015-09-03 15:12:03 +02:00
Wolfgang Bumiller
1068aeb398 remove + from getopt's prefix_pattern
Perl by default interprets + as a parameter prefix, which
means commands like `pct resize 103 rootfs +1G` error with
'Unknown option: 1g', we don't want that.
2015-09-03 11:19:28 +02:00
Wolfgang Link
115c838376 This function checks if a moutpoint is mounted 2015-09-03 10:03:39 +02:00
Dietmar Maurer
ad571b7569 new helper: read_proc_mounts 2015-09-03 10:03:39 +02:00
Dietmar Maurer
d8053c08c2 add bash completion handler 2015-09-02 15:23:14 +02:00
Dietmar Maurer
7829989f5e add new property to support bash completions 2015-09-02 13:31:17 +02:00
Dietmar Maurer
791000409f bump version to 4.0-18 2015-09-01 17:47:47 +02:00
Wolfgang Bumiller
5851be88ad added 'extra-args' CLI handling
added 'extra-args' standard option
added 'extra-args' handling to PVE::JSONSchema::get_options
untainting 'extra-args' separately in RESTHandler::handle
2015-09-01 17:46:04 +02:00
Dietmar Maurer
889e45ee1a bump version to 4.0-17 2015-08-28 11:37:32 +02:00
Wolfgang Bumiller
b6bff92ee5 Added PVE::Network::tcp_ping to replace Net::Ping
We use Net::Ping twice in pve-storage (once for ISCSIPlugin
and once in GlusterfsPlugin, both with the 'tcp' variant.),
but Net::Ping doesn't support IPv6.
2015-08-28 10:55:17 +02:00
Wolfgang Bumiller
c38cea65b6 Tools::run_with_timeout improvement + hires alarm
The following situations could lead to the 'unknown error':
1) As commented, when the alarm triggered after the first
signal handler was installed and before the new alarm was
installed. In this case the $signalcount was increased,
and worse: the original signal handler was never called.

2) When $code died, since the call itself wasn't in an eval
block, we'd leave the eval block containing the inner alarm
signal handler. Then there's a time window from leaving the
signal block (and with that restoring the first installed
only-counting signal-handler) and reaching the code to
restore the previous alarm where the counting alarm handler
could get triggered by our own alarm set before running
$code. In this case at least the the old alarm would be
restored, but we'd still trigger the 'unknown error'.

The new code starts off by suspending the original alarm
before installing any signal handler, then installing the
timeout handler inside the first eval block. The $code is
then run inside another eval block to make sure we reach the
alarm(0) statement before restoring the old signal handler
and alarm timeout.
2015-08-28 10:45:26 +02:00
Wolfgang Bumiller
b261377727 Add generic parse_host_and_port function
Added a generic function to split a host+port string to the
host and port part supporting the two most common ipv6
notations beside domains and ipv4: with brackets for the
address or a dot as port separator.
2015-08-25 12:58:09 +02:00
Wolfgang Link
fe949d0e2f Update prerequisites for development environment 2015-08-18 16:36:15 +02:00
Dietmar Maurer
570e8df762 bump version to 4.0-16 2015-08-17 09:43:57 +02:00
Wolfgang
5d35df41fc fix bug #860: fix the upload from a VM when it is restricted. 2015-08-17 08:32:51 +02:00
Dietmar Maurer
f56505bc5e bump cversion to 4.0-15 2015-08-10 09:06:39 +02:00
Alen Grizonic
32cb7d272f tap device name parse fix
Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
2015-08-10 09:05:37 +02:00
Dietmar Maurer
ba039ebd1e bump version to 4.0-14 2015-08-04 08:59:56 +02:00
Dietmar Maurer
c38ac70fe0 get_standard_option: do not overwrite defaults when they evaluate to false 2015-08-04 08:58:09 +02:00
Wolfgang Bumiller
24cea9a96e fix a typo pointed out by Immo Wetzel 2015-08-04 08:38:17 +02:00
Dietmar Maurer
971a8d8c17 bump version to 4.0-13 2015-08-03 16:13:55 +02:00
Alexandre Derumier
ff0420567b fix tap_plug with vlan for non aware vlan bridges
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-08-03 16:13:04 +02:00
Dietmar Maurer
555eefa07b bump version to 4.0-12 2015-07-30 09:00:17 +02:00
Wolfgang Bumiller
6fc54cb240 replace /sbin/vconfig with /sbin/ip call 2015-07-29 11:29:47 +02:00
Alexandre Derumier
4d25f4aafe tap_plug : add support for vlan aware linux bridge
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-29 10:48:06 +02:00
Dietmar Maurer
0177b13795 bump version to 4.0-11 2015-07-27 13:12:42 +02:00
Wolfgang Bumiller
27107d5b96 add ProcFSTools::read_proc_net_ipv6_route 2015-07-23 06:43:52 +02:00
Wolfgang Bumiller
61aa94e472 PVE::Network: add some common constants
added ipv4_reverse_mask and ipv4_mask_hash_localnet as they
are used in several places.
2015-07-23 06:27:47 +02:00