X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Fui.c;h=ea10427f6d9e4d723a563a7a462c9fb0a90e5c64;hb=d9f89ef5daa6375fc4ff257826fa39562fbe3ac3;hp=96c1eb7ebc2c475376888cf3672e7f2fbf7856d0;hpb=a3a4a3a7ae1030512acfd849bb184b9d2264c24d;p=doldaconnect.git diff --git a/daemon/ui.c b/daemon/ui.c index 96c1eb7..ea10427 100644 --- a/daemon/ui.c +++ b/daemon/ui.c @@ -641,6 +641,11 @@ static void cmd_disconnect(struct socket *sk, struct uidata *data, int argc, wch sq(sk, 0, L"510", L"No such node", NULL); return; } + if(wpfind(fn->args, L"locked") && !((data->userinfo->perms & PERM_ADMIN) || !wcscmp(data->userinfo->name, fn->owner))) + { + sq(sk, 0, L"502", L"This node is locked and you are neither administrator nor its owner", NULL); + return; + } killfnetnode(fn); unlinkfnetnode(fn); } @@ -686,7 +691,7 @@ static void cmd_lspeers(struct socket *sk, struct uidata *data, int argc, wchar_ } else { for(peer = fn->peers; peer != NULL; peer = peer->next) { - sq(sk, 2 | ((peer->next != NULL)?1:0), L"200", peer->id, peer->nick, NULL); + sq(sk, 2 | ((peer->next != NULL)?1:0), L"200", L"%%ls", peer->id, L"%%ls", peer->nick, NULL); for(i = 0; i < peer->dinum; i++) { if(peer->peerdi[i].datum->datatype == FNPD_INT) @@ -699,7 +704,7 @@ static void cmd_lspeers(struct socket *sk, struct uidata *data, int argc, wchar_ sq(sk, 2, peer->peerdi[i].datum->id, buf, NULL); } if((peer->peerdi[i].datum->datatype == FNPD_STR) && (peer->peerdi[i].data.str != NULL)) - sq(sk, 2, peer->peerdi[i].datum->id, peer->peerdi[i].data.str, NULL); + sq(sk, 2, peer->peerdi[i].datum->id, L"%%ls", peer->peerdi[i].data.str, NULL); } sq(sk, 0, NULL); } @@ -1233,7 +1238,7 @@ static void cmd_transstatus(struct socket *sk, struct uidata *data, int argc, wc havepriv(PERM_TRANS); buf1 = swprintf2(L"%lli", bytesdownload); buf2 = swprintf2(L"%lli", bytesupload); - sq(sk, 0, L"200", L"%%ls", buf1, L"%%ls", buf2, NULL); + sq(sk, 0, L"200", L"down", L"%%ls", buf1, L"up", L"%%ls", buf2, NULL); free(buf1); free(buf2); } @@ -2255,9 +2260,18 @@ static void terminate(void) static struct configvar myvars[] = { + /** If true, UI connections will only be accepted from localhost + * addresses (127.0.0.1, ::1 or ::ffff:127.0.0.1). Unless you are + * completely sure that you know what you are doing, never turn + * this off when auth.authless is on. */ {CONF_VAR_BOOL, "onlylocal", {.num = 1}}, + /** The port number on which to accept UI client connections. */ {CONF_VAR_INT, "port", {.num = 1500}}, + /** The TOS value to use for UI connections (see the TOS VALUES + * section). */ {CONF_VAR_INT, "uitos", {.num = SOCK_TOS_MINDELAY}}, + /** The name of the filtercmd script (see the FILES section for + * lookup information). */ {CONF_VAR_STRING, "filtercmd", {.str = L"dc-filtercmd"}}, {CONF_VAR_END} };