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
206c4704
...
206c470477c8c28b2a253e3d6f18c24ebeba47e6
authored
2002-01-17 22:32:42 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Removed util_tempfile().
1 parent
26adedc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
94 deletions
guimb/util.c
mail/util.c
guimb/util.c
View file @
206c470
...
...
@@ -29,53 +29,6 @@ util_error (char *fmt, ...)
va_end
(
ap
);
}
int
util_tempfile
(
char
**
namep
)
{
char
*
filename
;
char
*
tmpdir
;
int
fd
;
/* We have to be extra careful about opening temporary files, since we
may be running with extra privilege i.e setgid(). */
tmpdir
=
(
getenv
(
"TMPDIR"
))
?
getenv
(
"TMPDIR"
)
:
"/tmp"
;
filename
=
malloc
(
strlen
(
tmpdir
)
+
/*'/' */
1
+
/* "muXXXXXX" */
8
+
1
);
if
(
!
filename
)
return
-
1
;
sprintf
(
filename
,
"%s/muXXXXXX"
,
tmpdir
);
#ifdef HAVE_MKSTEMP
{
int
save_mask
=
umask
(
077
);
fd
=
mkstemp
(
filename
);
umask
(
save_mask
);
}
#else
if
(
mktemp
(
filename
))
fd
=
open
(
filename
,
O_CREAT
|
O_EXCL
|
O_RDWR
,
0600
);
else
fd
=
-
1
;
#endif
if
(
fd
==
-
1
)
{
util_error
(
"Can not open temporary file: %s"
,
strerror
(
errno
));
free
(
filename
);
return
-
1
;
}
if
(
namep
)
*
namep
=
filename
;
else
{
unlink
(
filename
);
free
(
filename
);
}
return
fd
;
}
char
*
util_get_sender
(
int
msgno
)
{
...
...
mail/util.c
View file @
206c470
...
...
@@ -824,53 +824,6 @@ util_help (const struct mail_command_entry *table, char *word)
return
1
;
}
int
util_tempfile
(
char
**
namep
)
{
char
*
filename
;
const
char
*
tmpdir
;
int
fd
;
/* We have to be extra careful about opening temporary files, since we
may be running with extra privilege i.e setgid(). */
tmpdir
=
(
getenv
(
"TMPDIR"
))
?
getenv
(
"TMPDIR"
)
:
"/tmp"
;
filename
=
malloc
(
strlen
(
tmpdir
)
+
/*'/'*/
1
+
/* "muXXXXXX" */
8
+
1
);
if
(
!
filename
)
return
-
1
;
sprintf
(
filename
,
"%s/muXXXXXX"
,
tmpdir
);
#ifdef HAVE_MKSTEMP
{
int
save_mask
=
umask
(
077
);
fd
=
mkstemp
(
filename
);
umask
(
save_mask
);
}
#else
if
(
mktemp
(
filename
))
fd
=
open
(
filename
,
O_CREAT
|
O_EXCL
|
O_RDWR
,
0600
);
else
fd
=
-
1
;
#endif
if
(
fd
==
-
1
)
{
util_error
(
"Can not open temporary file: %s"
,
strerror
(
errno
));
free
(
filename
);
return
-
1
;
}
if
(
namep
)
*
namep
=
filename
;
else
{
unlink
(
filename
);
free
(
filename
);
}
return
fd
;
}
static
int
util_descend_subparts
(
message_t
mesg
,
msgset_t
*
msgset
,
message_t
*
part
)
{
...
...
Please
register
or
sign in
to post a comment