Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
3b7230a7
...
3b7230a743955067922648877a580ccdcab1a47a
authored
2002-12-05 12:48:05 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Do not use asprintf.
1 parent
9aeadd10
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
examples/mta.c
examples/mta.c
View file @
3b7230a
...
...
@@ -50,7 +50,9 @@
#endif
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#ifdef HAVE_GETOPT_H
# include <getopt.h>
#endif
#include <string.h>
#include <pwd.h>
#include <sys/stat.h>
...
...
@@ -336,6 +338,8 @@ mta_send (message_t msg)
return
0
;
}
#define SENDER_WARNING "set sender using -f flag"
int
message_finalize
(
message_t
msg
,
int
warn
)
{
...
...
@@ -347,9 +351,15 @@ message_finalize (message_t msg, int warn)
if
(
warn
&&
from_person
)
{
char
*
warn
=
NULL
;
struct
passwd
*
pwd
=
getpwuid
(
getuid
());
asprintf
(
&
warn
,
"%s set sender using -f flag"
,
pwd
->
pw_name
);
char
*
warn
=
malloc
(
strlen
(
pwd
->
pw_name
)
+
1
+
sizeof
(
SENDER_WARNING
));
if
(
warn
==
NULL
)
{
mu_error
(
"%s: not enough memory"
,
progname
);
return
1
;
}
sprintf
(
warn
,
"%s %s"
,
pwd
->
pw_name
,
SENDER_WARNING
);
header_set_value
(
header
,
"X-Authentication-Warning"
,
warn
,
0
);
free
(
warn
);
}
...
...
Please
register
or
sign in
to post a comment