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
aabcab59
...
aabcab593f3cead42f4d6a9d113bb9c6245780d7
authored
2003-09-05 11:42:28 +0000
by
Wojciech Polak
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Moved stat() (checking the file permissions) to wicket_create().
1 parent
d10f29bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
mailbox/wicket.c
mailbox/wicket.c
View file @
aabcab5
...
...
@@ -52,9 +52,19 @@ static int get_user __P ((url_t, const char *, char **));
int
wicket_create
(
wicket_t
*
pwicket
,
const
char
*
filename
)
{
struct
stat
st
;
if
(
pwicket
==
NULL
)
return
EINVAL
;
if
(
filename
)
{
if
(
stat
(
filename
,
&
st
)
==
-
1
)
return
errno
;
if
((
st
.
st_mode
&
S_IRWXG
)
||
(
st
.
st_mode
&
S_IRWXO
))
return
MU_ERR_UNSAFE_PERMS
;
}
*
pwicket
=
calloc
(
1
,
sizeof
(
**
pwicket
));
if
(
*
pwicket
==
NULL
)
return
ENOMEM
;
...
...
@@ -249,16 +259,10 @@ get_ticket (url_t url, const char *user, const char *filename, url_t * ticket)
FILE
*
fp
=
NULL
;
size_t
buflen
=
128
;
char
*
buf
=
NULL
;
struct
stat
st
;
if
(
!
filename
||
!
url
)
return
EINVAL
;
if
(
stat
(
filename
,
&
st
)
==
-
1
)
return
errno
;
if
((
st
.
st_mode
&
S_IRWXG
)
||
(
st
.
st_mode
&
S_IRWXO
))
return
MU_ERR_UNSAFE_PERMS
;
fp
=
fopen
(
filename
,
"r"
);
if
(
!
fp
)
...
...
Please
register
or
sign in
to post a comment