Thomas Lamprecht
1ffe030123
various typo fixes
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-25 18:52:31 +02:00
Thomas Lamprecht
c86b6f40d7
tools/format: implement from u64 for HumanByte helper type
...
Could be problematic for systems where usize is 32 bit, but we do not
really support those.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-25 14:18:49 +02:00
Dominik Csapak
934deeff2d
fix #2904 : zpool status: parse vdevs with state but without statistics
...
some vdevs (e.g. spares) have a 'state' (e.g. AVAIL), but
not statistics like READ/WRITE/etc.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-08-14 11:41:32 +02:00
Dominik Csapak
c162df60c8
zfs status: add test with spares
...
this will fail for now, fixed in the next commit
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-08-14 11:41:32 +02:00
Hannes Laimer
be614c625f
api2/node/../disks/directory: added DELETE endpoint for removal of mount-units
...
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2020-08-14 07:06:10 +02:00
Wolfgang Bumiller
df30017ff8
remove unused import
...
rustc doesn't warn about this kind of import, however,
clippy does
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-13 09:05:15 +02:00
Wolfgang Bumiller
3f3ae19d63
formatting fixups
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-12 14:30:03 +02:00
Wolfgang Bumiller
72dc68323c
replace and remove old ticket functions
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-12 14:28:21 +02:00
Wolfgang Bumiller
593f917742
introduce Ticket struct
...
and add tests and compatibility tests
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-12 14:28:21 +02:00
Dietmar Maurer
3dc1a2d5b6
src/tools/fs.rs: new helper lock_dir_noblock
...
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-08-11 10:57:48 +02:00
Wolfgang Bumiller
e7cb4dc50d
introduce Username, Realm and Userid api types
...
and begin splitting up types.rs as it has grown quite large
already
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-10 12:05:01 +02:00
Wolfgang Bumiller
98c259b4c1
remove timer and lock functions, fix building with proxmox 0.3.2
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-04 11:33:02 +02:00
Wolfgang Bumiller
1cafbdc70d
more whitespace fixups
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-03 12:02:19 +02:00
Wolfgang Bumiller
a3eb7b2cea
whitespace fixup
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-03 12:00:59 +02:00
Dominik Csapak
eeb19aeb2d
systemd/time: fix weekday wrapping on month
...
the weekday does not change depending on the month, so remove that wrapping
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-08-03 08:18:42 +02:00
Dominik Csapak
6c96ec418d
systemd/time: add tests for weekday month wrapping
...
this will fail for now, gets fixed in the next commit
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-08-03 08:15:26 +02:00
Dominik Csapak
be10cdb122
fix #2856 : also check whole device for device mapper
...
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-07-28 11:03:45 +02:00
Dominik Csapak
a4d1675513
api2/access: implement term ticket
...
modeled after pves/pmgs vncticket (i substituted the vnc with term)
by putting the path and username as secret data in the ticket
when sending the ticket to /access/ticket it only verifies it,
checks the privs on the path and does not generate a new ticket
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-07-23 11:55:00 +02:00
Thomas Lamprecht
50ec1a8712
tools/format: add struct to pretty print bytes
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-23 09:36:02 +02:00
Thomas Lamprecht
a74b026baa
systemd/time: document CalendarEvent struct and add TODOs
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-23 07:55:42 +02:00
Thomas Lamprecht
956295cefe
parse_calendar_event: support the weekly special expression
...
While we do not yet support the date specs for CalendarEvent the left
out "weekly" special expression[0] dies not requires that support.
It is specified to be equivalent with `Mon *-*-* 00:00:00` [0] and
this can be implemented with the weekday and time support we already
have.
[0]: https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Events
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-21 13:24:51 +02:00
Thomas Lamprecht
449e4a66fe
tools/xattr: a char from C is not universally a rust i8
...
Make it actually do the correct cast by using `libc::c_char`.
Fixes issues when building on other platforms, e.g., the aarch64
client only build on Arch Linux ARM I tested in my free time.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-19 19:46:27 +02:00
Wolfgang Bumiller
032cd1b862
pxar: restore file attributes, improve errors
...
and use the correct integer types for these operations
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-07-14 10:25:45 +02:00
Dominik Csapak
ec01eeadc6
refactor CertInfo to tools
...
we want to reuse some of the functionality elsewhere
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-07-10 11:08:53 +02:00
Dominik Csapak
3ec99affc8
get_disks: don't fail on zfs_devices
...
zfs does not have to be installed, so simply log an error and
continue, users still get an error when clicking directly on
ZFS
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-07-09 13:47:31 +02:00
Dominik Csapak
a9649ddc44
disks/zpool_status: add test for pool with special character
...
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-07-09 13:37:31 +02:00
Dominik Csapak
4f9096a211
disks/zpool_list: allow some more characters for pool list
...
not exhaustive of what zfs allows (space is missing), but this
can be done easily without problems
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-07-09 13:37:31 +02:00
Dominik Csapak
c3a4b5e2e1
zpool_list: add tests for special pool names
...
those names are allowed for zpools
these will fail for now, but it will be fixed in the next commit
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-07-09 13:37:31 +02:00
Dietmar Maurer
f91d58e157
src/tools/runtime.rs: implement get_runtime_with_builder
2020-07-07 10:11:04 +02:00
Dominik Csapak
4eb4e94918
fix test output
...
field separator for pools is always a tab when using -H
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-26 10:31:11 +02:00
Dominik Csapak
402c8861d8
fix typo
...
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-26 09:12:29 +02:00
Dominik Csapak
cbef49bf4f
remove absolute paths when executing binaries
...
we set the paths manually, so this is ok
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-23 07:09:06 +02:00
Dominik Csapak
f386f512d0
add AsyncReaderStream
...
and replace AsyncIndexReader's stream implementation with that
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-23 06:33:31 +02:00
Dietmar Maurer
3ddb14889a
src/tools/daemon.rs: reopen STDOUT/STDERR journald streams to get correct PID in logs
2020-06-22 13:06:53 +02:00
Wolfgang Bumiller
c08fac4d69
tools::daemon: sync with child after MainPid message
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-22 10:58:04 +02:00
Wolfgang Bumiller
dc2ef2b54f
tools::daemon: fetch exe name in the beginning
...
We get the path to our executable via a readlink() on
"/proc/self/exe", which appends a " (deleted)" during
package reloads.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-22 10:31:54 +02:00
Dietmar Maurer
f28cfb322a
avoid compiler warnings
2020-06-20 07:24:02 +02:00
Dietmar Maurer
3bbe291c51
zpool_status.rs - indented_list_to_tree: do not set name property
...
This is no necessary. We only touch/set 'children' and 'leaf' properties.
2020-06-20 07:19:25 +02:00
Dietmar Maurer
215968e033
src/tools/disks/zpool_status.rs: add 'leaf' attribute to root node, rename 'prev' into 'parent'
2020-06-20 06:49:06 +02:00
Dietmar Maurer
eddd1a1b9c
src/tools/disks/zpool_status.rs: move use clause top of file
2020-06-20 06:17:22 +02:00
Dietmar Maurer
d2ce211899
fixup for previous commit
2020-06-20 06:15:26 +02:00
Dietmar Maurer
1cb46c6f65
src/tools/disks/zpool_status.rs - cleanup: use struct StackItem instead of tuple
2020-06-19 18:58:57 +02:00
Dietmar Maurer
5d88c3a1c8
src/tools/disks/zpool_status.rs: remove unnecessary checks
...
Thos things can never happen, so simply use unwrap().
2020-06-19 18:27:39 +02:00
Dietmar Maurer
07fb504943
src/tools/disks/zpool_status.rs: simplify code by using serde_json::to_value
2020-06-19 17:51:13 +02:00
Dietmar Maurer
f675c5e978
src/tools/disks/zpool_status.rs - add all attributes to the tree
2020-06-19 16:55:28 +02:00
Wolfgang Bumiller
4e37d9ce67
add general indented_list_to_tree implementation
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-19 14:37:40 +02:00
Wolfgang Bumiller
e303077132
lru_cache: restrict and annotate Send impl
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-19 09:37:34 +02:00
Dietmar Maurer
3352ee5656
parse_zpool_status_field: handle tabs without copying input
2020-06-18 19:40:01 +02:00
Dietmar Maurer
b29cbc414d
parse_zpool_status_vdev: consider tabs as 8 spaces
2020-06-18 18:38:56 +02:00
Dietmar Maurer
9438aca6c9
src/tools/disks/zpool_status.rs: improve parser
2020-06-18 14:55:22 +02:00