Deleted Added
full compact
login_cap.c (184633) login_cap.c (255007)
1/*-
2 * Copyright (c) 1996 by
3 * Sean Eric Fagan <sef@kithrup.com>
4 * David Nugent <davidn@blaze.net.au>
5 * All rights reserved.
6 *
7 * Portions copyright (c) 1995,1997
8 * Berkeley Software Design, Inc.

--- 13 unchanged lines hidden (view full) ---

22 * 4. Absolutely no warranty of function or purpose is made by the authors.
23 * 5. Modifications may be freely made to this file providing the above
24 * conditions are met.
25 *
26 * Low-level routines relating to the user capabilities database
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1996 by
3 * Sean Eric Fagan <sef@kithrup.com>
4 * David Nugent <davidn@blaze.net.au>
5 * All rights reserved.
6 *
7 * Portions copyright (c) 1995,1997
8 * Berkeley Software Design, Inc.

--- 13 unchanged lines hidden (view full) ---

22 * 4. Absolutely no warranty of function or purpose is made by the authors.
23 * 5. Modifications may be freely made to this file providing the above
24 * conditions are met.
25 *
26 * Low-level routines relating to the user capabilities database
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/lib/libutil/login_cap.c 184633 2008-11-04 13:49:53Z des $");
30__FBSDID("$FreeBSD: head/lib/libutil/login_cap.c 255007 2013-08-28 21:10:37Z jilles $");
31
32#include <sys/types.h>
33#include <sys/time.h>
34#include <sys/resource.h>
35#include <sys/param.h>
36#include <errno.h>
37#include <fcntl.h>
38#include <libutil.h>

--- 195 unchanged lines hidden (view full) ---

234 name = LOGIN_DEFCLASS;
235
236 switch (cgetent(&lc->lc_cap, login_dbarray, name)) {
237 case -1: /* Failed, entry does not exist */
238 if (me)
239 break; /* Don't retry default on 'me' */
240 if (i == 0)
241 r = -1;
31
32#include <sys/types.h>
33#include <sys/time.h>
34#include <sys/resource.h>
35#include <sys/param.h>
36#include <errno.h>
37#include <fcntl.h>
38#include <libutil.h>

--- 195 unchanged lines hidden (view full) ---

234 name = LOGIN_DEFCLASS;
235
236 switch (cgetent(&lc->lc_cap, login_dbarray, name)) {
237 case -1: /* Failed, entry does not exist */
238 if (me)
239 break; /* Don't retry default on 'me' */
240 if (i == 0)
241 r = -1;
242 else if ((r = open(login_dbarray[0], O_RDONLY)) >= 0)
242 else if ((r = open(login_dbarray[0], O_RDONLY | O_CLOEXEC)) >= 0)
243 close(r);
244 /*
245 * If there's at least one login class database,
246 * and we aren't searching for a default class
247 * then complain about a non-existent class.
248 */
249 if (r >= 0 || strcmp(name, LOGIN_DEFCLASS) != 0)
250 syslog(LOG_ERR, "login_getclass: unknown class '%s'", name);

--- 569 unchanged lines hidden ---
243 close(r);
244 /*
245 * If there's at least one login class database,
246 * and we aren't searching for a default class
247 * then complain about a non-existent class.
248 */
249 if (r >= 0 || strcmp(name, LOGIN_DEFCLASS) != 0)
250 syslog(LOG_ERR, "login_getclass: unknown class '%s'", name);

--- 569 unchanged lines hidden ---