97
97
.trans_func = sig_param_node_callback}}
100
/* returns: 1 for str=="yes" or "y", 0 for "no" or "n", -1 elsewhere */
101
static int is_yes(const char *str)
104
if (!strcmp(str,"y") || !strcmp(str,"yes"))
106
if (!strcmp(str,"no") || !strcmp(str,"n"))
114
/* returns: 0 for success
115
* WRONG_VALUE if node->val is none of 'yes','y','no','n'
118
static int stack_push_if_yes(struct param_node *node, struct val_node **head,
123
if (((rc=is_yes(node->val)) == 1) || (node->flags & PARAMETER_SET)) {
124
rc = stack_push(head, opt_name);
100
132
static int get_hmac(struct ecryptfs_ctx *ctx, struct param_node *node,
101
133
struct val_node **head, void **foo)
103
if (node->val && (*(node->val) == 'y')) {
104
stack_push(head, "ecryptfs_hmac");
105
} else if (node->flags & PARAMETER_SET) {
106
stack_push(head, "ecryptfs_hmac");
135
return stack_push_if_yes(node, head, "ecryptfs_hmac");
113
138
static int get_passthrough(struct ecryptfs_ctx *ctx, struct param_node *node,
114
139
struct val_node **head, void **foo)
116
if (node->val && (*(node->val) == 'y')) {
117
stack_push(head, "ecryptfs_passthrough");
118
} else if (node->flags & PARAMETER_SET) {
119
stack_push(head, "ecryptfs_passthrough");
141
return stack_push_if_yes(node, head, "ecryptfs_passthrough");
126
144
static int get_xattr(struct ecryptfs_ctx *ctx, struct param_node *node,
127
145
struct val_node **head, void **foo)
129
if (node->val && (*(node->val) == 'y')) {
130
stack_push(head, "ecryptfs_xattr_metadata");
131
} else if (node->flags & PARAMETER_SET) {
132
stack_push(head, "ecryptfs_xattr_metadata");
147
return stack_push_if_yes(node, head, "ecryptfs_xattr_metadata");
139
150
static int get_encrypted_passthrough(struct ecryptfs_ctx *ctx,
140
151
struct param_node *node,
141
152
struct val_node **head, void **foo)
143
if (node->val && (*(node->val) == 'y')) {
144
stack_push(head, "ecryptfs_encrypted_view");
145
} else if (node->flags & PARAMETER_SET) {
146
stack_push(head, "ecryptfs_encrypted_view");
154
return stack_push_if_yes(node, head, "ecryptfs_encrypted_view");
153
157
static struct param_node end_param_node = {