ObjFW  Check-in [5b5f4ec214]

Overview
Comment:OFZIP: Only allow safe modes for .gz files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5b5f4ec21406e9526724ec362a9c3eeb2c56fe2ebc39e22a824e48591d51c309
User & Date: js on 2016-05-22 20:00:42
Other Links: manifest | tags
Context
2016-05-22
20:06
OFZIP: Fix a missing retain check-in: 58952fef39 user: js tags: trunk
20:00
OFZIP: Only allow safe modes for .gz files check-in: 5b5f4ec214 user: js tags: trunk
19:53
Add OFTarArchive check-in: 7ecdc71677 user: js tags: trunk
Changes

Modified utils/ofzip/GZIPArchive.m from [1fc9513872] to [bc8629617c].

26
27
28
29
30
31
32
33
34


35
36
37
38
39
40
41
42
static OFZIP *app;

static void
setPermissions(OFString *destination, OFString *source)
{
#ifdef OF_HAVE_CHMOD
	OFFileManager *fileManager = [OFFileManager defaultManager];
	mode_t mode;



	mode = [fileManager permissionsOfItemAtPath: source];
	[fileManager changePermissionsOfItemAtPath: destination
				       permissions: mode];
#endif
}

@implementation GZIPArchive
+ (void)initialize







|

>
>
|







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
static OFZIP *app;

static void
setPermissions(OFString *destination, OFString *source)
{
#ifdef OF_HAVE_CHMOD
	OFFileManager *fileManager = [OFFileManager defaultManager];
	mode_t mode = [fileManager permissionsOfItemAtPath: source];

	/* Only allow modes that are safe */
	mode &= (S_IRWXU | S_IRWXG | S_IRWXO);

	[fileManager changePermissionsOfItemAtPath: destination
				       permissions: mode];
#endif
}

@implementation GZIPArchive
+ (void)initialize