Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eyalroz opened this issue Feb 10, 2019 · 0 comments
Open
Labels

Comments

@eyalroz
Copy link
Owner

eyalroz commented Feb 10, 2019

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant