ObjFW  Check-in [0fe644ef2c]

Overview
Comment:OFFileManager: Fix getting non-existent xattr
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0fe644ef2ce0806c47935504d2afbb2d0e5240b2807dd248031d8b2c46f073a8
User & Date: js on 2024-03-17 09:41:31
Other Links: manifest | tags
Context
2024-03-29
13:59
OFFileManager: Fix getting non-existent xattr check-in: 23cee06a0e user: js tags: 1.0
2024-03-17
09:41
OFFileManagerTests: Add tests for xattr check-in: 23b9666b71 user: js tags: trunk
09:41
OFFileManager: Fix getting non-existent xattr check-in: 0fe644ef2c user: js tags: trunk
08:56
OFFileManagerTests: Add more tests check-in: 150b8f07af user: js tags: trunk
Changes

Modified src/OFFileIRIHandler.m from [75eba519f2] to [029e0b431e].

1596
1597
1598
1599
1600
1601
1602
1603

1604
1605






1606
1607
1608
1609
1610
1611
1612
1596
1597
1598
1599
1600
1601
1602

1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618







-
+


+
+
+
+
+
+







	const char *cPath = [path cStringWithEncoding: encoding];
	const char *cName = [name cStringWithEncoding: encoding];
# if defined(OF_LINUX)
	ssize_t size = lgetxattr(cPath, cName, NULL, 0);
# elif defined(OF_MACOS)
	ssize_t size = getxattr(cPath, cName, NULL, 0, 0, XATTR_NOFOLLOW);
# endif
	void *value = OFAllocMemory(1, size);
	void *value;
	OFData *data;

	if (size < 0)
		@throw [OFGetItemAttributesFailedException
		    exceptionWithIRI: IRI
			       errNo: errno];

	value = OFAllocMemory(1, size);
	@try {
# if defined(OF_LINUX)
		if ((size = lgetxattr(cPath, cName, value, size)) < 0)
# elif defined(OF_MACOS)
		if ((size = getxattr(cPath, cName, value, size, 0,
		    XATTR_NOFOLLOW)) < 0)
# endif