summaryrefslogtreecommitdiff
path: root/trans
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-28 20:48:11 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-28 20:50:23 +0200
commit8208fdc63b56c5b1be837ad583534e5bbe4d6808 (patch)
treea2f54f1c15ce0d6b1547422255d49abacb664a8d /trans
parent12576ff7afd71799d9cc6fe6af065932540ff0ea (diff)
remap: Refuse non-absolute paths
* trans/remap.c (parse_opt): Error out if some path is not absolute.
Diffstat (limited to 'trans')
-rw-r--r--trans/remap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/trans/remap.c b/trans/remap.c
index 5ee01891..b92826f0 100644
--- a/trans/remap.c
+++ b/trans/remap.c
@@ -70,6 +70,7 @@ trivfs_S_dir_lookup (struct trivfs_protid *diruser,
return EOPNOTSUPP;
for (remap = remaps; remap; remap = remap->next)
+ /* FIXME: should match just prefix of filename too */
if (!strcmp (remap->from, filename))
{
#ifdef DEBUG
@@ -96,6 +97,8 @@ parse_opt (int key, char *arg, struct argp_state *state)
switch (key)
{
case ARGP_KEY_ARG:
+ if (arg[0] != '/')
+ error(1, 0, "remap only works with absolute paths\n");
/* Skip heading slashes */
while (arg[0] == '/')