History log of /external/iproute2/lib/fs.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
18f156bfecda20166c2fb543ba8c9c6559edef9c 01-Sep-2017 Phil Sutter <phil@nwl.cc> Convert the obvious cases to strlcpy()

This converts the typical idiom of manually terminating the buffer after
a call to strncpy().

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/lib/fs.c
ac3415f5c1b1df2d6a4bf770ad52e2e14c09e58e 24-Aug-2017 Phil Sutter <phil@nwl.cc> lib/fs: Fix and simplify make_path()

Calling stat() before mkdir() is racey: The entry might change in
between. Also, the call to stat() seems to exist only to check if the
directory exists already. So simply call mkdir() unconditionally and
catch only errors other than EEXIST.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/lib/fs.c
eab450789829e33a64dbd08dced3438d580d5179 24-Aug-2017 Phil Sutter <phil@nwl.cc> lib/fs: Fix format string in find_fs_mount()

A field width of 4096 allows fscanf() to store that amount of characters
into the given buffer, though that doesn't include the terminating NULL
byte. Decrease the value by one to leave space for it.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/lib/fs.c
f443565f8df65e7d3b3e7cb5f4e94aec1e12d067 15-Apr-2017 David Ahern <dsa@cumulusnetworks.com> ip vrf: Add command name next to pid

'ip vrf pids' is used to list processes bound to a vrf, but it only
shows the pid leaving a lot of work for the user. Add the command
name to the output. With this patch you get the more user friendly:

$ ip vrf pids mgmt
1121 ntpd
1418 gdm-session-wor
1488 gnome-session
1491 dbus-launch
1492 dbus-daemon
1565 sshd
...

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
/external/iproute2/lib/fs.c
2bbc5b0726611d0faf7895ec01a42286e26c8ca4 06-Jan-2017 David Ahern <dsa@cumulusnetworks.com> ip vrf: Improve cgroup2 error messages

Currently, if a non-root user attempts to run ip vrf exec a non-helpful
error is returned:

$ ip vrf exec mgmt bash
Failed to mount cgroup2. Are CGROUPS enabled in your kernel?

Only show the CGROUPS kernel hint for the ENODEV error and for the
rest show the strerror for the errno. So now:

$ ip/ip vrf exec mgmt bash
Failed to mount cgroup2: Operation not permitted

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
/external/iproute2/lib/fs.c
edbae5e0b21d915015fa87c16690171ca71b79bf 06-Jan-2017 David Ahern <dsa@cumulusnetworks.com> ip vrf: Fix run-on error message on mkdir failure

Andy reported a missing newline if a non-root user attempts to run
'ip vrf exec':

$ ./ip/ip vrf exec default /bin/echo asdf
mkdir failed for /var/run/cgroup2: Permission deniedFailed to setup vrf cgroup2 directory

Reported-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
/external/iproute2/lib/fs.c
1dafceb1c9c6a57506fd4cbf57f721efe59afcda 12-Dec-2016 David Ahern <dsa@cumulusnetworks.com> Add filesystem APIs to lib

Add make_path to recursively call mkdir as needed to create a given
path with the given mode.

Add find_cgroup2_mount to lookup path where cgroup2 is mounted. If it
is not already mounted, cgroup2 is mounted under /var/run/cgroup2 for
use by iproute2.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
/external/iproute2/lib/fs.c