Blame SOURCES/sudo-1.9.5-CVE-2021-23240-2.patch

230a1d
diff -up ./src/copy_file.c.symbolic-link-attack-2 ./src/copy_file.c
230a1d
--- ./src/copy_file.c.symbolic-link-attack-2	2021-02-02 15:31:20.555340446 +0100
230a1d
+++ ./src/copy_file.c	2021-02-02 15:31:20.555340446 +0100
230a1d
@@ -0,0 +1,128 @@
230a1d
+/*
230a1d
+ * SPDX-License-Identifier: ISC
230a1d
+ *
230a1d
+ * Copyright (c) 2020 Todd C. Miller <Todd.Miller@sudo.ws>
230a1d
+ *
230a1d
+ * Permission to use, copy, modify, and distribute this software for any
230a1d
+ * purpose with or without fee is hereby granted, provided that the above
230a1d
+ * copyright notice and this permission notice appear in all copies.
230a1d
+ *
230a1d
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
230a1d
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
230a1d
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
230a1d
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
230a1d
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
230a1d
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
230a1d
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
230a1d
+ */
230a1d
+
230a1d
+/*
230a1d
+ * This is an open source non-commercial project. Dear PVS-Studio, please check it.
230a1d
+ * PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
230a1d
+ */
230a1d
+
230a1d
+#include <config.h>
230a1d
+
230a1d
+#include <sys/types.h>
230a1d
+
230a1d
+#include <stdio.h>
230a1d
+#include <stdlib.h>
230a1d
+#include <unistd.h>
230a1d
+#include <errno.h>
230a1d
+
230a1d
+#include "sudo.h"
230a1d
+
230a1d
+/*
230a1d
+ * Extend the given fd to the specified size in bytes.
230a1d
+ * We do this to allocate disk space up-front before overwriting
230a1d
+ * the original file with the temporary.  Otherwise, we could
230a1d
+ * we run out of disk space after truncating the original file.
230a1d
+ */
230a1d
+static int
230a1d
+sudo_extend_file(int fd, const char *name, off_t new_size)
230a1d
+{
230a1d
+    off_t old_size, size;
230a1d
+    ssize_t nwritten;
230a1d
+    char zeroes[BUFSIZ] = { '\0' };
230a1d
+    debug_decl(sudo_extend_file, SUDO_DEBUG_UTIL);
230a1d
+
230a1d
+    if ((old_size = lseek(fd, 0, SEEK_END)) == -1) {
230a1d
+	sudo_warn("lseek");
230a1d
+	debug_return_int(-1);
230a1d
+    }
230a1d
+    sudo_debug_printf(SUDO_DEBUG_INFO, "%s: extending %s from %lld to %lld",
230a1d
+	__func__, name, (long long)old_size, (long long)new_size);
230a1d
+
230a1d
+    for (size = old_size; size < new_size; size += nwritten) {
230a1d
+	size_t len = new_size - size;
230a1d
+	if (len > sizeof(zeroes))
230a1d
+	    len = sizeof(zeroes);
230a1d
+	nwritten = write(fd, zeroes, len);
230a1d
+	if (nwritten == -1) {
230a1d
+	    int serrno = errno;
230a1d
+	    if (ftruncate(fd, old_size) == -1) {
230a1d
+		sudo_debug_printf(
230a1d
+		    SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO,
230a1d
+		    "unable to truncate %s to %lld", name, (long long)old_size);
230a1d
+	    }
230a1d
+	    errno = serrno;
230a1d
+	    debug_return_int(-1);
230a1d
+	}
230a1d
+    }
230a1d
+    if (lseek(fd, 0, SEEK_SET) == -1) {
230a1d
+	sudo_warn("lseek");
230a1d
+	debug_return_int(-1);
230a1d
+    }
230a1d
+
230a1d
+    debug_return_int(0);
230a1d
+}
230a1d
+
230a1d
+/*
230a1d
+ * Copy the contents of src_fd into dst_fd.
230a1d
+ * Returns 0 on success or -1 on error.
230a1d
+ */
230a1d
+int
230a1d
+sudo_copy_file(const char *src, int src_fd, off_t src_len, const char *dst,
230a1d
+    int dst_fd, off_t dst_len)
230a1d
+{
230a1d
+    char buf[BUFSIZ];
230a1d
+    ssize_t nwritten, nread;
230a1d
+    debug_decl(sudo_copy_file, SUDO_DEBUG_UTIL);
230a1d
+
230a1d
+    /* Extend the file to the new size if larger before copying. */
230a1d
+    if (dst_len > 0 && src_len > dst_len) {
230a1d
+	if (sudo_extend_file(dst_fd, dst, src_len) == -1)
230a1d
+	    goto write_error;
230a1d
+    }
230a1d
+
230a1d
+    /* Overwrite the old file with the new contents. */
230a1d
+    while ((nread = read(src_fd, buf, sizeof(buf))) > 0) {
230a1d
+	ssize_t off = 0;
230a1d
+	do {
230a1d
+	    nwritten = write(dst_fd, buf + off, nread - off);
230a1d
+	    if (nwritten == -1)
230a1d
+		goto write_error;
230a1d
+	    off += nwritten;
230a1d
+	} while (nread > off);
230a1d
+    }
230a1d
+    if (nread == 0) {
230a1d
+	/* success, read to EOF */
230a1d
+	if (src_len < dst_len) {
230a1d
+	    /* We don't open with O_TRUNC so must truncate manually. */
230a1d
+	    if (ftruncate(dst_fd, src_len) == -1) {
230a1d
+		sudo_debug_printf(
230a1d
+		    SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO,
230a1d
+		    "unable to truncate %s to %lld", dst, (long long)src_len);
230a1d
+		goto write_error;
230a1d
+	    }
230a1d
+	}
230a1d
+	debug_return_int(0);
230a1d
+    } else if (nread < 0) {
230a1d
+	sudo_warn(U_("unable to read from %s"), src);
230a1d
+	debug_return_int(-1);
230a1d
+    } else {
230a1d
+write_error:
230a1d
+	sudo_warn(U_("unable to write to %s"), dst);
230a1d
+	debug_return_int(-1);
230a1d
+    }
230a1d
+}
230a1d
diff -up ./src/Makefile.in.symbolic-link-attack-2 ./src/Makefile.in
230a1d
--- ./src/Makefile.in.symbolic-link-attack-2	2019-10-28 13:28:54.000000000 +0100
230a1d
+++ ./src/Makefile.in	2021-02-02 15:31:20.555340446 +0100
230a1d
@@ -120,16 +120,17 @@ SHELL = @SHELL@
230a1d
 
