/[mailutils]/mailutils/mailbox/wicket.c
ViewVC logotype

Diff of /mailutils/mailbox/wicket.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by polak, Sun Feb 9 20:39:58 2003 UTC revision 1.13 by polak, Thu Sep 4 11:42:18 2003 UTC
# Line 1  Line 1 
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
# Line 21  Line 21 
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>
# Line 144  myticket_create (ticket_t *pticket, cons Line 145  myticket_create (ticket_t *pticket, cons
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)
# Line 248  get_ticket (url_t url, const char *user, Line 249  get_ticket (url_t url, const char *user,
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)

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26