Commit fc419399 fc4193991b38d861ca390eebcdeae12f16c1627f by Alain Magloire

* lib/mu_dmb.c(mu_check_perm): Reinforce

        by using (const char *name) in the argument.
        * pop3d/pop3d.c: The variable state was already
        use as a global, use "astate" in function pop3_parse_opt().
1 parent edc010f2
1 /* GNU mailutils - a suite of utilities for electronic mail 1 /* GNU mailutils - a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -53,12 +53,12 @@ mu_fcheck_perm (int fd, int mode) ...@@ -53,12 +53,12 @@ mu_fcheck_perm (int fd, int mode)
53 } 53 }
54 54
55 int 55 int
56 mu_check_perm (char *name, int mode) 56 mu_check_perm (const char *name, int mode)
57 { 57 {
58 struct stat st; 58 struct stat st;
59 59
60 if (mode == 0) 60 if (mode == 0)
61 return 0; 61 return 0;
62 if (stat (name, &st) == -1) 62 if (stat (name, &st) == -1)
63 { 63 {
64 if (errno == ENOENT) 64 if (errno == ENOENT)
...@@ -68,7 +68,7 @@ mu_check_perm (char *name, int mode) ...@@ -68,7 +68,7 @@ mu_check_perm (char *name, int mode)
68 } 68 }
69 if ((st.st_mode & 0777) != mode) 69 if ((st.st_mode & 0777) != mode)
70 { 70 {
71 errno = EPERM; 71 errno = EPERM;
72 return 1; 72 return 1;
73 } 73 }
74 return 0; 74 return 0;
......
1 /* GNU mailutils - a suite of utilities for electronic mail 1 /* GNU mailutils - a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -75,4 +75,4 @@ DBM_DATUM mu_dbm_nextkey __P((DBM_FILE db, DBM_DATUM key)); ...@@ -75,4 +75,4 @@ DBM_DATUM mu_dbm_nextkey __P((DBM_FILE db, DBM_DATUM key));
75 #endif 75 #endif
76 76
77 int mu_fcheck_perm __P((int fd, int mode)); 77 int mu_fcheck_perm __P((int fd, int mode));
78 int mu_check_perm __P((char *name, int mode)); 78 int mu_check_perm __P((const char *name, int mode));
......
1 /* GNU mailutils - a suite of utilities for electronic mail 1 /* GNU mailutils - a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -42,7 +42,7 @@ static int pop3d_mainloop __P ((int, int)); ...@@ -42,7 +42,7 @@ static int pop3d_mainloop __P ((int, int));
42 static void pop3d_daemon_init __P ((void)); 42 static void pop3d_daemon_init __P ((void));
43 static void pop3d_daemon __P ((unsigned int, unsigned int)); 43 static void pop3d_daemon __P ((unsigned int, unsigned int));
44 static error_t pop3d_parse_opt __P((int key, char *arg, 44 static error_t pop3d_parse_opt __P((int key, char *arg,
45 struct argp_state *state)); 45 struct argp_state *astate));
46 const char *argp_program_version = "pop3d (" PACKAGE ") " VERSION; 46 const char *argp_program_version = "pop3d (" PACKAGE ") " VERSION;
47 const char *argp_program_bug_address = "<bug-mailutils@gnu.org>"; 47 const char *argp_program_bug_address = "<bug-mailutils@gnu.org>";
48 static char doc[] = "GNU pop3d -- the POP3 daemon"; 48 static char doc[] = "GNU pop3d -- the POP3 daemon";
...@@ -50,7 +50,7 @@ static char doc[] = "GNU pop3d -- the POP3 daemon"; ...@@ -50,7 +50,7 @@ static char doc[] = "GNU pop3d -- the POP3 daemon";
50 static struct argp argp = { 50 static struct argp argp = {
51 NULL, 51 NULL,
52 pop3d_parse_opt, 52 pop3d_parse_opt,
53 NULL, 53 NULL,
54 doc, 54 doc,
55 NULL, 55 NULL,
56 NULL, NULL 56 NULL, NULL
...@@ -65,14 +65,14 @@ static const char *pop3d_argp_capa[] = { ...@@ -65,14 +65,14 @@ static const char *pop3d_argp_capa[] = {
65 }; 65 };
66 66
67 static error_t 67 static error_t
68 pop3d_parse_opt (int key, char *arg, struct argp_state *state) 68 pop3d_parse_opt (int key, char *arg, struct argp_state *astate)
69 { 69 {
70 switch (key) 70 switch (key)
71 { 71 {
72 case ARGP_KEY_INIT: 72 case ARGP_KEY_INIT:
73 state->child_inputs[1] = state->input; 73 astate->child_inputs[1] = astate->input;
74 break; 74 break;
75 75
76 default: 76 default:
77 return ARGP_ERR_UNKNOWN; 77 return ARGP_ERR_UNKNOWN;
78 } 78 }
...@@ -85,14 +85,14 @@ main (int argc, char **argv) ...@@ -85,14 +85,14 @@ main (int argc, char **argv)
85 { 85 {
86 struct group *gr; 86 struct group *gr;
87 int status = OK; 87 int status = OK;
88 88
89 mu_argp_parse (&argp, &argc, &argv, 0, pop3d_argp_capa, NULL, &daemon_param); 89 mu_argp_parse (&argp, &argc, &argv, 0, pop3d_argp_capa, NULL, &daemon_param);
90 90
91 #ifdef USE_LIBPAM 91 #ifdef USE_LIBPAM
92 if (!pam_service) 92 if (!pam_service)
93 pam_service = "gnu-pop3d"; 93 pam_service = (char *)"gnu-pop3d";
94 #endif 94 #endif
95 95
96 /* First we want our group to be mail so we can access the spool. */ 96 /* First we want our group to be mail so we can access the spool. */
97 gr = getgrnam ("mail"); 97 gr = getgrnam ("mail");
98 if (gr == NULL) 98 if (gr == NULL)
...@@ -111,7 +111,7 @@ main (int argc, char **argv) ...@@ -111,7 +111,7 @@ main (int argc, char **argv)
111 { 111 {
112 list_t bookie; 112 list_t bookie;
113 registrar_get_list (&bookie); 113 registrar_get_list (&bookie);
114 list_append (bookie, mbox_record); 114 list_append (bookie, mbox_record);
115 list_append (bookie, path_record); 115 list_append (bookie, path_record);
116 } 116 }
117 117
......