fileio: teach read_full_file_full() to read from offset/with maximum size
This commit is contained in:
@@ -986,7 +986,7 @@ static int macsec_read_key_file(NetDev *netdev, SecurityAssociation *sa) {
|
||||
(void) warn_file_is_world_accessible(sa->key_file, NULL, NULL, 0);
|
||||
|
||||
r = read_full_file_full(
|
||||
AT_FDCWD, sa->key_file,
|
||||
AT_FDCWD, sa->key_file, UINT64_MAX, SIZE_MAX,
|
||||
READ_FULL_FILE_SECURE | READ_FULL_FILE_UNHEX | READ_FULL_FILE_WARN_WORLD_READABLE | READ_FULL_FILE_CONNECT_SOCKET,
|
||||
NULL, (char **) &key, &key_len);
|
||||
if (r < 0)
|
||||
|
||||
@@ -869,7 +869,7 @@ static int wireguard_read_key_file(const char *filename, uint8_t dest[static WG_
|
||||
(void) warn_file_is_world_accessible(filename, NULL, NULL, 0);
|
||||
|
||||
r = read_full_file_full(
|
||||
AT_FDCWD, filename,
|
||||
AT_FDCWD, filename, UINT64_MAX, SIZE_MAX,
|
||||
READ_FULL_FILE_SECURE | READ_FULL_FILE_UNBASE64 | READ_FULL_FILE_WARN_WORLD_READABLE | READ_FULL_FILE_CONNECT_SOCKET,
|
||||
NULL, &key, &key_len);
|
||||
if (r < 0)
|
||||
|
||||
Reference in New Issue
Block a user