230a1d
 PROGS = @PROGS@
230a1d
 
230a1d
-OBJS = conversation.o env_hooks.o exec.o exec_common.o exec_monitor.o \
230a1d
-       exec_nopty.o exec_pty.o get_pty.o hooks.o limits.o load_plugins.o \
230a1d
-       net_ifs.o parse_args.o preserve_fds.o signal.o sudo.o sudo_edit.o \
230a1d
-       tcsetpgrp_nobg.o tgetpass.o ttyname.o utmp.o @SUDO_OBJS@
230a1d
+OBJS = conversation.o copy_file.o env_hooks.o exec.o exec_common.o \
230a1d
+       exec_monitor.o exec_nopty.o exec_pty.o get_pty.o hooks.o \
230a1d
+       limits.o load_plugins.o net_ifs.o parse_args.o preserve_fds.o \
230a1d
+       signal.o sudo.o sudo_edit.o tcsetpgrp_nobg.o tgetpass.o \
230a1d
+       ttyname.o utmp.o @SUDO_OBJS@
230a1d
 
230a1d
 IOBJS = $(OBJS:.o=.i) sesh.i
230a1d
 
230a1d
 POBJS = $(IOBJS:.i=.plog)
230a1d
 
230a1d
-SESH_OBJS = sesh.o exec_common.o
230a1d
+SESH_OBJS = copy_file.o exec_common.o sesh.o
230a1d
 
