Use SO_PEERSEC to get client secontext

This commit is contained in:
topjohnwu
2021-10-19 23:46:38 -07:00
parent fe41df87bb
commit 8d0dc37ec0
7 changed files with 47 additions and 43 deletions

View File

@@ -63,9 +63,9 @@ void android_logging();
void post_fs_data(int client);
void late_start(int client);
void boot_complete(int client);
void denylist_handler(int client, ucred *cred);
void su_daemon_handler(int client, ucred *credential);
void zygisk_handler(int client, ucred *cred);
void denylist_handler(int client, const sock_cred *cred);
void su_daemon_handler(int client, const sock_cred *cred);
void zygisk_handler(int client, const sock_cred *cred);
std::vector<int> zygisk_module_fds(bool is_64_bit);
// Denylist

View File

@@ -3,10 +3,15 @@
#include <sys/un.h>
#include <sys/socket.h>
#include <string_view>
#include <string>
#include <vector>
struct sock_cred : public ucred {
std::string context;
};
socklen_t setup_sockaddr(sockaddr_un *sun, const char *name);
void get_client_cred(int fd, ucred *cred);
bool get_client_cred(int fd, sock_cred *cred);
std::vector<int> recv_fds(int sockfd);
int recv_fd(int sockfd);
int send_fds(int sockfd, const int *fds, int cnt);