OpenSSHUtils ProfilePath parsing issues (#192)
1. ignore the historical (.bak) profile entries from the registry 2. do not match against different profiles that share the beginning of their path
This commit is contained in:
parent
7f64fc729a
commit
e8a303673e
|
@ -168,7 +168,9 @@ function Repair-AuthorizedKeyPermission
|
||||||
$userProfilePath = $properties.ProfileImagePath
|
$userProfilePath = $properties.ProfileImagePath
|
||||||
}
|
}
|
||||||
$userProfilePath = $userProfilePath.Replace("\", "\\")
|
$userProfilePath = $userProfilePath.Replace("\", "\\")
|
||||||
$fullPath -match "^$userProfilePath[\\|\W|\w]+authorized_keys$"
|
if ( $properties.PSChildName -notmatch '\.bak$') {
|
||||||
|
$fullPath -match "^$userProfilePath\\[\\|\W|\w]+authorized_keys$"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if($profileItem)
|
if($profileItem)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue