login_auth.c (116344) | login_auth.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 by 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 by 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_auth.c 116344 2003-06-14 18:42:37Z markm $"); | 30__FBSDID("$FreeBSD: head/lib/libutil/login_auth.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/stat.h> 36#include <sys/param.h> 37#include <sys/socket.h> 38#include <sys/wait.h> --- 54 unchanged lines hidden (view full) --- 93 */ 94 95int 96auth_cat(const char *file) 97{ 98 int fd, count; 99 char buf[BUFSIZ]; 100 | 31 32#include <sys/types.h> 33#include <sys/time.h> 34#include <sys/resource.h> 35#include <sys/stat.h> 36#include <sys/param.h> 37#include <sys/socket.h> 38#include <sys/wait.h> --- 54 unchanged lines hidden (view full) --- 93 */ 94 95int 96auth_cat(const char *file) 97{ 98 int fd, count; 99 char buf[BUFSIZ]; 100 |
101 if ((fd = open(file, O_RDONLY)) < 0) | 101 if ((fd = open(file, O_RDONLY | O_CLOEXEC)) < 0) |
102 return 0; 103 while ((count = read(fd, buf, sizeof(buf))) > 0) 104 (void)write(fileno(stdout), buf, count); 105 close(fd); 106 sleep(5); /* wait an arbitrary time to drain */ 107 return 1; 108} | 102 return 0; 103 while ((count = read(fd, buf, sizeof(buf))) > 0) 104 (void)write(fileno(stdout), buf, count); 105 close(fd); 106 sleep(5); /* wait an arbitrary time to drain */ 107 return 1; 108} |