chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
import: add new minimal tool "systemd-import" for pulling down foreign containers...
[elogind.git]
/
src
/
shared
/
util.h
diff --git
a/src/shared/util.h
b/src/shared/util.h
index 73bd9012fd6d1b15358b923961be136337c4a0ed..96b8c1bcc0fdafd9e6efeb0c690aedb64aafd269 100644
(file)
--- a/
src/shared/util.h
+++ b/
src/shared/util.h
@@
-714,7
+714,7
@@
_alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_
return memdup(p, a * b);
}
return memdup(p, a * b);
}
-bool filename_is_
safe
(const char *p) _pure_;
+bool filename_is_
valid
(const char *p) _pure_;
bool path_is_safe(const char *p) _pure_;
bool string_is_safe(const char *p) _pure_;
bool string_has_cc(const char *p, const char *ok) _pure_;
bool path_is_safe(const char *p) _pure_;
bool string_is_safe(const char *p) _pure_;
bool string_has_cc(const char *p, const char *ok) _pure_;
@@
-883,6
+883,7
@@
int unlink_noerrno(const char *path);
(void *) memset(_new_, 0, _len_); \
})
(void *) memset(_new_, 0, _len_); \
})
+/* It's not clear what alignment glibc/gcc alloca() guarantee, hence provide a guaranteed safe version */
#define alloca_align(size, align) \
({ \
void *_ptr_; \
#define alloca_align(size, align) \
({ \
void *_ptr_; \
@@
-1015,8
+1016,9
@@
int bind_remount_recursive(const char *prefix, bool ro);
int fflush_and_check(FILE *f);
int fflush_and_check(FILE *f);
-char *tempfn_xxxxxx(const char *p);
-char *tempfn_random(const char *p);
+int tempfn_xxxxxx(const char *p, char **ret);
+int tempfn_random(const char *p, char **ret);
+int tempfn_random_child(const char *p, char **ret);
bool is_localhost(const char *hostname);
bool is_localhost(const char *hostname);
@@
-1038,3
+1040,5
@@
int sethostname_idempotent(const char *s);
for ((e) = (struct inotify_event*) (buffer); \
(uint8_t*) (e) < (uint8_t*) (buffer) + (sz); \
(e) = (struct inotify_event*) ((uint8_t*) (e) + sizeof(struct inotify_event) + (e)->len))
for ((e) = (struct inotify_event*) (buffer); \
(uint8_t*) (e) < (uint8_t*) (buffer) + (sz); \
(e) = (struct inotify_event*) ((uint8_t*) (e) + sizeof(struct inotify_event) + (e)->len))
+
+#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW)