]>
Commit | Line | Data |
---|---|---|
8dc5e023 JR |
1 | --- rpm-5.4.15/rpmio/iosm.c~ 2014-06-11 19:58:04.000000000 +0200 |
2 | +++ rpm-5.4.15/rpmio/iosm.c 2015-01-25 21:53:27.659197235 +0100 | |
3 | @@ -2627,7 +2627,7 @@ | |
4 | iosm->rfd = NULL; | |
5 | break; | |
6 | case IOSM_WOPEN: | |
7 | - iosm->wfd = Fopen(iosm->path, "w.fdio"); | |
8 | + iosm->wfd = Fopen(iosm->path, "wU.fdio"); | |
9 | if (iosm->wfd == NULL || Ferror(iosm->wfd)) { | |
10 | if (iosm->wfd != NULL) (void) iosmNext(iosm, IOSM_WCLOSE); | |
11 | iosm->wfd = NULL; | |
12 | --- rpm-5.4.15/rpmio/rpmio.c~ 2014-08-05 00:47:16.000000000 +0200 | |
13 | +++ rpm-5.4.15/rpmio/rpmio.c 2015-01-25 21:50:59.409202466 +0100 | |
14 | @@ -2638,16 +2638,20 @@ | |
15 | * - bzopen: 'q' sets verbosity to 0 | |
16 | * - bzopen: 'v' does verbosity++ (up to 4) | |
17 | * - HACK: '.' terminates, rest is type of I/O | |
18 | + * - 'U' sets *mode to zero (no permissions) instead of 0666 | |
19 | */ | |
20 | static inline void cvtfmode (const char *m, | |
21 | /*@out@*/ char *stdio, size_t nstdio, | |
22 | /*@out@*/ char *other, size_t nother, | |
23 | - /*@out@*/ const char **end, /*@out@*/ int * f) | |
24 | + /*@out@*/ const char **end, /*@out@*/ int * f, mode_t *mode) | |
25 | /*@modifies *stdio, *other, *end, *f @*/ | |
26 | { | |
27 | int flags = 0; | |
28 | char c; | |
29 | ||
30 | + if (mode) | |
31 | + *mode = 0666; | |
32 | + | |
33 | switch (*m) { | |
34 | case 'a': | |
35 | flags |= O_WRONLY | O_CREAT | O_APPEND; | |
36 | @@ -2661,6 +2665,9 @@ | |
37 | flags |= O_RDONLY; | |
38 | if (--nstdio > 0) *stdio++ = *m; | |
39 | break; | |
40 | + case 'U': | |
41 | + if (mode) *mode = 0; | |
42 | + break; | |
43 | default: | |
44 | *stdio = '\0'; | |
45 | return; | |
46 | @@ -2729,7 +2736,7 @@ | |
47 | if (fmode == NULL) | |
48 | return NULL; | |
49 | ||
50 | - cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL); | |
51 | + cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL, NULL); | |
52 | if (stdio[0] == '\0') | |
53 | return NULL; | |
54 | zstdio[0] = '\0'; | |
55 | @@ -2835,7 +2842,7 @@ | |
56 | const char * fmode = NULL; | |
57 | char stdio[20], other[20]; | |
58 | const char *end = NULL; | |
59 | - mode_t perms = 0666; | |
60 | + mode_t perms; | |
61 | int flags = 0; | |
62 | FD_t fd = NULL; | |
63 | ||
64 | @@ -2849,7 +2856,7 @@ | |
65 | fprintf(stderr, "==> Fopen(%s, %s)\n", path, fmode); | |
66 | ||
67 | stdio[0] = '\0'; | |
68 | - cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags); | |
69 | + cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags, &perms); | |
70 | if (stdio[0] == '\0') | |
71 | goto exit; | |
72 |