Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 104218
Collapse All | Expand All

(-)atftp-0.7.orig/tftp.c (-1 / +12 lines)
Lines 525-530 Link Here
525
               fprintf(stderr, "  multicast: enabled\n");
525
               fprintf(stderr, "  multicast: enabled\n");
526
          else
526
          else
527
               fprintf(stderr, "  multicast: disabled\n");
527
               fprintf(stderr, "  multicast: disabled\n");
528
          if (data.tftp_options[OPT_PASSWORD].specified)
529
               fprintf(stderr, "   password: enabled\n");
530
          else
531
               fprintf(stderr, "   password: disabled\n");
528
          return ERR;
532
          return ERR;
529
     }
533
     }
530
     /* if disabling an option */
534
     /* if disabling an option */
Lines 971-976 Link Here
971
          { "put", 0, NULL, 'p'},
975
          { "put", 0, NULL, 'p'},
972
          { "local-file", 1, NULL, 'l'},
976
          { "local-file", 1, NULL, 'l'},
973
          { "remote-file", 1, NULL, 'r'},
977
          { "remote-file", 1, NULL, 'r'},
978
          { "password", 1, NULL, 'P'},
974
          { "tftp-timeout", 1, NULL, 'T'},
979
          { "tftp-timeout", 1, NULL, 'T'},
975
          { "mode", 1, NULL, 'M'},
980
          { "mode", 1, NULL, 'M'},
976
          { "option", 1, NULL, 'O'},
981
          { "option", 1, NULL, 'O'},
Lines 993-999 Link Here
993
     };
998
     };
994
999
995
     /* Support old argument until 0.8 */
1000
     /* Support old argument until 0.8 */
996
     while ((c = getopt_long(argc, argv, /*"gpl:r:Vh"*/ "gpl:r:Vht:b:sm",
1001
     while ((c = getopt_long(argc, argv, /*"gpl:r:Vh"*/ "gpl:r:Vht:b:smP:",
997
                             options, &option_index)) != EOF)
1002
                             options, &option_index)) != EOF)
998
     {
1003
     {
999
          switch (c)
1004
          switch (c)
Lines 1028-1033 Link Here
1028
               else
1033
               else
1029
                    action = PUT;
1034
                    action = PUT;
1030
               break;
1035
               break;
1036
          case 'P':
1037
               snprintf(string, sizeof(string), "option password %s", optarg);
1038
               make_arg(string, &ac, &av);
1039
               process_cmd(ac, av);
1040
               break;
1031
          case 'l':
1041
          case 'l':
1032
               interactive = 0;
1042
               interactive = 0;
1033
               Strncpy(local_file, optarg, MAXLEN);
1043
               Strncpy(local_file, optarg, MAXLEN);
Lines 1169-1174 Link Here
1169
             "  -p, --put                : put file\n"
1179
             "  -p, --put                : put file\n"
1170
             "  -l, --local-file <file>  : local file name\n"
1180
             "  -l, --local-file <file>  : local file name\n"
1171
             "  -r, --remote-file <file> : remote file name\n"
1181
             "  -r, --remote-file <file> : remote file name\n"
1182
             "  -P, --password <password>: specify password (Linksys ext.)\n"
1172
             "  --tftp-timeout <value>   : delay before retransmission, client side\n"
1183
             "  --tftp-timeout <value>   : delay before retransmission, client side\n"
1173
#if 0
1184
#if 0
1174
             "  t, --timeout <value>      : delay before retransmission, "
1185
             "  t, --timeout <value>      : delay before retransmission, "
(-)atftp-0.7.orig/tftp_def.c (+1 lines)
Lines 37-42 Link Here
37
     { "timeout", "5", 0, 1 },  /* 2348, 2349, 2090.  */
37
     { "timeout", "5", 0, 1 },  /* 2348, 2349, 2090.  */
38
     { "blksize", "512", 0, 1 }, /* This is the default option */
38
     { "blksize", "512", 0, 1 }, /* This is the default option */
39
     { "multicast", "", 0, 1 }, /* structure */
39
     { "multicast", "", 0, 1 }, /* structure */
40
     { "password", "", 0, 1},   /* password */
40
     { "", "", 0, 0}
41
     { "", "", 0, 0}
41
};
42
};
42
43
(-)atftp-0.7.orig/tftp_def.h (+1 lines)
Lines 40-45 Link Here
40
#define OPT_TIMEOUT   3
40
#define OPT_TIMEOUT   3
41
#define OPT_BLKSIZE   4
41
#define OPT_BLKSIZE   4
42
#define OPT_MULTICAST 5
42
#define OPT_MULTICAST 5
43
#define OPT_PASSWORD  6
43
#define OPT_NUMBER    7
44
#define OPT_NUMBER    7
44
45
45
#define OPT_SIZE     12
46
#define OPT_SIZE     12
(-)atftp-0.7.orig/tftp_io.c (-4 / +7 lines)
Lines 70-79 Link Here
70
               break;
70
               break;
71
          if (tftp_options[i].enabled && tftp_options[i].specified)
71
          if (tftp_options[i].enabled && tftp_options[i].specified)
72
          {
72
          {
73
               Strncpy(data_buffer + buf_index, tftp_options[i].option,
73
               if (i != OPT_PASSWORD)
74
                       data_buffer_size - buf_index);
74
               {
75
               buf_index += strlen(tftp_options[i].option);
75
                   Strncpy(data_buffer + buf_index, tftp_options[i].option,
76
               buf_index++;    
76
                           data_buffer_size - buf_index);
77
                   buf_index += strlen(tftp_options[i].option);
78
                   buf_index++;    
79
               }
77
               Strncpy(data_buffer + buf_index, tftp_options[i].value,
80
               Strncpy(data_buffer + buf_index, tftp_options[i].value,
78
                       data_buffer_size - buf_index);
81
                       data_buffer_size - buf_index);
79
               buf_index += strlen(tftp_options[i].value);
82
               buf_index += strlen(tftp_options[i].value);

Return to bug 104218