* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: allow.c,v 1.17 2007-04-14 18:04:24 thib Exp $ */
+ /* $Id: allow.c,v 1.18 2007-06-03 17:53:02 thib Exp $ */
#include "fcrontab.h"
int
is_allowed(char *user)
- /* return 1 if user is allowed to use this soft
+ /* return 1 if user is allowed to use this software
* otherwise return 0 */
{
int allow = 0;
int deny = 0;
/* check if user is in passwd file */
- errno = 0;
- if ( ( ! getpwnam(user) ) || errno != 0 )
+ if ( getpwnam(user) == NULL )
return 0;
/* check if user is in fcron.allow and/or in fcron.deny files */
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: conf.c,v 1.72 2007-04-14 18:04:16 thib Exp $ */
+ /* $Id: conf.c,v 1.73 2007-06-03 17:52:34 thib Exp $ */
#include "fcron.h"
/* then add normal files, if any, to database */
for (list_cur = file_list; list_cur; list_cur = list_cur->next ) {
+ errno = 0;
if ( getpwnam(list_cur->str)
#ifdef SYSFCRONTAB
|| strcmp(list_cur->str, SYSFCRONTAB) == 0
synchronize_file(list_cur->str);
}
else
- error("ignoring file \"%s\" : not in passwd file.", list_cur->str);
+ error_e("ignoring file \"%s\" : not in passwd file.", list_cur->str);
}
/* finally add new files */
for (list_cur = new_list; list_cur; list_cur = list_cur->next ) {
/* len("new.") = 4 : */
+ errno = 0;
if ( getpwnam(list_cur->str + 4)
#ifdef SYSFCRONTAB
|| strcmp(list_cur->str + 4, SYSFCRONTAB) == 0
synchronize_file(list_cur->str);
}
else
- error("ignoring file %s : not in passwd file.",
+ error_e("ignoring file %s : not in passwd file.",
(list_cur->str + 4));
}
* the user cron job. It performs an entrypoint
* permission check for this purpose.
*/
+#ifdef SYSFCRONTAB
if(!strcmp(cf->cf_user, SYSFCRONTAB))
user_name = "system_u";
else
+#endif /* def SYSFCRONTAB */
user_name = cf->cf_user;
if(flask_enabled)
{
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: socket.c,v 1.23 2007-04-14 18:04:26 thib Exp $ */
+ /* $Id: socket.c,v 1.24 2007-06-03 17:53:30 thib Exp $ */
/* This file contains all fcron's code (server) to handle communication with fcrondyn */
pass_sys = pass_sp->sp_pwdp;
#else
struct passwd *pass = NULL;
+ errno = 0;
if ( (pass = getpwnam((char *) client->fcl_cmd )) == NULL ) {
error_e("could not getpwnam %s", (char *) client->fcl_cmd);
send(client->fcl_sock_fd, "0", sizeof("0"), 0);
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: subs.c,v 1.27 2007-04-14 18:04:23 thib Exp $ */
+ /* $Id: subs.c,v 1.28 2007-06-03 17:52:53 thib Exp $ */
#include "global.h"
#include "subs.h"
errno = 0;
pass = getpwnam(username);
- if ( errno != 0 || pass == NULL ) {
+ if ( pass == NULL ) {
die_e("Unable to get the uid of user %s (is user in passwd file?)",
username);
}