1 |
/* GNU Mailutils -- a suite of utilities for electronic mail |
/* GNU Mailutils -- a suite of utilities for electronic mail |
2 |
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. |
Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. |
3 |
|
|
4 |
This library is free software; you can redistribute it and/or |
This library is free software; you can redistribute it and/or |
5 |
modify it under the terms of the GNU Lesser General Public |
modify it under the terms of the GNU Lesser General Public |
21 |
|
|
22 |
#include <errno.h> |
#include <errno.h> |
23 |
#include <sys/types.h> |
#include <sys/types.h> |
24 |
|
#include <sys/stat.h> |
25 |
#include <pwd.h> |
#include <pwd.h> |
26 |
#include <string.h> |
#include <string.h> |
27 |
#include <stdlib.h> |
#include <stdlib.h> |
145 |
} |
} |
146 |
|
|
147 |
ticket_set_destroy (*pticket, myticket_destroy, NULL); |
ticket_set_destroy (*pticket, myticket_destroy, NULL); |
148 |
ticket_set_pop (*pticket, myticket_pop, NULL); |
status = ticket_set_pop (*pticket, myticket_pop, NULL); |
149 |
ticket_set_data (*pticket, mdata, NULL); |
ticket_set_data (*pticket, mdata, NULL); |
150 |
|
|
151 |
if (filename) |
if (filename) |
249 |
FILE *fp = NULL; |
FILE *fp = NULL; |
250 |
size_t buflen = 128; |
size_t buflen = 128; |
251 |
char *buf = NULL; |
char *buf = NULL; |
252 |
|
struct stat st; |
253 |
|
|
254 |
if (!filename || !url) |
if (!filename || !url) |
255 |
return EINVAL; |
return EINVAL; |
256 |
|
|
257 |
|
if (stat (filename, &st) == -1) |
258 |
|
return errno; |
259 |
|
if ((st.st_mode & S_IRWXG) || (st.st_mode & S_IRWXO)) |
260 |
|
return MU_ERR_UNSAFE_PERMS; |
261 |
|
|
262 |
fp = fopen (filename, "r"); |
fp = fopen (filename, "r"); |
263 |
|
|
264 |
if (!fp) |
if (!fp) |