
{"id":415,"date":"2010-01-20T15:57:48","date_gmt":"2010-01-20T15:57:48","guid":{"rendered":"http:\/\/froisa.com\/?p=415"},"modified":"2010-01-20T15:57:48","modified_gmt":"2010-01-20T15:57:48","slug":"part-of-original-file-copy-c","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/01\/20\/part-of-original-file-copy-c\/","title":{"rendered":"part of original file [ copy.c ]"},"content":{"rendered":"<pre class=\"brush:c\">\n\/* copy.c -- core functions for copying files and directories\n   Copyright (C) 89, 90, 91, 1995-2009 Free Software Foundation, Inc.\n\n   This program is free software: you can redistribute it and\/or modify\n   it under the terms of the GNU General Public License as published by\n   the Free Software Foundation, either version 3 of the License, or\n   (at your option) any later version.\n\n   This program is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n   GNU General Public License for more details.\n\n   You should have received a copy of the GNU General Public License\n   along with this program.  If not, see .  *\/\n\n\/* Extracted from cp.c and librarified by Jim Meyering.  *\/\n\n \/* To allow copying xattrs on read-only files, temporarily chmod u+rw.\n     This workaround is required as an inode permission check is done\n     by xattr_permission() in fs\/xattr.c of the GNU\/Linux kernel tree.  *\/\n  if (x-&gt;preserve_xattr)\n    {\n      bool access_changed = false;\n\n      if (!(sb.st_mode &amp; S_IWUSR) &amp;&amp; geteuid() != 0)\n        access_changed = fchmod_or_lchmod (dest_desc, dst_name, 0600) == 0;\n\n      if (!copy_attr_by_fd (src_name, source_desc, dst_name, dest_desc, x)\n          &amp;&amp; x-&gt;require_preserve_xattr)\n        return_val = false;\n\n      if (access_changed)\n        fchmod_or_lchmod (dest_desc, dst_name, dst_mode &amp; ~omitted_permissions);\n    }\n<\/pre>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/Extended_file_attributes\">http:\/\/en.wikipedia.org\/wiki\/Extended_file_attributes<\/a><br \/>\n<a href=\"http:\/\/sourceforge.net\/projects\/xattr\/\"> http:\/\/sourceforge.net\/projects\/xattr\/<\/a><br \/>\n<a href=\"http:\/\/www.opengroup.org\/onlinepubs\/007908799\/xsh\/fchmod.html\"><br \/>\nhttp:\/\/www.opengroup.org\/onlinepubs\/007908799\/xsh\/fchmod.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/* copy.c &#8212; core functions for copying files and directories Copyright (C) 89, 90, 91, 1995-2009 Free Software Foundation, Inc. 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 3 of the License, or &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/01\/20\/part-of-original-file-copy-c\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;part of original file [ copy.c ]&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[1424,1699],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/415"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=415"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/415\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}