The libc function mkdtemp takes a C char pointer while we previously
cast our OSString buffer as i8 pointer, but that's not valid on
platforms like AArch64 (ARM), where char is equivalent with a u8.
Fix that by using the c_char type that was explicitly made to always
get the correct, platform-independent type for C chars when doing FFI.
This was reported by OJaksch on our Arch Linux User Repo (AUR) package
[0].
https://aur.archlinux.org/packages/proxmox-backup-client#comment-1006851
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This way we can copy and modify a schema.
Eg. via the following ways:
const FOO_SCHEMA: Schema = SOME_SCHEMA
.unwrap_integer_schema_cloned()
.description("Foo")
.schema();
Note that for example there is currently no builder to set a
`default_key` for an `ObjectSchema` back to None, so one could do:
const FOO_SCHEMA: Schema = const {
let mut schema = SOME_SCHEMA.unwrap_object_schema_cloned();
schema.default_key = None;
schema.schema()
};
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Because the UI kept producing them...
And still does...
This is NOT meant to be used by anything other than generated legacy
code for PDM (pve-api-types) and only affects the serde based
deserializer. The "old" `schema.parse_property_string() -> Value`
method does not utilize this for now.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
To prepare for a breaking change in proxmox-schema.
Since new fields in the schema constitute a breaking change, using the
builder methods will let this compile later as well.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
so that we can have a property:
```
foo: Option<PropertyString<Bar>>,
```
within a struct that derives `Updater`
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
We tried this unconditionally on start-up in the PDM for the priv. API
daemon, but we actually only want to clean-up on fresh bind, not on
restoring the FD on daemon reload. Otherwise the unprivileged daemon
cannot connect to the privileged one anymore after the latter got
reloaded.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
For consistency with it's other repositories, we might migrate other
products also to this schema with a future major release (and nginx
rewrite config for backward compatibility)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Migrated from `log` to `tracing`. Imported `tracing` only as it has a
smaller footprint (and less dependencies) than `proxmox_log`.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
with edition 2024 `static mut` references will be disallowed [1]. the
recommended way to work around this is to use inner mutability, so use a
`OnceLock` for the `PRODUCT_CONFIG` as that should not change throughout
the run time of an application.
[1]:
https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>