trouble with empty symlink
1) crash of odbedit "jsvalues" (same crash in the mjson-rpc call to "db_get_values")
do this: a) go to the odb editor web page b) go to /Alias c) click on "create", select "create symlink", set name to "test_link" d) click on "create". this will create a symlink that points to nothing e) go to a shell, start odbedit, type "jsvalues", you will have a crash:
[local:javascript1:S]/>jsvalues
Assertion failed: (remain >= 0), function json_write, file src/odb.c, line 8449.
Abort trap: 6
stack trace shows infinite recursion inside the odb json encoder.
2) odbedit "ls -l" crash:
`[local:javascript1:S]/>cd Alias/ [local:javascript1:S]/Alias>ls -l Key name Type #Val Size Last Opn Mode Value
test_alias STRING 1 16 >99d 0 RWD test_alias.html Assertion failed: (key.total_size > 0), function print_key, file src/odbedit.cxx, line 326. Abort trap: 6`
3) mhttpd crash - the status page would not load, mhttpd crashed. Actually this is the same crash as (1) inside the mjsonrpc call to "db_get_values".
K.O.
Comments (4)
-
-
reporter mhttpd odb editor "create" into "create symlink" was using the wrong odb function - db_create_key(TID_LINK) instead of db_create_link() - which bypassed all the checks on link validity.
I now removed "create symlink" from "create" and added the "link" dialog which calls json-rpc "db_link" which calls db_create_link() which does all the validation.
K.O.
-
reporter crash (2) fixed in odbedit, crash (1) and (3) fixed in the json encoder. K.O.
-
reporter - changed status to resolved
fixed as of commit ef14a7a. K.O.
- Log in to comment
Before we crate a link, we should check that the target exists. That's what odbedit does for the "ln" command.