- Lock the session from the power button or `chandra-ctl lock` - Unlock with a face or the password; the password always works - Add compositor lock module with tests, and a polkit unlock policy (org.chandra.unlock) - Document the lock flow in docs/lock.md and link it from the README - Add generated interface bindings for the compositor and widget components
This commit is contained in:
1 parent
7501fc3ad9
commit
c790f96e58
131 files changed
+4693
-274
No files matched your search
@@ -172,21 +172,26 @@ pub fn string_dict(v : @network.DValue) -> Map[String, String] {
|
||||
out
|
||||
}
|
||||
|
||||
///| Our uid, from /proc/self/status ("Uid:\treal\teffective..."); -1 when unknown.
|
||||
pub fn own_uid() -> Int {
|
||||
let text = @utf8.decode_lossy(@sys.read_proc_bytes("/proc/self/status"))
|
||||
///| Parse real UID from `/proc/<pid>/status` ("Uid:\treal\teffective..."); -1 when unknown.
|
||||
pub fn uid_from_status(text : String) -> Int {
|
||||
for line in text.split("\n") {
|
||||
let l = line.to_string()
|
||||
if l.has_prefix("Uid:") {
|
||||
let parts = l[4:].to_string().trim(chars=" \t").to_string().split("\t").to_array()
|
||||
let rest = l[4:].to_string().replace_all(old="\t", new=" ")
|
||||
let parts = rest.split(" ").map(v => v.to_string()).filter(v => v != "").to_array()
|
||||
if parts.length() > 0 {
|
||||
return parse_uint(parts[0].to_string().trim(chars=" ").to_string()).unwrap_or(-1)
|
||||
return parse_uint(parts[0]).unwrap_or(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
-1
|
||||
}
|
||||
|
||||
///| Our uid, from /proc/self/status ("Uid:\treal\teffective..."); -1 when unknown.
|
||||
pub fn own_uid() -> Int {
|
||||
uid_from_status(@utf8.decode_lossy(@sys.read_proc_bytes("/proc/self/status")))
|
||||
}
|
||||
|
||||
///| The request BeginAuthentication's arguments describe (s s s a{ss} s a(sa{sv})); None when
|
||||
/// they don't match. Users come from /etc/passwd and /etc/group.
|
||||
pub fn AuthRequest::from_args(args : Array[@network.DValue]) -> AuthRequest? {
|
||||
|
||||
Reference in new issue
Block a user