commit abd858071695c0c0ba89c078bd7b83ea9d98a1cb
parent c6ed484905c1deb5a9aaca164b7b21c14dbdedd9
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Sat, 29 May 2021 02:08:22 -0700
Allow any string into the queue
While anything is allowed, it should be limited to absolute paths
or urls. This will be enforced later.
Diffstat:
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/apc.c b/apc.c
@@ -93,11 +93,10 @@ apc_recv(struct apcon *c, char **err, int (*item)(char *))
len += tmp;
while ((end = memchr(buf, '\n', len))) {
*end = 0;
- if (*buf != '/') {
- if (dupstatus(err, buf) || error)
- return 1;
- return 0;
- }
+ if (dupstatus(err, buf) == 0)
+ return error;
+ else if (errno != EBADMSG)
+ return 1;
if (!error)
error = item(buf);
len -= end - buf + 1;
diff --git a/queue.c b/queue.c
@@ -27,16 +27,11 @@ item_new(char *path)
{
struct item *item;
- if (*path != '/') {
- errno = EINVAL;
- return NULL;
- }
-
item = calloc(1, sizeof(*item));
if (item == NULL)
return NULL;
- item->path = realpath(path, NULL);
+ item->path = strdup(path);
if (item->path == NULL) {
free(item);
return NULL;