Add create_secure_client and create_client_socket

This commit is contained in:
Drew DeVault 2018-09-08 10:19:33 -04:00
parent 8932d17275
commit 3fa2d545de
4 changed files with 56 additions and 10 deletions

View file

@ -273,7 +273,7 @@ enum secure_feature {
};
struct feature_policy {
char *program;
char *command;
uint64_t permit_features;
uint64_t reject_features;
};

View file

@ -6,13 +6,15 @@
/** Returns a mask of all features this client is permitted to use */
uint64_t get_feature_policy_mask(struct wl_client *client);
/** Returns the policy for a program, or creates one if it doesn't exist. */
/** Returns the policy for a command, or creates one if it doesn't exist. */
struct feature_policy *get_feature_policy(
struct sway_config *config, const char *program);
struct sway_config *config, const char *command);
/** Creates a wayland client with a feature policy applied. */
/** Creates a wayland client with the appropriate feature policy. */
struct wl_client *create_secure_client(struct wl_display *display,
int fd, const struct feature_policy *policy);
int fd, const char *command);
bool create_client_socket(int sv[2]);
struct feature_name {
char *name;