]> git.ipfire.org Git - thirdparty/systemd.git/commit
btrfs-util: be more careful when invoking btrfs file system ioctls
authorLennart Poettering <lennart@poettering.net>
Wed, 22 Apr 2015 11:11:19 +0000 (13:11 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 22 Apr 2015 11:27:53 +0000 (13:27 +0200)
commit625728941d02d0556856d7ef92979f1a6f5edbf3
treee77075d1a4e99c2cd91da445fdda742ccbe213c3
parent21222ea5cdec65fa30a75bd5a78475459075b946
btrfs-util: be more careful when invoking btrfs file system ioctls

If we get passed an fd that does not refer to a regular file or
directory, we should not issue btrfs ioctls on it, since it might end up
in a device driver or similar (note that DRM for example uses the same
ioctl numbers as some file system ioctls).

Hence, let's make sure to always check if something is a regular file or
directory, or is on btrfs before invoking the respective ioctls. It's
better to be safe than sorry.
src/shared/btrfs-util.c