Skip to content

Should we really consider table names beginning with path separators? #46

Description

@eyalroz

In bm_utils.c we have, in the tbl_open() function, the code:

    if (*tdefs[tbl].name == PATH_SEP)
        strcpy(fullpath, tdefs[tbl].name);

but how can a table name begin with a path separator? Shouldn't we disable this? e.g. apply something like the following: ?

diff --git a/src/bm_utils.c b/src/bm_utils.c
index a7e08c8..4cd57ca 100644
--- a/src/bm_utils.c
+++ b/src/bm_utils.c
@@ -367,9 +367,12 @@ tbl_open(int tbl, char *mode)
     int      retcode;
 
 
-    if (*tdefs[tbl].name == PATH_SEP)
+/* This is not possible - no table names begin with a path separator
+
+     if (*tdefs[tbl].name == PATH_SEP)
         strcpy(fullpath, tdefs[tbl].name);
     else
+ */
         sprintf(fullpath, "%s%c%s",
             env_config(PATH_TAG, PATH_DFLT), PATH_SEP, tdefs[tbl].name);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions