summaryrefslogtreecommitdiffstats
path: root/vendor/gix-sec/src
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gix-sec/src')
-rw-r--r--vendor/gix-sec/src/identity.rs8
-rw-r--r--vendor/gix-sec/src/lib.rs7
2 files changed, 8 insertions, 7 deletions
diff --git a/vendor/gix-sec/src/identity.rs b/vendor/gix-sec/src/identity.rs
index 7c3df38bd..8517b6529 100644
--- a/vendor/gix-sec/src/identity.rs
+++ b/vendor/gix-sec/src/identity.rs
@@ -1,7 +1,7 @@
use std::path::Path;
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
-#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
/// An account based identity
pub struct Account {
/// The user's name
@@ -62,7 +62,7 @@ mod impl_ {
use windows::{
core::{Error, PCWSTR},
Win32::{
- Foundation::{CloseHandle, BOOL, HANDLE, PSID},
+ Foundation::{CloseHandle, BOOL, HANDLE, HLOCAL, PSID},
Security::{
Authorization::{GetNamedSecurityInfoW, SE_FILE_OBJECT},
CheckTokenMembership, EqualSid, GetTokenInformation, IsWellKnownSid, TokenOwner,
@@ -90,7 +90,7 @@ mod impl_ {
// Home is not actually owned by the corresponding user
// but it can be considered de-facto owned by the user
// Ignore errors here and just do the regular checks below
- if gix_path::realpath(path).ok() == dirs::home_dir() {
+ if gix_path::realpath(path).ok() == gix_path::env::home_dir() {
return Ok(true);
}
@@ -168,7 +168,7 @@ mod impl_ {
)
.into();
}
- LocalFree(pdescriptor.0 as isize);
+ LocalFree(HLOCAL(pdescriptor.0 as isize)).ok();
}
err_msg.map(|msg| Err(err(msg))).unwrap_or(Ok(is_owned))
diff --git a/vendor/gix-sec/src/lib.rs b/vendor/gix-sec/src/lib.rs
index 2f35d98cf..afba95950 100644
--- a/vendor/gix-sec/src/lib.rs
+++ b/vendor/gix-sec/src/lib.rs
@@ -13,7 +13,7 @@ use std::fmt::{Display, Formatter};
/// A way to specify how 'safe' we feel about a resource, typically about a git repository.
#[derive(Copy, Clone, Ord, PartialOrd, PartialEq, Eq, Debug, Hash)]
-#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Trust {
/// Caution is warranted when using the resource.
Reduced,
@@ -26,7 +26,7 @@ pub mod trust;
/// Allow, deny or forbid using a resource or performing an action.
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq, Ord, Eq, Hash)]
-#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Permission {
/// Fail outright when trying to load a resource or performing an action.
Forbid,
@@ -41,7 +41,8 @@ pub mod permission;
bitflags::bitflags! {
/// Whether something can be read or written.
- #[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+ #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
+ #[derive(Debug)]
pub struct ReadWrite: u8 {
/// The item can be read.
const READ = 1 << 0;