b5c9a706ce
fix cancellable future
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-12-13 12:10:04 +01:00
db0cb9ce0b
update a chunk of stuff to the hyper release
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-12-13 11:24:41 +01:00
62ee2eb405
avoid some clippy warnings
2019-10-26 11:42:05 +02:00
834a2f95a0
avoid some clippy warnings
2019-10-25 18:44:51 +02:00
175eeb870d
clippy: use write_all in file logger
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-11 13:56:09 +02:00
653b1ca10e
some clippy fixups
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-11 12:14:05 +02:00
c77563146b
comment fixup
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-03 11:17:33 +02:00
daef93f481
tools: add tokio::main() replacement
...
to deal with block_on() not allowing blocking()
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-03 11:16:30 +02:00
66fbf5bad0
add WrappedReaderStream test
...
Mostly to just document the rt.block_on() issue with
blocking().
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-03 10:05:45 +02:00
083ff3fd5d
update to tokio 0.2.0-alpha.4
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-02 15:21:26 +02:00
556eb70ea3
add generic either-or AsyncRead/Write type
...
The HttpsConnector will use this. Instead of implementing a
specialized MaybeTlsStream, this is simply a generic "either
this or that kind of Async Read/Write type".
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-02 15:21:26 +02:00
0cdb8d9c5b
src/tools/wrapped_reader_stream.rs: switch to async
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-02 15:21:26 +02:00
e668912a99
src/tools/futures.rs: switch to async
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-02 15:21:26 +02:00
0f5856acca
src/tools/daemon.rs: switch to async
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-02 15:21:26 +02:00
56e351c911
src/tools/broadcast_future.rs: switch to async
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-02 15:21:26 +02:00
627bb7d114
src/tools/async_mutex.rs: switch to async
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-09-02 15:21:26 +02:00
40f8680e37
tools: remove SignalFd
...
We don't use it anymore and it'll just be more work when
switching to async-await.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-08-23 13:44:53 +02:00
48b85e8e3b
tools: tty: replace mem::uninitialized and style fixup
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-08-22 11:14:19 +02:00
b528fddfc6
tools: timer: style fixup
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-08-22 11:07:56 +02:00
b7f44ace92
timer: replace mem::uninitialized
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-08-22 11:07:10 +02:00
7f66c29e5c
remove src/tools/common_regex.rs, use proxmox::tools::common_regex instead
2019-08-03 16:44:31 +02:00
fd329bdcd7
remove src/tools/procfs.rs, use proxmox::sys::linux::procfs instead
2019-08-03 16:26:44 +02:00
779e4c90b1
src/tools/vec.rs: remove unused file
...
We already moved that to proxmox::tools
2019-08-03 16:11:47 +02:00
e18a6c9ee5
update to nix 0.14, use code from proxmox:tools
2019-08-03 13:05:38 +02:00
b86f263ced
use new proxmox::sys::linux::magic
2019-08-03 09:28:57 +02:00
5e50c606b0
pxar: cleanup: s/CA_FORMAT/PXAR/g and s/CaFormat/Pxar/g
...
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-08-03 08:51:33 +02:00
91451c4355
pxar: cleanup: move filesystem related magic numbers to tools/fs/magic.rs
...
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-08-03 08:48:12 +02:00
2be3eff5c3
pxar: avoid taking ownership of xattrs, fcaps and quota_projid on corresponding restore functions.
...
By borrowing these objects we preserve the functionality but make sure
that ownership doesn't change, avoiding problems when contained within other
structs such as e.g. a buffer storing these attributes.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-08-02 06:44:00 +02:00
c698636a5d
src/tools/fs.rs - read_dir: return nix::Result
2019-07-04 10:47:16 +02:00
f35197f449
replace tools::vec with proxmox::tools::vec
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-07-01 11:03:25 +02:00
d0162d53d3
tools: remove io module
...
now completely replaced by proxmox::tools::io.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-07-01 10:44:12 +02:00
9110a69bd8
tools: remove read/write
...
now completely replaced by
proxmox::tools::io::{ReadExt, WriteExt}
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-07-01 10:39:42 +02:00
ca3c3ce997
daemon: remove last use of tools::read/write
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-07-01 10:39:13 +02:00
dd5495d6dc
tree-wide: use 'dyn' for all trait objects
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-06-07 13:13:48 +02:00
44c54845b3
src/tools/xattr.rs: fix test when run as root
2019-06-05 07:57:42 +02:00
042babe4e7
src/tools/fs.rs: impl ioctl calls to get/set fsxattr
...
This implements fs_ioc_fsgetxattr/fs_ioc_fssetxattr calls in order to read or
write fsxattr for a given file descriptor.
This is needed in order to read or write the quota project id for filesystems
which support project quotas (EXT4/XFS/FUSE).
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-06-05 06:22:49 +02:00
390e83c9b9
typo fix and doc improvement
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-05-29 11:57:28 +02:00
7fb49397d5
doc fixup
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-05-29 11:56:14 +02:00
382609b04e
tools: add Cancellable, start a futures submodule
...
To make a future cancellable, use:
let (future, canceller) =
crate::tools::futures::cancellable(future);
Proceed with using `future` as usual, `canceller` is
clonable and can cancel the future via the `.cancel()`
method.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-05-29 11:18:29 +02:00
0d32d71fb7
tools: add AsyncMutex::new_locked
...
Allows creating a pre-locked mutex, returning the mutex and
a guard.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-05-29 11:18:29 +02:00
687407741b
src/tools/xattr.rs: add test for is_valid_xattr_name()
...
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-05-24 06:11:36 +02:00
357e4614e2
Minor refactoring of pxars xattr encoder/decoder, mostly reformatting and renaming.
...
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-05-24 06:11:36 +02:00
c05a8c8d18
doc-test fixup
...
cargo test by default compiles and runs all code snippets
found in the documentation...
oops...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-05-23 15:22:33 +02:00
8ea3b1d188
tree-wide: use the new vec/io tools modules
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-05-23 09:49:10 +02:00
9cdda3f7c7
tools: add helpful vector and read operations
...
After importing the I/O ops trait via:
use crate::tools::io::ops::*;
Instead of:
let mut buffer = vec![0u8; 65536];
file.read_exact(&mut buffer)?;
use:
let buffer = file.read_exact_allocated(65536)?;
After importing the vector helpers via:
use crate::tools::vec::{self, ops::*};
For a buffer which *could* be uninitialized but you prefer
zero-initialization anyway for security reasons, instead of:
let mut buffer = vec![0u8; len];
use:
let mut buffer = vec::undefined(len);
which zero-initializes, but, if the `valgrind` feature flag
is enabled, marks the vector as having undefined contents,
so reading from it will cause valgrind errors.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-05-23 09:49:10 +02:00
de61bc9264
src/tools/xattr.rs: impl unit tests for fsetattr and fgetattr
...
As git does not preserve xattrs they have to be set before they can be read.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-05-22 10:01:10 +02:00
bee8d8ea78
src/tools/xattr.rs: add functions name_store and security_capability
...
These functions allow to check if the name for xattrs/fcaps are valid.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-05-21 06:05:31 +02:00
2dcdd3b427
src/tools/xattrs.rs: impl libc wrapper functions to get/set xattrs and fcaps
...
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-05-16 11:14:21 +02:00
dec1ff18b8
src/tools/acl.rs: impl add_entry_full for ACL and set_permissions for ACLEntry
...
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-05-16 11:10:06 +02:00
d22096ef4b
src/tools/acl.rs: impl POSIX access control list (ACL) manipulation tools
...
Signed-off-by: Christian Ebner <c.ebner@proxmox.com >
2019-05-14 06:28:42 +02:00