hyperboria / bugs

Peer-to-peer IPv6 networking, secure and near-zero-conf.
154 stars 17 forks source link

cexec fails to check if unauthenticated #122

Open cyisfor opened 8 years ago

cyisfor commented 8 years ago
cjdns/tools/lib/cjdnsadmin/cjdnsadmin.js:149
                    Object.keys(ret.availableFunctions).forEach(function (funcName) {
                           ^

TypeError: Cannot convert undefined or null to object
    at Function.keys (native)
    at cjdns/tools/lib/cjdnsadmin/cjdnsadmin.js:149:28
    at Object.callback (cjdns/node_modules/nthen/lib/nthen.js:16:22)
    at Socket.<anonymous> (cjdns/tools/lib/cjdnsadmin/cjdnsadmin.js:191:17)
    at emitTwo (events.js:100:13)
    at Socket.emit (events.js:185:7)
    at UDP.onMessage (dgram.js:529:8)

If I have a bad ~/.cjdnsadmin file, I'd expect it to fail sooner, with an error message about not being authenticated, rather than die here with a backtrace.

bogdyak commented 6 years ago

Same issue. All functions from cjdns/tools/ gives this error

user@user-VirtualBox:~/cjdns/tools$ ./ping /home/user/cjdns/tools/lib/cjdnsadmin/cjdnsadmin.js:149 Object.keys(ret.availableFunctions).forEach(function (funcName) { ^

TypeError: Cannot convert undefined or null to object at Function.keys () at /home/user/cjdns/tools/lib/cjdnsadmin/cjdnsadmin.js:149:28 at Object.callback (/home/user/cjdns/node_modules/nthen/lib/nthen.js:16:22) at Socket. (/home/user/cjdns/tools/lib/cjdnsadmin/cjdnsadmin.js:191:17) at emitTwo (events.js:126:13) at Socket.emit (events.js:214:7) at UDP.onMessage [as onmessage] (dgram.js:658:8)