summaryrefslogtreecommitdiffstats
path: root/source3/smbd/message.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-11 23:19:08 +0000
committerJeremy Allison <jra@samba.org>2001-04-11 23:19:08 +0000
commit6578fd874283ee97c2896bcf7257db7f3e37c2ec (patch)
treea5e9ee2ed36b4b0ba1521edbe961f3e2f9026f13 /source3/smbd/message.c
parent0ca9f5c023df2ee498dcd1bdb2f29abc632a5d60 (diff)
downloadsamba-6578fd874283ee97c2896bcf7257db7f3e37c2ec.tar.gz
samba-6578fd874283ee97c2896bcf7257db7f3e37c2ec.tar.xz
samba-6578fd874283ee97c2896bcf7257db7f3e37c2ec.zip
To stop people complaining about the mktemp call, move it into lib/util.c. Thanks
to Andrew for all this code. Fixed extra line in lib/sysacls.c that broke XFS ACL code. Jeremy. (This used to be commit 9b32b8a8cfc8ddb93c14d5581f433d2e93f89ed2)
Diffstat (limited to 'source3/smbd/message.c')
-rw-r--r--source3/smbd/message.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/smbd/message.c b/source3/smbd/message.c
index 21750f9cd4b..9206442b943 100644
--- a/source3/smbd/message.c
+++ b/source3/smbd/message.c
@@ -40,8 +40,7 @@ deliver the message
****************************************************************************/
static void msg_deliver(void)
{
- pstring s;
- fstring name;
+ pstring name;
int i;
int fd;
@@ -53,10 +52,9 @@ static void msg_deliver(void)
}
/* put it in a temporary file */
- slprintf(s,sizeof(s)-1, "%s/msg.XXXXXX",tmpdir());
- fstrcpy(name,(char *)smbd_mktemp(s));
+ slprintf(name,sizeof(name)-1, "%s/msg.XXXXXX",tmpdir());
+ fd = smb_mkstemp(name);
- fd = sys_open(name,O_WRONLY|O_CREAT|O_TRUNC|O_EXCL,0600);
if (fd == -1) {
DEBUG(1,("can't open message file %s\n",name));
return;
@@ -86,12 +84,13 @@ static void msg_deliver(void)
{
fstring alpha_msgfrom;
fstring alpha_msgto;
+ pstring s;
pstrcpy(s,lp_msg_command());
- pstring_sub(s,"%s",name);
pstring_sub(s,"%f",alpha_strcpy(alpha_msgfrom,msgfrom,sizeof(alpha_msgfrom)));
pstring_sub(s,"%t",alpha_strcpy(alpha_msgto,msgto,sizeof(alpha_msgto)));
standard_sub_basic(s);
+ pstring_sub(s,"%s",name);
smbrun(s,NULL,False);
}