* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: conf.c,v 1.46 2001-06-22 21:09:00 thib Exp $ */
+ /* $Id: conf.c,v 1.47 2001-07-04 16:16:08 thib Exp $ */
#include "fcron.h"
#include "conf.h"
if (strcmp(cl->cl_runas, runas_str) != 0)
warn("warning: runas(%s) is not owner (%s): overridden.",
cl->cl_runas, runas_str);
- free(cl->cl_runas);
- cl->cl_runas = strdup2(runas_str);
+ Set(cl->cl_runas, runas_str);
}
/* we need that here because the user's name contained in the
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fcrontab.c,v 1.39 2001-06-22 21:06:37 thib Exp $ */
+ /* $Id: fcrontab.c,v 1.40 2001-07-04 16:15:36 thib Exp $ */
/*
* The goal of this program is simple : giving a user interface to fcron
#include "fcrontab.h"
-char rcs_info[] = "$Id: fcrontab.c,v 1.39 2001-06-22 21:06:37 thib Exp $";
+char rcs_info[] = "$Id: fcrontab.c,v 1.40 2001-07-04 16:15:36 thib Exp $";
void info(void);
void usage(void);
fprintf(stderr, "must be privileged to use -u\n");
xexit(EXIT_ERR);
}
- free(user);
- user = strdup2(argv[optind]) ;
+ Set(user, argv[optind]);
}
else if (argc - optind == 1) {
if ( list_opt + rm_opt + edit_opt + reinstall_opt == 0 )
fprintf(stderr, "must be privileged to use [user|-u user]\n");
xexit(EXIT_ERR);
}
- free(user);
- user = strdup2(argv[optind]);
+ Set(user, argv[optind]);
}
}
else if (list_opt + rm_opt + edit_opt + reinstall_opt != 1)
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fileconf.c,v 1.48 2001-06-22 21:08:18 thib Exp $ */
+ /* $Id: fileconf.c,v 1.49 2001-07-04 16:15:54 thib Exp $ */
#include "fcrontab.h"
#include "fileconf.h"
" ignored\n", file_name, line, val);
need_correction = 1;
} else {
- free(default_line.cl_mailto);
- default_line.cl_mailto = strdup2(val);
+ Set(default_line.cl_mailto, val);
set_mail(default_line.cl_option);
}
}
Handle_err;
if ( i == 1 ) {
bzero(cl, sizeof(CL));
- free(cl->cl_runas);
- cl->cl_runas = strdup2(user);
- free(cl->cl_mailto);
- cl->cl_mailto = strdup2(user);
+ Set(cl->cl_runas, user);
+ Set(cl->cl_mailto, user);
set_default_opt(cl->cl_option);
}
if (debug_opt)
" ignored\n", file_name, line, buf);
need_correction = 1;
} else {
- free(cl->cl_mailto);
- cl->cl_mailto = strdup2(buf);
+ Set(cl->cl_mailto, buf);
set_mail(cl->cl_option);
}
}
need_correction = 1;
}
else {
- free(cl->cl_runas);
- cl->cl_runas = strdup2(name);
+ Set(cl->cl_runas, name);
if (debug_opt)
fprintf(stderr, " Opt : \"%s\" %s\n", opt_name, name);
}
fprintf(stderr, "must be privileged to run as another user : "
"ignoring\n");
} else {
- free(cl->cl_runas);
- cl->cl_runas = strdup2(username);
+ Set(cl->cl_runas, username);
if (debug_opt)
fprintf(stderr, " Opt : inline_runas %s\n", username);
}