230a1d
 CHECK_NOEXEC_OBJS = check_noexec.o exec_common.o
230a1d
 
230a1d
@@ -335,6 +336,22 @@ conversation.i: $(srcdir)/conversation.c
230a1d
 	$(CC) -E -o $@ $(CPPFLAGS) $<
230a1d
 conversation.plog: conversation.i
230a1d
 	rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $(srcdir)/conversation.c --i-file $< --output-file $@
230a1d
+copy_file.o: $(srcdir)/copy_file.c $(incdir)/compat/stdbool.h \
230a1d
+             $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
230a1d
+             $(incdir)/sudo_debug.h $(incdir)/sudo_event.h \
230a1d
+             $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
230a1d
+             $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
230a1d
+             $(top_builddir)/config.h $(top_builddir)/pathnames.h
230a1d
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/copy_file.c
230a1d
+copy_file.i: $(srcdir)/copy_file.c $(incdir)/compat/stdbool.h \
230a1d
+             $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
230a1d
+             $(incdir)/sudo_debug.h $(incdir)/sudo_event.h \
230a1d
+             $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
230a1d
+             $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
230a1d
+             $(top_builddir)/config.h $(top_builddir)/pathnames.h
230a1d
+	$(CC) -E -o $@ $(CPPFLAGS) $<
230a1d
+copy_file.plog: copy_file.i
230a1d
+	rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $(srcdir)/copy_file.c --i-file $< --output-file $@
230a1d
 env_hooks.o: $(srcdir)/env_hooks.c $(incdir)/compat/stdbool.h \
230a1d
              $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
230a1d
              $(incdir)/sudo_debug.h $(incdir)/sudo_dso.h \
230a1d
diff -up ./src/sesh.c.symbolic-link-attack-2 ./src/sesh.c
230a1d
--- ./src/sesh.c.symbolic-link-attack-2	2019-10-28 13:28:52.000000000 +0100
230a1d
+++ ./src/sesh.c	2021-02-02 15:31:20.555340446 +0100
230a1d
@@ -1,7 +1,7 @@
230a1d
 /*
230a1d
  * SPDX-License-Identifier: ISC
230a1d
  *
230a1d
- * Copyright (c) 2008, 2010-2018 Todd C. Miller <Todd.Miller@sudo.ws>
230a1d
+ * Copyright (c) 2008, 2010-2018, 2020 Todd C. Miller <Todd.Miller@sudo.ws>
230a1d
  *
230a1d
  * Permission to use, copy, modify, and distribute this software for any
230a1d
  * purpose with or without fee is hereby granted, provided that the above
230a1d
@@ -182,7 +182,7 @@ sesh_sudoedit(int argc, char *argv[])
230a1d
      * so that it's ensured that the temporary files are
230a1d
      * created by us and that we are not opening any symlinks.
230a1d
      */
230a1d
-    oflags_dst = O_WRONLY|O_TRUNC|O_CREAT|(post ? follow : O_EXCL);
230a1d
+    oflags_dst = O_WRONLY|O_CREAT|(post ? follow : O_EXCL);
230a1d
     for (i = 0; i < argc - 1; i += 2) {
230a1d
 	const char *path_src = argv[i];
230a1d
 	const char *path_dst = argv[i + 1];
230a1d
@@ -214,14 +214,29 @@ sesh_sudoedit(int argc, char *argv[])
230a1d
 	}
230a1d
 
