yellowman / nsh

OpenBSD networking configuration shell

Home Page:http://www.nmedia.net/nsh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error enabling tftp server

sstolz84 opened this issue · comments

when i try to enable tftpd in nsh i get the following message:

host.example.org(p)/tftp enable
usage: tftpd [-46cdv] [-l address] [-p port] [-r socket] directory
host.example.org(p)/

nsh calls "/usr/sbin/tftpd -l 127.0.0.1" hard coded without an directory for the tftp server root.

Original ctl.c

/* tftpd */
struct ctl ctl_tftp[] = {
{ "enable", "enable service",
{ TFTPD, "-l", "127.0.0.1", NULL }, NULL, DB_X_ENABLE, T_EXEC },
{ "disable", "disable service",
{ PKILL, table, "tftpd", NULL }, NULL, DB_X_DISABLE, T_EXEC },
{ 0, 0, { 0 }, 0, 0, 0 }
};

i modified it to the following to work for me:

/* tftpd */
struct ctl ctl_tftp[] = {
{ "enable", "enable service",
{ TFTPD, "-l", "127.0.0.1", "/tftp-root", NULL }, NULL, DB_X_ENABLE, T_EXEC },
{ "disable", "disable service",
{ PKILL, table, "tftpd", NULL }, NULL, DB_X_DISABLE, T_EXEC },
{ 0, 0, { 0 }, 0, 0, 0 }
};

oh and thank you :)