Changeset dcf42bb2 in rtems for testsuites


Ignore:
Timestamp:
Oct 5, 2018, 12:39:46 PM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
51da629
Parents:
e761fb4
Message:

ftpd: Remove FTPD_SessionInfo_t::pass member

There is no need to keep the password throughout the session.

Update #3530.

Location:
testsuites/libtests/ftp01
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/ftp01/ftp01.scn

    re761fb4 rdcf42bb2  
    1 *** TEST FTP 1 ***
     1*** BEGIN OF TEST FTP 1 ***
     2*** TEST VERSION: 5.0.0.b38887ad22e2e28c15b4e248dac72f6eaff8cb13
     3*** TEST STATE: EXPECTED-PASS
     4*** TEST BUILD: RTEMS_NETWORKING
     5*** TEST TOOLS: 7.3.0 20180125 (RTEMS 5, RSB 9670d7541e0621915e521fe76e7bb33de8cee661, Newlib d13c84eb07e35984bf7a974cd786a6cdac29e6b9)
    26syslog: ftpd: FTP daemon started (2 sessions max)
    37220 RTEMS FTP server (Version 1.1-JWJ) ready.
     8login check (1): user "anonymous"
    49USER anonymous
    510230 User logged in.
    611TYPE I
    712200 Type set to I.
     13SIZE a.txt
     14550 Could not get file size.
    815PASV
    916227 Entering passive mode (127,0,0,1,4,1).
     
    1421221 Goodbye.
    1522220 RTEMS FTP server (Version 1.1-JWJ) ready.
     23login check (1): user "anonymous"
    1624USER anonymous
    1725230 User logged in.
     
    2533150 Opening BINARY mode data connection.
    2634220 RTEMS FTP server (Version 1.1-JWJ) ready.
    27 USER anonymous
     35login check (1): user "user"
     36USER user
     37331 User name okay, need password.
     38login check (2): user "user", pass "pass"
     39PASS pass
    2840230 User logged in.
    2941TYPE I
    3042200 Type set to I.
     43SIZE b.txt
     44550 Could not get file size.
    3145PASV
    3246227 Entering passive mode (127,0,0,1,4,7).
     
    4054221 Goodbye.
    4155220 RTEMS FTP server (Version 1.1-JWJ) ready.
    42 USER anonymous
     56login check (1): user "user"
     57USER user
     58331 User name okay, need password.
     59login check (2): user "user", pass "pass"
     60PASS pass
    4361230 User logged in.
    4462TYPE I
     
    5472221 Goodbye.
    5573220 RTEMS FTP server (Version 1.1-JWJ) ready.
     74login check (1): user "anonymous"
    5675USER anonymous
    5776230 User logged in.
     
    6382221 Goodbye.
    6483220 RTEMS FTP server (Version 1.1-JWJ) ready.
    65 USER anonymous
     84login check (1): user "user"
     85USER user
     86331 User name okay, need password.
     87login check (2): user "user", pass "pass"
     88PASS pass
    6689230 User logged in.
    6790TYPE I
     
    7194QUIT
    7295221 Goodbye.
     96
    7397*** END OF TEST FTP 1 ***
  • testsuites/libtests/ftp01/init.c

    re761fb4 rdcf42bb2  
    11/*
    2  * Copyright (c) 2011 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2011, 2018 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
    5  *  Obere Lagerstr. 30
     5 *  Dornierstr. 4
    66 *  82178 Puchheim
    77 *  Germany
     
    3939#define FTP_WORKER_TASK_EXTRA_STACK (FTP_WORKER_TASK_COUNT * FTPD_STACKSIZE)
    4040
     41static bool login_check(const char *user, const char *pass)
     42{
     43  rtems_test_assert(
     44    strcmp(user, "anonymous") == 0 || strcmp(user, "user") == 0
     45  );
     46
     47  if (pass != NULL) {
     48    rtems_test_assert(
     49      strcmp(pass, "anonymous") == 0 || strcmp(pass, "pass") == 0
     50    );
     51    printf("login check (2): user \"%s\", pass \"%s\"\n", user, pass);
     52    return true;
     53  } else {
     54    printf("login check (1): user \"%s\"\n", user);
     55    return strcmp(user, "anonymous") == 0;
     56  }
     57}
     58
    4159struct rtems_ftpd_configuration rtems_ftpd_configuration = {
    4260  .priority = 90,
     
    4765  .tasks_count = FTP_WORKER_TASK_COUNT,
    4866  .idle = 0,
     67  .login = login_check,
    4968  .access = 0
    5069};
     
    200219  int rv = 0;
    201220  const char file_a [] = "/FTP/127.0.0.1/a.txt";
    202   const char file_b [] = "/FTP/127.0.0.1/b.txt";
     221  const char file_b [] = "/FTP/user:pass@127.0.0.1/b.txt";
    203222
    204223  rv = rtems_bsdnet_initialize_network();
Note: See TracChangeset for help on using the changeset viewer.