platform_system_core/gatekeeperd
Eric Biggers b4738b9e5d Avoid odd behavior when clearing nonexistent SID
It's expected that clearSecureUserId is sometimes called with a userId
that doesn't currently have a Gatekeeper enrollment.  For example, this
happens whenever a user with no LSKF is removed.  gatekeeperd currently
has two odd behaviors when it's asked to do this.  First, it logs the
following message at ERROR level, which is not appropriate:

    E gatekeeperd: clear_sid: could not remove file [No such file or directory], attempting 0 write

Second, it writes 0 to the file /data/misc/gatekeeper/$userId.  This
makes this file exist even after the user has been removed, which
doesn't cause a real problem but is unexpected.

Fix both of these issues by making clear_sid() check for ENOENT.

Bug: 188702845
Bug: 268526331
Change-Id: Ib1b110f2502267004f5c945c28c98ae926b2a794
2023-03-03 23:18:15 +00:00
..
binder/android/service/gatekeeper Add @SensitiveData to GateKeeperService 2020-11-04 13:51:04 -08:00
include/gatekeeper Gatekeeperd maintenance 2019-06-23 11:09:30 -07:00
Android.bp hidl2aidl: conversion of gatekeeper hidl to aidl 2022-09-19 16:39:27 +00:00
gatekeeperd.cpp Avoid odd behavior when clearing nonexistent SID 2023-03-03 23:18:15 +00:00
gatekeeperd.rc Replace writepid with task_profiles command for cgroup migration 2021-06-24 17:24:20 +00:00
GateKeeperResponse.cpp Gatekeeperd maintenance 2019-06-23 11:09:30 -07:00
OWNERS Add OWNERS file to gatekeeperd 2018-02-14 16:04:36 -07:00