]> git.proxmox.com Git - mirror_lxcfs.git/commit - src/lxcfs.c
lxcfs: handle NULL path in lxcfs_releasedir/lxcfs_release
authorMatthew Ife <matthewi@mustardsystems.com>
Wed, 11 Jan 2023 14:30:06 +0000 (14:30 +0000)
committerMatthew Ife <matthewi@mustardsystems.com>
Thu, 12 Jan 2023 16:10:39 +0000 (16:10 +0000)
commitcf02ccbe36391a04435633a7e3e8d10811971ca9
treed3cde160232b59d914719783b0be4d05cce460e6
parent63c9b1d5121a0e07477b49187b64469e996fbc60
lxcfs: handle NULL path in lxcfs_releasedir/lxcfs_release

Implement a file_info_type function.
Create a series of defines for the file type

Inspect the file type for each file handler and perform the relevant
release code to free any memory.

If the type cannot be determined, print an error and return -EINVAL.

This should also be slightly faster than a strcmp() but its not likely
that measurable.

This code could be used elsewhere in the process to reduce the strcmp
requirements, but for now just handle the release/releasedir case.

This fixes SEGV in lxcfs_relase/releasedir when path=NULL but invoked a
strcmp().

Signed-off-by: Matthew Ife <matthewi@mustardsystems.com>
src/bindings.h
src/lxcfs.c