diff options
| author | Andreas Gruenbacher <agruen@gnu.org> | 2016-07-27 15:40:38 +0200 |
|---|---|---|
| committer | Andreas Gruenbacher <agruen@gnu.org> | 2016-07-27 15:47:47 +0200 |
| commit | 83a3ed012c677df484a892af69dbca8963867cb3 (patch) | |
| tree | 6f01604efaa0525a1a3b1bb11ad417c18a918a77 /src/safe.h | |
| parent | 70532e21a8e1a849d934334b51fff780babc0386 (diff) | |
| download | patch-83a3ed012c677df484a892af69dbca8963867cb3.tar.gz | |
Fix inname test case
* src/safe.h (unsafe): New flag to allow turning off safe file
operations.
* src/safe.c (safe_xstat, safe_open, safe_rename, safe_mkdir,
safe_rmdir, safe_unlink, safe_symlink, safe_chmod, safe_lchown,
safe_lutimens, safe_readlink, safe_access): When safe file operations
are turned off, skip safe path traversal. Any symlink checks of the
last path component are still done though.
* src/patch.c (main): When the file to patch is specified on the command
line, turn off safe file operations.
* tests/inname: Fix typo in test.
Diffstat (limited to 'src/safe.h')
| -rw-r--r-- | src/safe.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -18,6 +18,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <stdbool.h> + +extern bool unsafe; + int safe_stat (const char *pathname, struct stat *buf); int safe_lstat (const char *pathname, struct stat *buf); int safe_open (const char *pathname, int flags, mode_t mode); |
