diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/applets.src.h | 1 | ||||
-rw-r--r-- | include/bb_archive.h | 6 | ||||
-rw-r--r-- | include/grp_.h | 24 | ||||
-rw-r--r-- | include/libbb.h | 11 | ||||
-rw-r--r-- | include/platform.h | 5 | ||||
-rw-r--r-- | include/pwd_.h | 24 | ||||
-rw-r--r-- | include/shadow_.h | 14 |
7 files changed, 48 insertions, 37 deletions
diff --git a/include/applets.src.h b/include/applets.src.h index 597b1c9a6..29ab16706 100644 --- a/include/applets.src.h +++ b/include/applets.src.h | |||
@@ -328,6 +328,7 @@ IF_SETSEBOOL(APPLET(setsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) | |||
328 | IF_SETSID(APPLET(setsid, BB_DIR_USR_BIN, BB_SUID_DROP)) | 328 | IF_SETSID(APPLET(setsid, BB_DIR_USR_BIN, BB_SUID_DROP)) |
329 | IF_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, setuidgid)) | 329 | IF_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, setuidgid)) |
330 | IF_SHA1SUM(APPLET_NOEXEC(sha1sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha1sum)) | 330 | IF_SHA1SUM(APPLET_NOEXEC(sha1sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha1sum)) |
331 | IF_SHA3SUM(APPLET_NOEXEC(sha3sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha3sum)) | ||
331 | IF_SHA256SUM(APPLET_NOEXEC(sha256sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha256sum)) | 332 | IF_SHA256SUM(APPLET_NOEXEC(sha256sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha256sum)) |
332 | IF_SHA512SUM(APPLET_NOEXEC(sha512sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha512sum)) | 333 | IF_SHA512SUM(APPLET_NOEXEC(sha512sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha512sum)) |
333 | IF_SHOWKEY(APPLET(showkey, BB_DIR_USR_BIN, BB_SUID_DROP)) | 334 | IF_SHOWKEY(APPLET(showkey, BB_DIR_USR_BIN, BB_SUID_DROP)) |
diff --git a/include/bb_archive.h b/include/bb_archive.h index 7bb5615da..a7a2a1135 100644 --- a/include/bb_archive.h +++ b/include/bb_archive.h | |||
@@ -220,9 +220,9 @@ IF_DESKTOP(long long) int unpack_xz_stream(transformer_aux_data_t *aux, int src_ | |||
220 | 220 | ||
221 | char* append_ext(char *filename, const char *expected_ext) FAST_FUNC; | 221 | char* append_ext(char *filename, const char *expected_ext) FAST_FUNC; |
222 | int bbunpack(char **argv, | 222 | int bbunpack(char **argv, |
223 | IF_DESKTOP(long long) int FAST_FUNC (*unpacker)(transformer_aux_data_t *aux), | 223 | IF_DESKTOP(long long) int FAST_FUNC (*unpacker)(transformer_aux_data_t *aux), |
224 | char* FAST_FUNC (*make_new_name)(char *filename, const char *expected_ext), | 224 | char* FAST_FUNC (*make_new_name)(char *filename, const char *expected_ext), |
225 | const char *expected_ext | 225 | const char *expected_ext |
226 | ) FAST_FUNC; | 226 | ) FAST_FUNC; |
227 | 227 | ||
228 | void check_errors_in_children(int signo); | 228 | void check_errors_in_children(int signo); |
diff --git a/include/grp_.h b/include/grp_.h index 82ad90492..e5075e5a0 100644 --- a/include/grp_.h +++ b/include/grp_.h | |||
@@ -64,7 +64,7 @@ extern struct group *fgetgrent(FILE *__stream); | |||
64 | 64 | ||
65 | /* Write the given entry onto the given stream. */ | 65 | /* Write the given entry onto the given stream. */ |
66 | extern int putgrent(const struct group *__restrict __p, | 66 | extern int putgrent(const struct group *__restrict __p, |
67 | FILE *__restrict __f); | 67 | FILE *__restrict __f); |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | /* Search for an entry with a matching group ID. */ | 70 | /* Search for an entry with a matching group ID. */ |
@@ -82,32 +82,32 @@ extern struct group *getgrnam(const char *__name); | |||
82 | POSIX people would choose. */ | 82 | POSIX people would choose. */ |
83 | 83 | ||
84 | extern int getgrent_r(struct group *__restrict __resultbuf, | 84 | extern int getgrent_r(struct group *__restrict __resultbuf, |
85 | char *__restrict __buffer, size_t __buflen, | 85 | char *__restrict __buffer, size_t __buflen, |
86 | struct group **__restrict __result); | 86 | struct group **__restrict __result); |
87 | 87 | ||
88 | /* Search for an entry with a matching group ID. */ | 88 | /* Search for an entry with a matching group ID. */ |
89 | extern int getgrgid_r(gid_t __gid, struct group *__restrict __resultbuf, | 89 | extern int getgrgid_r(gid_t __gid, struct group *__restrict __resultbuf, |
90 | char *__restrict __buffer, size_t __buflen, | 90 | char *__restrict __buffer, size_t __buflen, |
91 | struct group **__restrict __result); | 91 | struct group **__restrict __result); |
92 | 92 | ||
93 | /* Search for an entry with a matching group name. */ | 93 | /* Search for an entry with a matching group name. */ |
94 | extern int getgrnam_r(const char *__restrict __name, | 94 | extern int getgrnam_r(const char *__restrict __name, |
95 | struct group *__restrict __resultbuf, | 95 | struct group *__restrict __resultbuf, |
96 | char *__restrict __buffer, size_t __buflen, | 96 | char *__restrict __buffer, size_t __buflen, |
97 | struct group **__restrict __result); | 97 | struct group **__restrict __result); |
98 | 98 | ||
99 | /* Read a group entry from STREAM. This function is not standardized | 99 | /* Read a group entry from STREAM. This function is not standardized |
100 | an probably never will. */ | 100 | an probably never will. */ |
101 | extern int fgetgrent_r(FILE *__restrict __stream, | 101 | extern int fgetgrent_r(FILE *__restrict __stream, |
102 | struct group *__restrict __resultbuf, | 102 | struct group *__restrict __resultbuf, |
103 | char *__restrict __buffer, size_t __buflen, | 103 | char *__restrict __buffer, size_t __buflen, |
104 | struct group **__restrict __result); | 104 | struct group **__restrict __result); |
105 | 105 | ||
106 | /* Store at most *NGROUPS members of the group set for USER into | 106 | /* Store at most *NGROUPS members of the group set for USER into |
107 | *GROUPS. Also include GROUP. The actual number of groups found is | 107 | *GROUPS. Also include GROUP. The actual number of groups found is |
108 | returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */ | 108 | returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */ |
109 | extern int getgrouplist(const char *__user, gid_t __group, | 109 | extern int getgrouplist(const char *__user, gid_t __group, |
110 | gid_t *__groups, int *__ngroups); | 110 | gid_t *__groups, int *__ngroups); |
111 | 111 | ||
112 | /* Initialize the group set for the current user | 112 | /* Initialize the group set for the current user |
113 | by reading the group database and using all groups | 113 | by reading the group database and using all groups |
diff --git a/include/libbb.h b/include/libbb.h index a749c0b92..c5ff51398 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1532,7 +1532,7 @@ struct smaprec { | |||
1532 | procps_read_smaps(pid, total) | 1532 | procps_read_smaps(pid, total) |
1533 | #endif | 1533 | #endif |
1534 | int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total, | 1534 | int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total, |
1535 | void (*cb)(struct smaprec *, void *), void *data); | 1535 | void (*cb)(struct smaprec *, void *), void *data); |
1536 | 1536 | ||
1537 | typedef struct procps_status_t { | 1537 | typedef struct procps_status_t { |
1538 | DIR *dir; | 1538 | DIR *dir; |
@@ -1655,8 +1655,12 @@ typedef struct sha512_ctx_t { | |||
1655 | uint64_t hash[8]; | 1655 | uint64_t hash[8]; |
1656 | uint8_t wbuffer[128]; /* always correctly aligned for uint64_t */ | 1656 | uint8_t wbuffer[128]; /* always correctly aligned for uint64_t */ |
1657 | } sha512_ctx_t; | 1657 | } sha512_ctx_t; |
1658 | typedef struct sha3_ctx_t { | ||
1659 | uint64_t state[25]; | ||
1660 | unsigned bytes_queued; | ||
1661 | } sha3_ctx_t; | ||
1658 | void md5_begin(md5_ctx_t *ctx) FAST_FUNC; | 1662 | void md5_begin(md5_ctx_t *ctx) FAST_FUNC; |
1659 | void md5_hash(md5_ctx_t *ctx, const void *data, size_t length) FAST_FUNC; | 1663 | void md5_hash(md5_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; |
1660 | void md5_end(md5_ctx_t *ctx, void *resbuf) FAST_FUNC; | 1664 | void md5_end(md5_ctx_t *ctx, void *resbuf) FAST_FUNC; |
1661 | void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; | 1665 | void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; |
1662 | #define sha1_hash md5_hash | 1666 | #define sha1_hash md5_hash |
@@ -1667,6 +1671,9 @@ void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; | |||
1667 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; | 1671 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; |
1668 | void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; | 1672 | void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; |
1669 | void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; | 1673 | void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; |
1674 | void sha3_begin(sha3_ctx_t *ctx) FAST_FUNC; | ||
1675 | void sha3_hash(sha3_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; | ||
1676 | void sha3_end(sha3_ctx_t *ctx, void *resbuf) FAST_FUNC; | ||
1670 | 1677 | ||
1671 | extern uint32_t *global_crc32_table; | 1678 | extern uint32_t *global_crc32_table; |
1672 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; | 1679 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; |
diff --git a/include/platform.h b/include/platform.h index 78d42fed9..b3eee55ee 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -222,6 +222,7 @@ | |||
222 | 222 | ||
223 | #include <stdint.h> | 223 | #include <stdint.h> |
224 | typedef int bb__aliased_int FIX_ALIASING; | 224 | typedef int bb__aliased_int FIX_ALIASING; |
225 | typedef long bb__aliased_long FIX_ALIASING; | ||
225 | typedef uint16_t bb__aliased_uint16_t FIX_ALIASING; | 226 | typedef uint16_t bb__aliased_uint16_t FIX_ALIASING; |
226 | typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; | 227 | typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; |
227 | 228 | ||
@@ -229,7 +230,8 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; | |||
229 | * a lvalue. This makes it more likely to not swap them by mistake | 230 | * a lvalue. This makes it more likely to not swap them by mistake |
230 | */ | 231 | */ |
231 | #if defined(i386) || defined(__x86_64__) || defined(__powerpc__) | 232 | #if defined(i386) || defined(__x86_64__) || defined(__powerpc__) |
232 | # define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp)) | 233 | # define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp)) |
234 | # define move_from_unaligned_long(v, longp) ((v) = *(bb__aliased_long*)(longp)) | ||
233 | # define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p)) | 235 | # define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p)) |
234 | # define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p)) | 236 | # define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p)) |
235 | # define move_to_unaligned16(u16p, v) (*(bb__aliased_uint16_t*)(u16p) = (v)) | 237 | # define move_to_unaligned16(u16p, v) (*(bb__aliased_uint16_t*)(u16p) = (v)) |
@@ -238,6 +240,7 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; | |||
238 | #else | 240 | #else |
239 | /* performs reasonably well (gcc usually inlines memcpy here) */ | 241 | /* performs reasonably well (gcc usually inlines memcpy here) */ |
240 | # define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int))) | 242 | # define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int))) |
243 | # define move_from_unaligned_long(v, longp) (memcpy(&(v), (longp), sizeof(long))) | ||
241 | # define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2)) | 244 | # define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2)) |
242 | # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4)) | 245 | # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4)) |
243 | # define move_to_unaligned16(u16p, v) do { \ | 246 | # define move_to_unaligned16(u16p, v) do { \ |
diff --git a/include/pwd_.h b/include/pwd_.h index ea158da45..625b6f5a2 100644 --- a/include/pwd_.h +++ b/include/pwd_.h | |||
@@ -63,7 +63,7 @@ extern struct passwd *fgetpwent(FILE *__stream); | |||
63 | 63 | ||
64 | /* Write the given entry onto the given stream. */ | 64 | /* Write the given entry onto the given stream. */ |
65 | extern int putpwent(const struct passwd *__restrict __p, | 65 | extern int putpwent(const struct passwd *__restrict __p, |
66 | FILE *__restrict __f); | 66 | FILE *__restrict __f); |
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | /* Search for an entry with a matching user ID. */ | 69 | /* Search for an entry with a matching user ID. */ |
@@ -81,25 +81,25 @@ extern struct passwd *getpwnam(const char *__name); | |||
81 | POSIX people would choose. */ | 81 | POSIX people would choose. */ |
82 | 82 | ||
83 | extern int getpwent_r(struct passwd *__restrict __resultbuf, | 83 | extern int getpwent_r(struct passwd *__restrict __resultbuf, |
84 | char *__restrict __buffer, size_t __buflen, | 84 | char *__restrict __buffer, size_t __buflen, |
85 | struct passwd **__restrict __result); | 85 | struct passwd **__restrict __result); |
86 | 86 | ||
87 | extern int getpwuid_r(uid_t __uid, | 87 | extern int getpwuid_r(uid_t __uid, |
88 | struct passwd *__restrict __resultbuf, | 88 | struct passwd *__restrict __resultbuf, |
89 | char *__restrict __buffer, size_t __buflen, | 89 | char *__restrict __buffer, size_t __buflen, |
90 | struct passwd **__restrict __result); | 90 | struct passwd **__restrict __result); |
91 | 91 | ||
92 | extern int getpwnam_r(const char *__restrict __name, | 92 | extern int getpwnam_r(const char *__restrict __name, |
93 | struct passwd *__restrict __resultbuf, | 93 | struct passwd *__restrict __resultbuf, |
94 | char *__restrict __buffer, size_t __buflen, | 94 | char *__restrict __buffer, size_t __buflen, |
95 | struct passwd **__restrict __result); | 95 | struct passwd **__restrict __result); |
96 | 96 | ||
97 | /* Read an entry from STREAM. This function is not standardized and | 97 | /* Read an entry from STREAM. This function is not standardized and |
98 | probably never will. */ | 98 | probably never will. */ |
99 | extern int fgetpwent_r(FILE *__restrict __stream, | 99 | extern int fgetpwent_r(FILE *__restrict __stream, |
100 | struct passwd *__restrict __resultbuf, | 100 | struct passwd *__restrict __resultbuf, |
101 | char *__restrict __buffer, size_t __buflen, | 101 | char *__restrict __buffer, size_t __buflen, |
102 | struct passwd **__restrict __result); | 102 | struct passwd **__restrict __result); |
103 | 103 | ||
104 | POP_SAVED_FUNCTION_VISIBILITY | 104 | POP_SAVED_FUNCTION_VISIBILITY |
105 | 105 | ||
diff --git a/include/shadow_.h b/include/shadow_.h index 648a62ab3..7babe4f30 100644 --- a/include/shadow_.h +++ b/include/shadow_.h | |||
@@ -79,21 +79,21 @@ extern int putspent(const struct spwd *__p, FILE *__stream); | |||
79 | 79 | ||
80 | /* Reentrant versions of some of the functions above */ | 80 | /* Reentrant versions of some of the functions above */ |
81 | extern int getspent_r(struct spwd *__result_buf, char *__buffer, | 81 | extern int getspent_r(struct spwd *__result_buf, char *__buffer, |
82 | size_t __buflen, struct spwd **__result); | 82 | size_t __buflen, struct spwd **__result); |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | extern int getspnam_r(const char *__name, struct spwd *__result_buf, | 85 | extern int getspnam_r(const char *__name, struct spwd *__result_buf, |
86 | char *__buffer, size_t __buflen, | 86 | char *__buffer, size_t __buflen, |
87 | struct spwd **__result); | 87 | struct spwd **__result); |
88 | 88 | ||
89 | #ifdef UNUSED_FOR_NOW | 89 | #ifdef UNUSED_FOR_NOW |
90 | extern int sgetspent_r(const char *__string, struct spwd *__result_buf, | 90 | extern int sgetspent_r(const char *__string, struct spwd *__result_buf, |
91 | char *__buffer, size_t __buflen, | 91 | char *__buffer, size_t __buflen, |
92 | struct spwd **__result); | 92 | struct spwd **__result); |
93 | 93 | ||
94 | extern int fgetspent_r(FILE *__stream, struct spwd *__result_buf, | 94 | extern int fgetspent_r(FILE *__stream, struct spwd *__result_buf, |
95 | char *__buffer, size_t __buflen, | 95 | char *__buffer, size_t __buflen, |
96 | struct spwd **__result); | 96 | struct spwd **__result); |
97 | /* Protect password file against multi writers */ | 97 | /* Protect password file against multi writers */ |
98 | extern int lckpwdf(void); | 98 | extern int lckpwdf(void); |
99 | 99 | ||