-/* $OpenBSD: extern.h,v 1.22 2021/05/20 15:21:03 jan Exp $ */
+/* $OpenBSD: extern.h,v 1.23 2021/05/23 17:01:21 jan Exp $ */
/* $NetBSD: extern.h,v 1.2 1995/04/11 02:44:49 cgd Exp $ */
/*
void blkfree(char **);
char **copyblk(char **);
void cwd(char *);
-void delete(char *);
+void delete(const char *);
void dologout(int);
-void fatal(char *);
+void fatal(const char *);
int ftpd_pclose(FILE *, pid_t);
FILE *ftpd_ls(const char *, pid_t *);
int get_line(char *, int);
-void ftpdlogwtmp(char *, char *, char *);
+void ftpdlogwtmp(const char *, const char *, const char *);
void lreply(int, const char *, ...);
-void makedir(char *);
-void nack(char *);
+void makedir(const char *);
+void nack(const char *);
enum auth_ret
pass(char *);
void passive(void);
int epsvproto2af(int);
int af2epsvproto(int);
-void long_passive(char *, int);
+void long_passive(const char *, int);
int extended_port(const char *);
void epsv_protounsupp(const char *);
-void perror_reply(int, char *);
+void perror_reply(int, const char *);
void pwd(void);
-void removedir(char *);
-void renamecmd(char *, char *);
+void removedir(const char *);
+void renamecmd(const char *, const char *);
char *renamefrom(char *);
void reply(int, const char *, ...);
void reply_r(int, const char *, ...);
enum ret_cmd { RET_FILE, RET_LIST };
-void retrieve(enum ret_cmd, char *);
+void retrieve(enum ret_cmd, const char *);
void send_file_list(char *);
void setproctitle(const char *, ...);
void statcmd(void);
-void statfilecmd(char *);
-void store(char *, char *, int);
+void statfilecmd(const char *);
+void store(const char *, const char *, int);
void upper(char *);
void user(char *);
void yyerror(char *);
-/* $OpenBSD: ftpd.c,v 1.231 2021/05/22 14:30:46 jan Exp $ */
+/* $OpenBSD: ftpd.c,v 1.232 2021/05/23 17:01:21 jan Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
(long long)(cnt)); \
}
-static void ack(char *);
+static void ack(const char *);
static void sigurg(int);
static void myoob(void);
-static int checkuser(char *, char *);
-static FILE *dataconn(char *, off_t, char *);
+static int checkuser(char *, const char *);
+static FILE *dataconn(const char *, off_t, char *);
static void dolog(struct sockaddr *);
static char *copy_dir(char *, struct passwd *);
static char *curdir(void);
static void end_login(void);
static FILE *getdatasock(char *);
-static int guniquefd(char *, char **);
+static int guniquefd(const char *, char **);
static void lostconn(int);
static void sigquit(int);
static int receive_data(FILE *, FILE *);
static void replydirname(const char *, const char *);
static int send_data(FILE *, FILE *, off_t, off_t, int);
static struct passwd *
- sgetpwnam(char *, struct passwd *);
+ sgetpwnam(const char *, struct passwd *);
static void reapchild(int);
static void usage(void);
-void logxfer(char *, off_t, time_t);
+void logxfer(const char *, off_t, time_t);
void set_slave_signals(void);
static char *
* (e.g., globbing).
*/
static struct passwd *
-sgetpwnam(char *name, struct passwd *pw)
+sgetpwnam(const char *name, struct passwd *pw)
{
static struct passwd *save;
struct passwd *old;
* Check if a user is in the file "fname"
*/
static int
-checkuser(char *fname, char *name)
+checkuser(char *fname, const char *name)
{
FILE *fp;
int found = 0;
}
void
-retrieve(enum ret_cmd cmd, char *name)
+retrieve(enum ret_cmd cmd, const char *name)
{
FILE *fin, *dout;
struct stat st;
}
void
-store(char *name, char *mode, int unique)
+store(const char *name, const char *mode, int unique)
{
FILE *fout, *din;
int (*closefunc)(FILE *);
}
static FILE *
-dataconn(char *name, off_t size, char *mode)
+dataconn(const char *name, off_t size, char *mode)
{
char sizebuf[32];
FILE *file = NULL;
}
void
-statfilecmd(char *filename)
+statfilecmd(const char *filename)
{
FILE *fin;
int c;
}
void
-fatal(char *s)
+fatal(const char *s)
{
reply(451, "Error in server: %s", s);
}
static void
-ack(char *s)
+ack(const char *s)
{
reply(250, "%s command successful.", s);
}
void
-nack(char *s)
+nack(const char *s)
{
reply(502, "%s command not implemented.", s);
}
void
-delete(char *name)
+delete(const char *name)
{
struct stat st;
}
void
-makedir(char *name)
+makedir(const char *name)
{
LOGCMD("mkdir", name);
}
void
-removedir(char *name)
+removedir(const char *name)
{
LOGCMD("rmdir", name);
}
void
-renamecmd(char *from, char *to)
+renamecmd(const char *from, const char *to)
{
LOGCMD2("rename", from, to);
* 229 Entering Extended Passive Mode (|||port|)
*/
void
-long_passive(char *cmd, int pf)
+long_passive(const char *cmd, int pf)
{
socklen_t len;
int on = 1;
* Generates failure reply on error.
*/
static int
-guniquefd(char *local, char **nam)
+guniquefd(const char *local, char **nam)
{
static char new[PATH_MAX];
struct stat st;
* Format and send reply containing system error number.
*/
void
-perror_reply(int code, char *string)
+perror_reply(int code, const char *string)
{
reply(code, "%s: %s.", string, strerror(errno));
}
void
-logxfer(char *name, off_t size, time_t start)
+logxfer(const char *name, off_t size, time_t start)
{
char buf[400 + (HOST_NAME_MAX+1)*4 + PATH_MAX*4];
char dir[PATH_MAX], path[PATH_MAX], rpath[PATH_MAX];