From d8ce6bf1434748af09cdf17620d7585eae23fd6f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 31 May 2005 06:15:18 +0000 Subject: Add copyright notice. (struct cp_options): Remove myeuid member. Add chown_privileges member. (chown_privileges, chown_failure_ok): New function decls. --- src/copy.h | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) (limited to 'src/copy.h') diff --git a/src/copy.h b/src/copy.h index 1308962fb..90a47f73e 100644 --- a/src/copy.h +++ b/src/copy.h @@ -1,3 +1,22 @@ +/* core functions for copying files and directories + Copyright (C) 89, 90, 91, 1995-2005 Free Software Foundation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Extracted from cp.c and librarified by Jim Meyering. */ + #ifndef COPY_H # define COPY_H @@ -94,8 +113,9 @@ struct cp_options If that fails, then resort to copying. */ bool move_mode; - /* This process's effective user ID. */ - uid_t myeuid; + /* Whether this process has appropriate privileges to chown a file + whose owner is not the effective user ID. */ + bool chown_privileges; /* If true, when copying recursively, skip any subdirectories that are on different file systems from the one we started on. */ @@ -195,14 +215,14 @@ int rpl_rename (const char *, const char *); # define rename rpl_rename # endif -bool -copy (const char *src_path, const char *dst_path, - bool nonexistent_dst, const struct cp_options *options, - bool *copy_into_self, bool *rename_succeeded); +bool copy (const char *src_path, const char *dst_path, + bool nonexistent_dst, const struct cp_options *options, + bool *copy_into_self, bool *rename_succeeded); + +void dest_info_init (struct cp_options *); +void src_info_init (struct cp_options *); -void -dest_info_init (struct cp_options *); -void -src_info_init (struct cp_options *); +bool chown_privileges (void); +bool chown_failure_ok (struct cp_options const *); #endif -- cgit v1.2.3-54-g00ecf