ObjFW  Diff

Differences From Artifact [b72f242916]:

  • File utils/ofzip/GZIPArchive.m — part of check-in [4af49a13c3] at 2017-05-07 20:10:13 on branch trunk — Small code style change Casts are now written like types in variable declarations. (user: js size: 3585)

To Artifact [623af154e4]:

  • File utils/ofzip/GZIPArchive.m — part of check-in [4175b93242] at 2017-06-03 14:37:19 on branch trunk — OFFileManager: Mask modes to ensure safe modes (user: js size: 3508)

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







|
<
<
<







27
28
29
30
31
32
33
34



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

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




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

@implementation GZIPArchive