/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 1992, 19934* The Regents of the University of California. All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14* 3. Neither the name of the University nor the names of its contributors15* may be used to endorse or promote products derived from this software16* without specific prior written permission.17*18* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND19* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE20* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE21* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE22* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL23* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS24* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)25* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT26* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY27* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF28* SUCH DAMAGE.29*/3031#include <sys/types.h>32#include <sys/socket.h>3334void blkfree(char **);35char **copyblk(char **);36void cwd(char *);37void delete(char *);38void dologout(int);39void fatalerror(char *);40void ftpd_logwtmp(char *, char *, struct sockaddr *addr);41int ftpd_pclose(FILE *);42FILE *ftpd_popen(char *, char *);43int get_line(char *, int, FILE *);44void lreply(int, const char *, ...) __printflike(2, 3);45void makedir(char *);46void nack(char *);47void pass(char *);48void passive(void);49void long_passive(char *, int);50void perror_reply(int, char *);51void pwd(void);52void removedir(char *);53void renamecmd(char *, char *);54char *renamefrom(char *);55void reply(int, const char *, ...) __printflike(2, 3);56void retrieve(char *, char *);57void send_file_list(char *);58void statcmd(void);59void statfilecmd(char *);60void store(char *, char *, int);61void upper(char *);62void user(char *);63void yyerror(char *);64int yyparse(void);65int ls_main(int, char **);6667extern int assumeutf8;68extern char cbuf[];69extern union sockunion data_dest;70extern int epsvall;71extern int form;72extern int ftpdebug;73extern int guest;74extern union sockunion his_addr;75extern char *homedir;76extern int hostinfo;77extern char *hostname;78extern int maxtimeout;79extern int logged_in;80extern int logging;81extern int noepsv;82extern int noguestretr;83extern int noretr;84extern int paranoid;85extern struct passwd *pw;86extern int pdata;87extern char proctitle[];88extern int readonly;89extern off_t restart_point;90extern int timeout;91extern char tmpline[];92extern int type;93extern char *typenames[]; /* defined in <arpa/ftp.h> included from ftpd.c */94extern int usedefault;9596struct sockaddr_in;97struct sockaddr_in6;98union sockunion {99struct sockinet {100u_char si_len;101u_char si_family;102u_short si_port;103} su_si;104struct sockaddr_in su_sin;105struct sockaddr_in6 su_sin6;106};107#define su_len su_si.si_len108#define su_family su_si.si_family109#define su_port su_si.si_port110111112