Show context in polkit prompt
This commit is contained in:
@@ -14,9 +14,16 @@ function fingerprintFirstFromPamConfig(raw) {
|
||||
return false
|
||||
}
|
||||
|
||||
function authorizationLabel(message) {
|
||||
var text = String(message || "")
|
||||
var match = text.match(/^Authentication is (?:needed|required) to run [`']([^`']+)[`'] as /i)
|
||||
return match ? "Authorize running '" + match[1] + "'" : text
|
||||
}
|
||||
|
||||
if (typeof module !== "undefined") {
|
||||
module.exports = {
|
||||
promptLooksFingerprint: promptLooksFingerprint,
|
||||
fingerprintFirstFromPamConfig: fingerprintFirstFromPamConfig
|
||||
fingerprintFirstFromPamConfig: fingerprintFirstFromPamConfig,
|
||||
authorizationLabel: authorizationLabel
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user