You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Petro Karashchenko <pe...@gmail.com> on 2022/03/25 16:52:11 UTC

What is the purpose of FTPD_ACCOUNTFLAG_SYSTEM?

Hi team,

Recently I've been working with FTP server example and explored the code
for FTPD as well. I have a question related to account flags. In
"apps/examples/ftpd/ftpd_main.c" I see the line:
  { FTPD_ACCOUNTFLAG_SYSTEM, "root",      "abc123", NULL },
and message:
  (account->flags & FTPD_ACCOUNTFLAG_SYSTEM) ? "Root" : "User",

On the other hand in "apps/netutils/ftpd/ftpd.c" there is next block of
code:
  if ((account->flags & FTPD_ACCOUNTFLAG_ADMIN) != 0)
    {
      /* admin user */

      session->home = strdup("/");
      session->work = strdup(!home ? "/" : home);
    }
  else
    {
      /* normal user */

      session->home = strdup(!home ? "/" : home);
      session->work = strdup("/");
    }

So it seems like FTPD_ACCOUNTFLAG_SYSTEM is ignored by FTPD. My question is
what is the purpose of FTPD_ACCOUNTFLAG_SYSTEM and how is it different from
FTPD_ACCOUNTFLAG_ADMIN?

Best regards,
Petro