230a1d
 	if (fd_src != -1) {
230a1d
-	    while ((nread = read(fd_src, buf, sizeof(buf))) > 0) {
230a1d
-		if ((nwritten = write(fd_dst, buf, nread)) != nread) {
230a1d
-		    sudo_warn("%s", path_src);
230a1d
-		    if (post) {
230a1d
-			ret = SESH_ERR_SOME_FILES;
230a1d
-			goto nocleanup;
230a1d
-		    } else
230a1d
-			goto cleanup_0;
230a1d
+	    off_t len_src = -1;
230a1d
+	    off_t len_dst = -1;
230a1d
+
230a1d
+	    if (post) {
230a1d
+		if (fstat(fd_src, &sb) != 0) {
230a1d
+		    ret = SESH_ERR_SOME_FILES;
230a1d
+		    goto nocleanup;
230a1d
+		}
230a1d
+		len_src = sb.st_size;
230a1d
+		if (fstat(fd_dst, &sb) != 0) {
230a1d
+		    ret = SESH_ERR_SOME_FILES;
230a1d
+		    goto nocleanup;
230a1d
+		}
230a1d
+		len_dst = sb.st_size;
230a1d
+	    }
230a1d
+
230a1d
+	    if (sudo_copy_file(path_src, fd_src, len_src, path_dst, fd_dst,
230a1d
+		    len_dst) == -1) {
230a1d
+		if (post) {
230a1d
+		    ret = SESH_ERR_SOME_FILES;
230a1d
+		    goto nocleanup;
230a1d
+		} else {
230a1d
+		    goto cleanup_0;
230a1d
 		}
230a1d
 	    }
230a1d
 	}
230a1d
diff -up ./src/sudo_edit.c.symbolic-link-attack-2 ./src/sudo_edit.c
230a1d
--- ./src/sudo_edit.c.symbolic-link-attack-2	2021-02-02 15:31:20.554340459 +0100
230a1d
+++ ./src/sudo_edit.c	2021-02-02 15:31:54.355884326 +0100
230a1d
@@ -42,7 +42,6 @@
230a1d
 #include <grp.h>
230a1d
 #include <pwd.h>
230a1d
 #include <signal.h>
230a1d
-#include <errno.h>
230a1d
 #include <fcntl.h>
230a1d
 
230a1d
 #include "sudo.h"
230a1d
@@ -551,8 +550,6 @@ sudo_edit_create_tfiles(struct command_d
230a1d
     struct tempfile *tf, char *files[], int nfiles)
230a1d
 {
230a1d
     int i, j, tfd, ofd, rc;
230a1d
-    char buf[BUFSIZ];
230a1d
-    ssize_t nwritten, nread;
230a1d
     struct timespec times[2];
230a1d
     struct stat sb;
230a1d
     debug_decl(sudo_edit_create_tfiles, SUDO_DEBUG_EDIT)
230a1d
@@ -648,18 +645,7 @@ sudo_edit_create_tfiles(struct command_d
230a1d
 	    debug_return_int(-1);
230a1d
 	}
230a1d
 	if (ofd != -1) {
230a1d
-	    while ((nread = read(ofd, buf, sizeof(buf))) > 0) {
230a1d
-		if ((nwritten = write(tfd, buf, nread)) != nread) {
230a1d
-		    if (nwritten == -1)
230a1d
-			sudo_warn("%s", tf[j].tfile);
230a1d
-		    else
230a1d
-			sudo_warnx(U_("%s: short write"), tf[j].tfile);
230a1d
-		    break;
230a1d
-		}
230a1d
-	    }
230a1d
-	    if (nread != 0) {
230a1d
-		if (nread < 0)
230a1d
-		    sudo_warn("%s", files[i]);
230a1d
+	    if (sudo_copy_file(tf[j].ofile, ofd, tf[j].osize, tf[j].tfile, tfd, -1) == -1) {
230a1d
 		close(ofd);
230a1d
 		close(tfd);
230a1d
 		debug_return_int(-1);
230a1d
@@ -689,51 +675,6 @@ sudo_edit_create_tfiles(struct command_d
230a1d
 }
230a1d
 
230a1d
 /*
230a1d
- * Extend the given fd to the specified size in bytes.
230a1d
- * We do this to allocate disk space up-front before overwriting
230a1d
- * the original file with the temporary.  Otherwise, we could
230a1d
- * we run out of disk space after truncating the original file.
230a1d
- */
230a1d
-static int
230a1d
-sudo_edit_extend_file(int fd, off_t new_size)
230a1d
-{
230a1d
-    off_t old_size, size;
230a1d
-    ssize_t nwritten;
230a1d
-    char zeroes[1024] = { '\0' };
230a1d
-    debug_decl(sudo_edit_extend_file, SUDO_DEBUG_EDIT);
230a1d
-
230a1d
-    if ((old_size = lseek(fd, 0, SEEK_END)) == -1) {
230a1d
-	sudo_warn("lseek");
230a1d
-	debug_return_int(-1);
230a1d
-    }
230a1d
-    sudo_debug_printf(SUDO_DEBUG_INFO, "%s: extending file from %lld to %lld",
230a1d
-	__func__, (long long)old_size, (long long)new_size);
230a1d
-
230a1d
-    for (size = old_size; size < new_size; size += nwritten) {
230a1d
-	size_t len = new_size - size;
230a1d
-	if (len > sizeof(zeroes))
230a1d
-	    len = sizeof(zeroes);
230a1d
-	nwritten = write(fd, zeroes, len);
230a1d
-	if (nwritten == -1) {
230a1d
-	    int serrno = errno;
230a1d
-	    if (ftruncate(fd, old_size) == -1) {
230a1d
-		sudo_debug_printf(
230a1d
-		    SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO,
230a1d
-		    "unable to truncate to %lld", (long long)old_size);
230a1d
-	    }
230a1d
-	    errno = serrno;
230a1d
-	    debug_return_int(-1);
230a1d
-	}
230a1d
-    }
230a1d
-    if (lseek(fd, 0, SEEK_SET) == -1) {
230a1d
-	sudo_warn("lseek");
230a1d
-	debug_return_int(-1);
230a1d
-    }
230a1d
-
230a1d
-    debug_return_int(0);
230a1d
-}
230a1d
-
230a1d
-/*
230a1d
  * Copy the temporary files specified in tf to the originals.
230a1d
  * Returns the number of copy errors or 0 if completely successful.
230a1d
  */
230a1d
@@ -741,9 +682,7 @@ static int
230a1d
 sudo_edit_copy_tfiles(struct command_details *command_details,
230a1d
     struct tempfile *tf, int nfiles, struct timespec *times)
230a1d
 {
230a1d
-    int i, tfd, ofd, rc, errors = 0;
230a1d
-    char buf[BUFSIZ];
230a1d
-    ssize_t nwritten, nread;
230a1d
+    int i, tfd, ofd, errors = 0;
230a1d
     struct timespec ts;
230a1d
     struct stat sb;
230a1d
     mode_t oldmask;
230a1d
@@ -751,7 +690,7 @@ sudo_edit_copy_tfiles(struct command_det
230a1d
 
230a1d
     /* Copy contents of temp files to real ones. */
230a1d
     for (i = 0; i < nfiles; i++) {
230a1d
-	rc = -1;
230a1d
+	int rc = -1;
230a1d
 	sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
230a1d
 	    "seteuid(%u)", (unsigned int)user_details.uid);
230a1d
 	if (seteuid(user_details.uid) != 0)
230a1d
@@ -764,8 +703,8 @@ sudo_edit_copy_tfiles(struct command_det
230a1d
 	    "seteuid(%u)", ROOT_UID);
230a1d
 	if (seteuid(ROOT_UID) != 0)
230a1d
 	    sudo_fatal("seteuid(ROOT_UID)");
230a1d
-	if (rc || !S_ISREG(sb.st_mode)) {
230a1d
-	    if (rc)
230a1d
+	if (rc == -1 || !S_ISREG(sb.st_mode)) {
230a1d
+	    if (rc == -1)
230a1d
 		sudo_warn("%s", tf[i].tfile);
230a1d
 	    else
230a1d
 		sudo_warnx(U_("%s: not a regular file"), tf[i].tfile);
230a1d
@@ -796,46 +735,19 @@ sudo_edit_copy_tfiles(struct command_det
230a1d
 	umask(oldmask);
230a1d
 	switch_user(ROOT_UID, user_details.egid,
230a1d
 	    user_details.ngroups, user_details.groups);
230a1d
-	if (ofd == -1)
230a1d
-	    goto write_error;
230a1d
-	/* Extend the file to the new size if larger before copying. */
230a1d
-	if (tf[i].osize > 0 && sb.st_size > tf[i].osize) {
230a1d
-	    if (sudo_edit_extend_file(ofd, sb.st_size) == -1)
230a1d
-		goto write_error;
230a1d
+	if (ofd == -1) {
230a1d
+	    sudo_warn(U_("unable to write to %s"), tf[i].ofile);
230a1d
+	    goto bad;
230a1d
 	}
230a1d
+
230a1d
 	/* Overwrite the old file with the new contents. */
230a1d
-	while ((nread = read(tfd, buf, sizeof(buf))) > 0) {
230a1d
-	    ssize_t off = 0;
230a1d
-	    do {
230a1d
-		nwritten = write(ofd, buf + off, nread - off);
230a1d
-		if (nwritten == -1)
230a1d
-		    goto write_error;
230a1d
-		off += nwritten;
230a1d
-	    } while (nread > off);
230a1d
-	}
230a1d
-	if (nread == 0) {
230a1d
-	    /* success, read to EOF */
230a1d
-	    if (tf[i].osize > 0 && sb.st_size < tf[i].osize) {
230a1d
-		/* We don't open with O_TRUNC so must truncate manually. */
230a1d
-		if (ftruncate(ofd, sb.st_size)  == -1) {
230a1d
-		    sudo_debug_printf(
230a1d
-			SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO,
230a1d
-			"unable to truncate %s to %lld", tf[i].ofile,
230a1d
-			(long long)sb.st_size);
230a1d
-		    goto write_error;
230a1d
-		}
230a1d
-	    }
230a1d
-	    unlink(tf[i].tfile);
230a1d
-	} else if (nread < 0) {
230a1d
-	    sudo_warn(U_("unable to read temporary file"));
230a1d
-	    sudo_warnx(U_("contents of edit session left in %s"), tf[i].tfile);
230a1d
-	    errors++;
230a1d
-	} else {
230a1d
-write_error:
230a1d
-	    sudo_warn(U_("unable to write to %s"), tf[i].ofile);
230a1d
+	if (sudo_copy_file(tf[i].tfile, tfd, sb.st_size, tf[i].ofile, ofd,
230a1d
+	    tf[i].osize) == -1) {
230a1d
+bad:
230a1d
 	    sudo_warnx(U_("contents of edit session left in %s"), tf[i].tfile);
230a1d
 	    errors++;
230a1d
 	}
230a1d
+
230a1d
 	if (ofd != -1)
230a1d
 	    close(ofd);
230a1d
 	close(tfd);
230a1d
diff -up ./src/sudo_exec.h.symbolic-link-attack-2 ./src/sudo_exec.h
230a1d
--- ./src/sudo_exec.h.symbolic-link-attack-2	2019-10-28 13:27:39.000000000 +0100
230a1d
+++ ./src/sudo_exec.h	2021-02-02 15:31:20.556340432 +0100
230a1d
@@ -84,6 +84,9 @@
230a1d
 struct command_details;
230a1d
 struct command_status;
230a1d
 
230a1d
+/* copy_file.c */
230a1d
+int sudo_copy_file(const char *src, int src_fd, off_t src_len, const char *dst, int dst_fd, off_t dst_len);
230a1d
+
230a1d
 /* exec.c */
230a1d
 void exec_cmnd(struct command_details *details, int errfd);
230a1d
 void terminate_command(pid_t pid, bool use_pgrp);