Stéphane Graber
6ae86a9c17
src: Don't use ifdef/defined for config.h
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 00:47:05 -04:00
Stéphane Graber
7eac83c1b1
meson: Fix mntent include condition
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:26:47 -04:00
Stéphane Graber
199241209f
meson: Add missing prlimit include
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:13 -04:00
Stéphane Graber
eba7f7a6bc
meson: Rework configuration variables
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-02 16:50:00 -04:00
Stéphane Graber
20b03401be
meson: Cleanup build configs
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-04-28 22:17:01 -04:00
Christian Brauner
db4af8c57e
build: improve meson build
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-23 14:05:24 +02:00
Christian Brauner
ce88b6df3a
build: split netns_ifaddrs into separate sources
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-16 15:56:53 +02:00
Christian Brauner
4ad3a929d9
build: remove unneeded variables
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:09:45 +02:00
Christian Brauner
9b9d56e6e8
build: add meson skeleton
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 19:06:09 +02:00
Christian Brauner
360df02a57
lxcmntent: fix fallthrough
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
49bdee73fc
netns_ifaddrs: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
2d7f5dcd9a
include: make all functions __hidden
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-02 15:57:05 +02:00
Christian Brauner
535bc5aac2
strchrnul: include header
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-22 09:44:07 +02:00
Christian Brauner
10bf1adb43
strchrnul: fix copy-paste braino
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-23 11:34:57 +01:00
Christian Brauner
09c3ee1390
strchrnul: ignore increased required alignment warning
...
Fixes: https://jenkins.linuxcontainers.org/view/LXC/job/lxc-build-android/7949/console
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-22 10:10:36 +01:00
Christian Brauner
5582dd63c3
include: fix typo
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-21 10:08:15 +01:00
Christian Brauner
88cf3229fe
string_utils: provide a version of strchrnul() in case it's not available
...
This should only happen on Android.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-20 12:34:36 +01:00
Christian Brauner
7fc77b1ae0
bpf: vendor bpf headers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 12:34:51 +01:00
Christian Brauner
c4ef8f4c11
tree-wide: use call_cleaner(netns_freeifaddrs)
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 12:00:01 +01:00
Christian Brauner
59eac805a3
tree-wide: hide further unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 15:44:43 +02:00
Christian Brauner
35eb5cdcb3
openpty: improve implementation and handling of platforms without it
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-06 10:57:47 +02:00
Christian Brauner
0a8409df6d
openpty: fix faulty rename
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-05 23:45:38 +02:00
Christian Brauner
41808e20a1
tree-wide: s/pts/pty/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-05 22:01:57 +02:00
Christian Brauner
36a94ce8e3
tree-wide: s/ptmx/ptx/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-05 22:01:57 +02:00
Christian Brauner
a143f4a563
openpty: adapt variable naming
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-20 00:03:29 +02:00
Christian Brauner
b164903bcd
bionic: s/lxc_raw_execveat()/execveat()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-18 20:02:37 +02:00
Christian Brauner
f40988c773
process_utils: introduce new process_utils.{c,h}
...
This will be the central place for all process management helpers. This also
removes raw_syscalls.{c,h}.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 12:32:28 +02:00
Christian Brauner
a08bfbe340
tree-wide: harden mount option parsing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-26 15:31:57 +01:00
Christian Brauner
c8ca5a435c
netns_getifaddrs: adapt to kernel changes
...
s/NETLINK_DUMP_STRICT_CHK/NETLINK_GET_STRICT_CHK/g
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-04-19 15:24:51 +02:00
Ondrej Kubik
dbcbf27055
Fix android compilation
...
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-03-01 23:19:29 +00:00
Christian Brauner
9d361e0fd4
include: add fexecve() for Android's Bionic
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-11 16:16:10 +01:00
Christian Brauner
57668944d4
lxcmntent: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:56 +01:00
Christian Brauner
acad8485a0
prlimit: remove deprecated and unneeded header
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-01-27 23:05:47 +01:00
Ondrej Kubik
60018868a3
Fixing compile error when compiling for android
...
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-01-08 17:00:36 +00:00
Christian Brauner
a9b8dbfa95
include: correctly include macro.h
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-11-02 23:20:46 +01:00
2xsec
5f76b90f47
lxcmntent: coding rules
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-11-02 15:17:14 +09:00
Christian Brauner
7d60776a32
coverity: #1440389
...
Logically dead code
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-10-22 16:48:37 +02:00
Christian Brauner
27bd77920d
include: simplify strlcpy()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-10-18 12:50:13 +02:00
Christian Brauner
c6b647205d
netns_ifaddrs: check for NETLINK_DUMP_STRICT_CHK
...
Make use of the new socket option, NETLINK_DUMP_STRICT_CHK, that
userspace can use via setsockopt to request strict checking of headers
and attributes on dump requests.
To get dump features such as kernel side filtering based on data in
the header or attributes appended to the dump request, userspace
must call setsockopt() for NETLINK_DUMP_STRICT_CHK and a non-zero
value. This is necessary to make use of the IFA_TARGET_NETNSID property.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-10-08 21:13:44 +02:00
2xsec
c3d9796f1f
netns_iaddrs: remove unused functions
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-10-02 18:55:33 +09:00
Christian Brauner
3ccf815f79
netns_ifaddrs: only use struct rtnl_link_stats64
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-30 20:58:06 +02:00
Christian Brauner
da5efb6f76
netns_ifaddrs: handle IFLA_STATS{64} correctly
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-30 12:29:19 +02:00
Christian Brauner
a3aba11021
netns_ifaddrs: fix missing include
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-26 18:14:46 +02:00
Christian Brauner
d3d5554a97
netns_ifaddrs: mark casts as safe
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-23 21:19:35 +02:00
Christian Brauner
cc6119a033
network: add netns_getifaddrs() implementation
...
This commit introduces my concept of a network namespace aware
getifaddrs(), i.e. netns_getifaddrs(). This presupposes a kernel that
carries my IF{L}A_TARGET_NETNSID patches:
struct netns_ifaddrs {
struct netns_ifaddrs *ifa_next;
/* Can - but shouldn't be - NULL. */
char *ifa_name;
/* This field is not present struct ifaddrs. */
int ifa_ifindex;
unsigned ifa_flags;
/* This field is not present struct ifaddrs. */
int ifa_mtu;
/* This field is not present struct ifaddrs. */
int ifa_prefixlen;
struct sockaddr *ifa_addr;
struct sockaddr *ifa_netmask;
union {
struct sockaddr *ifu_broadaddr;
struct sockaddr *ifu_dstaddr;
} ifa_ifu;
/* If you don't know what this is for don't touch it. */
void *ifa_data;
};
which is a superset of struct ifaddrs. It contains additional
information such as the mtu, ifindex of the interface and the prefix
length of the address.
Note that the field ordering is different. So don't get any ideas of
using memcpy() to copy from an old struct ifaddrs into a struct
netns_ifaddrs.
int netns_getifaddrs(struct netns_ifaddrs **ifap, __s32 netns_id, bool *netnsid_aware)
takes a network namespace identifier as argument which identifies the
target network namespace.
If successfull, i.e. netns_getifaddrs() returns 0, callers should check
the bool *netnsid_aware return argument. If it is true then
RTM_GET{ADDR,LINK} requests are fully netnsid aware. If it is false then
they are not and the information returned in struct netns_ifaddrs does
*not* contain correct information about the target network namespace
identified by netnsid.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-23 21:19:35 +02:00
Christian Brauner
6ce39620fd
autotools: support -Wcast-align
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-23 20:22:41 +02:00
Christian Brauner
59e9eabe0d
ifaddrs: add safe implementation of getifaddrs()
...
The old version was crazy. This replaces it with an internal version based on
musl.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-23 14:06:54 +02:00
Christian Brauner
dd94de5a87
include: remove VLAs
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-07-26 16:38:42 +02:00
Christian Brauner
9a5e7ac4a9
include: add strlcat() implementation
...
CC: Donghwa Jeong <dh48.jeong@samsung.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-06-20 13:44:02 +02:00
Christian Brauner
477e62b618
include: add getgrgid_r()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-06-15 11:39:23 +02:00