1 /* $NetBSD: user.c,v 1.3 1998/01/31 14:40:45 christos Exp $ */
3 /* Copyright 1988,1990,1993,1994 by Paul Vixie
6 * Distribute freely, except: don't remove my name from the source or
7 * documentation (don't take credit for my work), mark your changes (don't
8 * get me blamed for your possible bugs), don't alter or remove this
9 * notice. May be sold if buildable source is provided to buyer. No
10 * warrantee of any kind, express or implied, is included with this
11 * software; use at your own risk, responsibility for damages (if any) to
12 * anyone resulting from the use of this software rests entirely with the
15 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
16 * I'll try to keep a version up to date. I can be reached as follows:
17 * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
20 #include <sys/cdefs.h>
21 #if !defined(lint) && !defined(LINT)
23 static char rcsid
[] = "Id: user.c,v 2.8 1994/01/15 20:43:43 vixie Exp";
25 __RCSID("$NetBSD: user.c,v 1.3 1998/01/31 14:40:45 christos Exp $");
29 /* vix 26jan87 [log is in RCS file]
42 for (e
= u
->crontab
; e
!= NULL
; e
= ne
) {
51 load_user(int crontab_fd
, struct passwd
*pw
, /* NULL implies syscrontab */
54 char envstr
[MAX_ENVSTR
];
61 if (!(file
= fdopen(crontab_fd
, "r"))) {
62 perror("fdopen on crontab_fd in load_user");
66 Debug(DPARS
, ("load_user()\n"))
68 /* file is open. build user entry, then read the crontab file.
70 u
= (user
*) malloc(sizeof(user
));
71 u
->name
= strdup(name
);
75 * init environment. this will be copied/augmented for each entry.
82 while ((status
= load_env(envstr
, file
)) >= OK
) {
89 e
= load_entry(file
, NULL
, pw
, envp
);
96 envp
= env_set(envp
, envstr
);
104 Debug(DPARS
, ("...load_user() done\n"))