1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-06 19:40:08 +02:00

🐛 Own /bin and /sbin folders specifically

This commit is contained in:
2023-05-24 19:29:38 +02:00
parent 8240b676c1
commit 6fc613ac4c

View File

@ -61,16 +61,25 @@ class BrewPermissionFixer {
? "php"
: "php@\(formula)"
if isOwnedByRoot(path: "\(Paths.optPath)/\(realFormula)/bin")
|| isOwnedByRoot(path: "\(Paths.optPath)/\(realFormula)/sbin") {
let borked = DueOwnershipFormula(
formula: realFormula,
path: "\(Paths.optPath)/\(realFormula)"
)
let binFolderOwned = isOwnedByRoot(path: "\(Paths.optPath)/\(realFormula)/bin")
let sbinFolderOwned = isOwnedByRoot(path: "\(Paths.optPath)/\(realFormula)/sbin")
if binFolderOwned || sbinFolderOwned {
Log.warn("\(formula) is owned by root")
broken.append(borked)
if binFolderOwned {
broken.append(DueOwnershipFormula(
formula: realFormula,
path: "\(Paths.optPath)/\(realFormula)/bin"
))
}
if sbinFolderOwned {
broken.append(DueOwnershipFormula(
formula: realFormula,
path: "\(Paths.optPath)/\(realFormula)/sbin"
))
}
}
}
}