-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
maildir overhaul #4112
base: main
Are you sure you want to change the base?
maildir overhaul #4112
Conversation
ac8a18d
to
f8ebfa8
Compare
f8ebfa8
to
3cb5044
Compare
3cb5044
to
d18dce7
Compare
d18dce7
to
96e7a4e
Compare
if (merge_flags2(e, flags, custom)) | ||
{ | ||
// need to hcache_store() | ||
} |
Check notice
Code scanning / CodeQL
Futile conditional Note
if (rc != MX_OPEN_OK) | ||
goto done; | ||
|
||
// maildir_parse_all_flags(&ea, &ea_cha); |
Check notice
Code scanning / CodeQL
Commented-out code Note
// dump_filenames(&fa_sca, "Scanned"); | ||
// dump_filenames(&fa_cha, "Changed"); |
Check notice
Code scanning / CodeQL
Commented-out code Note
struct EmailArray ea_cha = ARRAY_HEAD_INITIALIZER; ///< Emails: changed | ||
struct EmailArray ea_del = ARRAY_HEAD_INITIALIZER; ///< Emails: deleted | ||
const char *path = mailbox_path(m); | ||
// struct MaildirMboxData *mdata = maildir_mdata_get(m); |
Check notice
Code scanning / CodeQL
Commented-out code Note
if (rc != MX_OPEN_OK) | ||
goto done; | ||
|
||
// maildir_parse_all_flags(&ea, &ea_cha); |
Check notice
Code scanning / CodeQL
Commented-out code Note
m->msg_count++; | ||
} | ||
|
||
// ARRAY_FREE(ea); |
Check notice
Code scanning / CodeQL
Commented-out code Note
size_t nlen = 0; | ||
|
||
if (start > 0) | ||
nlen += sprintf(name + nlen, "%.*s", start, filename); |
Check failure
Code scanning / CodeQL
Unbounded write Critical
string read by fread
This 'call to sprintf' with input from
string read by fread
This 'call to sprintf' with input from
string read by fgets
This 'call to sprintf' with input from
string read by fgets
if (start > 0) | ||
nlen += sprintf(name + nlen, "%.*s", start, filename); | ||
|
||
nlen += sprintf(name + nlen, "\033[1;4;33m%.*s\033[0m", length, filename + start); |
Check failure
Code scanning / CodeQL
Unbounded write Critical
string read by fread
This 'call to sprintf' with input from
string read by fread
This 'call to sprintf' with input from
string read by fgets
This 'call to sprintf' with input from
string read by fgets
nlen += sprintf(name + nlen, "\033[1;4;33m%.*s\033[0m", length, filename + start); | ||
|
||
if (filename[start + length] != '\0') | ||
nlen += sprintf(name + nlen, "%s", filename + start + length); |
Check failure
Code scanning / CodeQL
Unbounded write Critical
string read by fread
This 'call to sprintf' with input from
string read by fread
This 'call to sprintf' with input from
string read by fgets
This 'call to sprintf' with input from
string read by fgets
buf_concat_path(path_file, mbox_path, fn->sub_name); | ||
|
||
struct Email *e = maildir_email_new(); | ||
if (maildir_parse_message(buf_string(path_file), fn->is_cur, e)) |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user input (string read by fread)
This argument to a file access function is derived from
user input (string read by fread)
This argument to a file access function is derived from
user input (string read by fread)
This argument to a file access function is derived from
user input (string read by fread)
This argument to a file access function is derived from
user input (string read by fgets)
This argument to a file access function is derived from
user input (string read by fgets)
This argument to a file access function is derived from
user input (string read by fgets)
This argument to a file access function is derived from
user input (string read by fgets)
f959a81
to
b2bcbbc
Compare
15d05aa
to
b811d42
Compare
c039915
to
1dbca90
Compare
Early WIP
The Maildir backend needs an overhaul.
In particular, I need it to send notifications of the specific changes to
Mailbox.emails[]
.So far, this PR only tackles
mbox_open()
-- the easy bit.Current
maildir_mbox_open()
The functions mix up Maildir and Hcache code.
Note: The functions'
maildir_
prefix has been omitted for clarity.source: gv svg
New
maildir_mbox_open()
Maildir (yellow) and Hcache (blue) are separate.
The red dot denotes functions that can be interrupted by Ctrl-C (
SIGINT
) -- new feature!source: gv svg