Skip to content

Commit

Permalink
tftp: remove definitions that can be included from system header
Browse files Browse the repository at this point in the history
This will cause the following warning when _FORTIFY_SOURCE= is in use.  The
warning is explained in glibc.  In short that is fine.

/usr/include/bits/string_fortified.h:90:10: warning: ‘__builtin___strcpy_chk’
writing 1 or more bytes into a region of size 0 overflows the destination
[-Wstringop-overflow=]
   return __builtin___strcpy_chk (__dest, __src, __bos (__dest));

Reference: http://www.sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=abb66a672f5575a328d05c0790403af673d0f76c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
  • Loading branch information
kerolasa committed Oct 3, 2018
1 parent 43afde2 commit 86323ed
Showing 1 changed file with 1 addition and 46 deletions.
47 changes: 1 addition & 46 deletions tftp.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,49 +29,7 @@

#define PKTSIZE SEGSIZE+4

#ifndef _ARPA_TFTP_H
#define _ARPA_TFTP_H
/*
* Trivial File Transfer Protocol (IEN-133)
*/
#define SEGSIZE 512 /* data segment size */

/*
* Packet types.
*/
#define RRQ 01 /* read request */
#define WRQ 02 /* write request */
#define DATA 03 /* data packet */
#define ACK 04 /* acknowledgement */
#define ERROR 05 /* error code */

struct tftphdr {
short th_opcode; /* packet type */
union {
short tu_block; /* block # */
short tu_code; /* error code */
char tu_stuff[1]; /* request packet stuff */
} th_u;
char th_data[1]; /* data or error string */
};

#define th_block th_u.tu_block
#define th_code th_u.tu_code
#define th_stuff th_u.tu_stuff
#define th_msg th_data

/*
* Error codes.
*/
#define EUNDEF 0 /* not defined */
#define ENOTFOUND 1 /* file not found */
#define EACCESS 2 /* access violation */
#define ENOSPACE 3 /* disk full or allocation exceeded */
#define EBADOP 4 /* illegal TFTP operation */
#define EBADID 5 /* unknown transfer ID */
#define EEXISTS 6 /* file already exists */
#define ENOUSER 7 /* no such user */

#include <arpa/tftp.h>

extern int readit(FILE * file, struct tftphdr **dpp, int convert);
extern void read_ahead(FILE *file, int convert);
Expand All @@ -80,6 +38,3 @@ extern int write_behind(FILE *file, int convert);
extern int synchnet(int f);
extern struct tftphdr *w_init(void);
extern struct tftphdr *r_init(void);


#endif /* _ARPA_TFTP_H */

0 comments on commit 86323ed

Please sign in to comment.