summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib.c5
-rw-r--r--lib.h1
-rw-r--r--lnode.c1
-rw-r--r--lnode.h1
-rw-r--r--node.c1
-rw-r--r--pattern.c3
-rw-r--r--stow-mutations.h1
-rw-r--r--stow-priv.h4
-rw-r--r--stow.c16
-rw-r--r--ulfs.c1
-rw-r--r--update.c1
11 files changed, 31 insertions, 4 deletions
diff --git a/lib.c b/lib.c
index e7f3aa9..717979b 100644
--- a/lib.c
+++ b/lib.c
@@ -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;
}
diff --git a/lib.h b/lib.h
index 095adaa..da01f4a 100644
--- a/lib.h
+++ b/lib.h
@@ -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. */
diff --git a/lnode.c b/lnode.c
index 427bc3c..4287489 100644
--- a/lnode.c
+++ b/lnode.c
@@ -21,6 +21,7 @@
nodes. */
#include <pthread.h>
+#include <assert.h>
#include <error.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lnode.h b/lnode.h
index f5a50f7..0df3047 100644
--- a/lnode.h
+++ b/lnode.h
@@ -24,6 +24,7 @@
#include <pthread.h>
#include <error.h>
+#include <hurd.h>
struct lnode
{
diff --git a/node.c b/node.c
index 19228f6..78b5eb8 100644
--- a/node.c
+++ b/node.c
@@ -19,6 +19,7 @@
/* node management. */
+#include <assert.h>
#include <hurd/netfs.h>
#include <stdlib.h>
#include <error.h>
diff --git a/pattern.c b/pattern.c
index 409ed23..fd38cf5 100644
--- a/pattern.c
+++ b/pattern.c
@@ -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
diff --git a/stow.c b/stow.c
index cf6366e..adfcf53 100644
--- a/stow.c
+++ b/stow.c
@@ -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;
}
diff --git a/ulfs.c b/ulfs.c
index 50affa6..773ebc4 100644
--- a/ulfs.c
+++ b/ulfs.c
@@ -19,6 +19,7 @@
/* Underlying filesystem management. */
+#include <assert.h>
#include <stdlib.h>
#include <error.h>
#include <string.h>
diff --git a/update.c b/update.c
index 113b25c..f416d5e 100644
--- a/update.c
+++ b/update.c
@@ -21,6 +21,7 @@
root node update. */
#include <errno.h>
+#include <stdio.h>
#include <string.h>
#include "ncache.h"