summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-05-25 12:33:42 +0100
committerJaroslav Kysela <perex@perex.cz>2022-06-05 10:24:26 +0200
commit87ff5318e327eb2343f10bd73dce5a32f12db622 (patch)
tree3bcb7b60495e706db00abeb04ca8f914aa369a09
parentd836146e919d5444cc43ac5dbf65b50d16f511dd (diff)
downloadalsa-lib-87ff5318e327eb2343f10bd73dce5a32f12db622.tar.gz
conf: Use ino64_t to save and compare inode numbers
On 32-bit platforms when not using the large-file-support ABI, struct stat64 contains ino64_t which is 64-bit, while ino_t is only 32-bit. snd_config_update_r() checks whether a file has been replaced by saving the ino member of a struct stat64 and comparing it with a previously-saved inode number. On 32-bit platforms, assigning the 64-bit member of struct stat64 to a 32-bit member of struct finfo will truncate it modulo 1<<32, which could conceivably result in libasound not reloading configuration when it should (although the inode number space is large enough to make this failure mode highly unlikely). Fixes: https://github.com/alsa-project/alsa-lib/pull/231 Signed-off-by: Simon McVittie <smcv@collabora.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--include/local.h1
-rw-r--r--src/conf.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/include/local.h b/include/local.h
index 51fa4063..268a9ff1 100644
--- a/include/local.h
+++ b/include/local.h
@@ -84,6 +84,7 @@
#define scandir64 scandir
#define versionsort64 versionsort
#define alphasort64 alphasort
+#define ino64_t ino_t
#endif
#define _snd_config_iterator list_head
diff --git a/src/conf.c b/src/conf.c
index 3d2b4a5b..a996e5f9 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -3921,7 +3921,7 @@ snd_config_t *snd_config = NULL;
struct finfo {
char *name;
dev_t dev;
- ino_t ino;
+ ino64_t ino;
time_t mtime;
};