summaryrefslogtreecommitdiff
path: root/usr.bin/rsync/extern.h
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2019-02-16 10:46:23 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2019-02-16 10:46:23 +0000
commit603c710d890537089cde0824b4af8935d3960296 (patch)
tree46fb35b290c8cca86b11770bd809fe27266a8acd /usr.bin/rsync/extern.h
parentffb81903474e9f6ce0fe506577905da85f07f179 (diff)
Introduce mkstempat(), a variation on mkstemp(3) and mkstemplinkat().
mkstempat() works exactly like mkstemp(3) except that it replaces open(2) with openat(2) so that it can be used in rsync_downloader() to easily deal with relative paths. mkstemplinkat() works somewhat like mkdtemp() to create a template symlink. Use the mkstemplinkat() to create or update symlinks and overwrite existing objects including empty directories that might exist under the destination name. "you snooze, you get collisions" deraadt@
Diffstat (limited to 'usr.bin/rsync/extern.h')
-rw-r--r--usr.bin/rsync/extern.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/rsync/extern.h b/usr.bin/rsync/extern.h
index da9bbac9fda..08a3549b8c9 100644
--- a/usr.bin/rsync/extern.h
+++ b/usr.bin/rsync/extern.h
@@ -1,4 +1,4 @@
-/* $Id: extern.h,v 1.10 2019/02/14 18:29:08 florian Exp $ */
+/* $Id: extern.h,v 1.11 2019/02/16 10:46:22 florian Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -298,6 +298,10 @@ void hash_file(const void *, size_t,
int mkpath(struct sess *, char *);
+int mkstempat(int, char *);
+char *mkstemplinkat(char*, int, char *);
+int mktemplate(char **, const char *, int);
+
char *symlink_read(struct sess *, const char *);
char *symlinkat_read(struct sess *, int, const char *);