diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-04-21 15:30:07 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-04-21 15:31:16 +0530 |
commit | 6f0fb6644fbb9fe2c05f1719e619ce4d0073728d (patch) | |
tree | 4a364053068b79c78a50e21989771a5e9ddf5902 /include/npassd | |
parent | c58a8abf4403fcdf7c453c75d7fce41cdd14bcdf (diff) |
npassd/session: free session when owner service disconnects from the bus
Diffstat (limited to 'include/npassd')
-rw-r--r-- | include/npassd/session.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/npassd/session.h b/include/npassd/session.h index 6763c6a..a3aa705 100644 --- a/include/npassd/session.h +++ b/include/npassd/session.h @@ -4,11 +4,13 @@ #include "npassd/common.h" #define SESSION_IFACE "org.freedesktop.Secret.Session" +#define MAX_OWNER_LEN 64 /* reusable slots */ struct session { bool isactive; sd_bus_slot *slot; + char owner[MAX_OWNER_LEN]; /* +32 for snprintf("/session/%d") */ char path[sizeof(DBUS_OBJECT_PATH) + 32]; }; @@ -16,4 +18,5 @@ struct session { void session_init(struct session *s, size_t n); int session_slot_available(struct session *s, size_t n); int session_free(struct session *s); -int session_new(sd_bus *bus, struct session *s, unsigned slot_no); +int session_new(sd_bus *bus, struct session *session, unsigned session_no, + const char *owner); |