user:sachy:lakatux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
user:sachy:lakatux [2023/03/23 17:03] – sachy | user:sachy:lakatux [2023/09/10 09:16] (current) – novy patch sachy | ||
---|---|---|---|
Line 209: | Line 209: | ||
<code diff mutt_save_file_perm.patch> | <code diff mutt_save_file_perm.patch> | ||
- | --- PATCHES~ | + | diff -Naru /s/mutt-2.2.12/ |
- | +++ PATCHES | + | --- / |
- | @@ -1,0 +1 @@ | + | +++ ./ |
- | +patch.1.14.6.ms.sfp.1 | + | @@ -250,6 +250,8 @@ |
- | diff /s/mutt-1.14.6/globals.h ./globals.h | + | WHERE short ScoreThresholdRead; |
- | 234a235 | + | WHERE short ScoreThresholdFlag; |
- | > WHERE short SaveFilePerm; | + | |
- | diff /s/mutt-1.14.6/init.h ./init.h | + | +WHERE short SaveFilePerm; |
- | 3138a3139,3143 | + | + |
- | > { " | + | # |
- | > /* | + | WHERE short SidebarWidth; |
- | > ** This variable controls the permissions of saved attachments. | + | WHERE LIST *SidebarWhitelist; |
- | > ** Use standard POSIX permissions in octal notation, i.e. 0644. | + | diff -Naru /s/mutt-2.2.12/init.h ./init.h |
- | > */ | + | --- /s/mutt-2.2.12/init.h 2023-09-01 08: |
- | diff /s/mutt-1.14.6/main.c ./main.c | + | +++ ./init.h 2023-09-10 10: |
- | 669c669,672 | + | @@ -3460,6 +3460,11 @@ |
- | < umask (077); | + | ** \fBNote:\fP This only applies to mbox and MMDF folders, Mutt does not |
- | --- | + | ** delete MH and Maildir directories. |
- | > if(SaveFilePerm==600) | + | */ |
- | > umask (077); | + | + |
- | > else | + | + |
- | > umask (000); | + | + |
- | diff /s/mutt-1.14.6/muttlib.c ./ | + | + |
- | 2498a2499,2514 | + | + |
- | > /* Convert file permission from decadic to octal */ | + | { " |
- | > unsigned short own=0; | + | /* |
- | > unsigned short grp=0; | + | ** .pp |
- | > unsigned short oth=0; | + | diff -Naru /s/mutt-2.2.12/main.c ./main.c |
- | > unsigned short SFPoct=0; | + | --- / |
- | > own=SaveFilePerm/ | + | +++ ./ |
- | > grp=(SaveFilePerm-own*100)/ | + | @@ -690,7 +690,10 @@ |
- | > oth=SaveFilePerm-(own*100)-(grp*10); | + | mutt_error = mutt_nocurses_error; |
- | > if(own> | + | |
- | > { | + | SRAND (time (NULL)); |
- | > SFPoct=0600; | + | - |
- | > dprint(1, | + | + |
- | > } | + | + |
- | > else | + | + |
- | > SFPoct=own<< | + | + |
- | > | + | |
- | 2510c2526 | + | |
- | < if ((fd = open (mutt_b2s (safe_file), | + | |
- | --- | + | diff -Naru /s/mutt-2.2.12/muttlib.c ./ |
- | > if ((fd = open (mutt_b2s (safe_file), | + | --- / |
- | 2525c2541 | + | +++ ./ |
- | < if ((fd = open (path, flags & ~O_EXCL, 0600)) < 0) | + | @@ -2562,6 +2562,22 @@ |
- | --- | + | BUFFER *safe_file = NULL; |
- | > if ((fd = open (path, flags & ~O_EXCL, SFPoct)) < 0) | + | |
+ | |||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | if (flags & O_EXCL) | ||
+ | { | ||
+ | safe_file = mutt_buffer_pool_get (); | ||
+ | @@ -2573,7 +2589,7 @@ | ||
+ | goto cleanup; | ||
+ | } | ||
+ | |||
+ | - | ||
+ | + | ||
+ | { | ||
+ | rmdir (mutt_b2s (safe_dir)); | ||
+ | goto cleanup; | ||
+ | @@ -2588,7 +2604,7 @@ | ||
+ | } | ||
+ | } | ||
+ | |||
+ | - | ||
+ | + | ||
+ | goto cleanup; | ||
+ | |||
+ | /* make sure the file is not symlink */ | ||
</ | </ | ||
user/sachy/lakatux.1679590982.txt.gz · Last modified: 2023/03/23 17:03 by sachy