diff options
-rw-r--r-- | lib.c | 5 | ||||
-rw-r--r-- | lib.h | 1 | ||||
-rw-r--r-- | lnode.c | 1 | ||||
-rw-r--r-- | lnode.h | 1 | ||||
-rw-r--r-- | node.c | 1 | ||||
-rw-r--r-- | pattern.c | 3 | ||||
-rw-r--r-- | stow-mutations.h | 1 | ||||
-rw-r--r-- | stow-priv.h | 4 | ||||
-rw-r--r-- | stow.c | 16 | ||||
-rw-r--r-- | ulfs.c | 1 | ||||
-rw-r--r-- | update.c | 1 |
11 files changed, 31 insertions, 4 deletions
@@ -23,6 +23,7 @@ #include <errno.h> #include <sys/mman.h> #include <stddef.h> +#include <stdlib.h> #include <string.h> #include "lib.h" @@ -150,8 +151,8 @@ make_filepath (char *path, char *filename) if (filepath == NULL) return NULL; - strncpy (filepath, path, length); - strncat (filepath, filename, strlen (filename)); + strcpy (filepath, path); + strcat (filepath, filename); return filepath; } @@ -23,6 +23,7 @@ #include <hurd.h> #include <dirent.h> #include <stddef.h> +#include <stdio.h> /* Returned directory entries are aligned to blocks this many bytes long. Must be a power of two. */ @@ -21,6 +21,7 @@ nodes. */ #include <pthread.h> +#include <assert.h> #include <error.h> #include <stdlib.h> #include <string.h> @@ -24,6 +24,7 @@ #include <pthread.h> #include <error.h> +#include <hurd.h> struct lnode { @@ -19,6 +19,7 @@ /* node management. */ +#include <assert.h> #include <hurd/netfs.h> #include <stdlib.h> #include <error.h> @@ -52,7 +52,10 @@ patternlist_add (struct patternlist *list, char *pattern) err = ENOMEM; if (err) + { + free (dup); return err; + } listentry->pattern = dup; diff --git a/stow-mutations.h b/stow-mutations.h index d36280d..95c1e7f 100644 --- a/stow-mutations.h +++ b/stow-mutations.h @@ -21,6 +21,7 @@ /* Only CPP macro definitions should go in this file. */ #define FS_NOTIFY_INTRAN stow_notify_t begin_using_notify_port (fs_notify_t) +#define FS_NOTIFY_INTRAN_PAYLOAD stow_notify_t begin_using_notify_port_payload #define FS_NOTIFY_DESTRUCTOR end_using_notify_port (stow_notify_t) #define FS_NOTIFY_IMPORTS import "stow-priv.h"; diff --git a/stow-priv.h b/stow-priv.h index 2212ac9..eeae7b3 100644 --- a/stow-priv.h +++ b/stow-priv.h @@ -36,6 +36,10 @@ typedef struct stow_notify *stow_notify_t; arranges for this to happen for the fs_notify interfaces. */ stow_notify_t begin_using_notify_port (fs_notify_t port); +/* Called by MiG to translate ports into stow_notify_t when using the + protected payload feature. mutations.h arranges for this to happen + for the fs_notify interfaces. */ +stow_notify_t begin_using_notify_port_payload (unsigned long payload); /* Called by MiG after server routines have been run; this balances begin_using_notify_port, and is arranged for the fs_notify @@ -21,7 +21,9 @@ /* Stow mode for unionfs. */ #include <argp.h> +#include <assert.h> #include <error.h> +#include <stdlib.h> #include "ulfs.h" #include "lib.h" @@ -167,6 +169,15 @@ begin_using_notify_port (fs_notify_t port) return ports_lookup_port (stow_port_bucket, port, stow_port_class); } +/* Called by MiG to translate ports into stow_notify_t when using the + protected payload feature. mutations.h arranges for this to happen + for the fs_notify interfaces. */ +stow_notify_t +begin_using_notify_port_payload (unsigned long payload) +{ + return ports_lookup_payload (stow_port_bucket, payload, stow_port_class); +} + /* Called by MiG after server routines have been run; this balances begin_using_notify_port, and is arranged for the fs_notify interfaces by mutations.h. */ @@ -271,14 +282,15 @@ stow_diradd (char *dir, int flags, struct patternlist *patternlist, { char *tmp; - tmp = (char *) malloc (dir_len + 1); + tmp = (char *) malloc (dir_len + 2); if (tmp == NULL) return ENOMEM; - strncpy (tmp, dir, dir_len); + strcpy (tmp, dir); tmp[dir_len] = '/'; + tmp[dir_len + 1] = 0; dir = tmp; } @@ -19,6 +19,7 @@ /* Underlying filesystem management. */ +#include <assert.h> #include <stdlib.h> #include <error.h> #include <string.h> @@ -21,6 +21,7 @@ root node update. */ #include <errno.h> +#include <stdio.h> #include <string.h> #include "ncache.h" |