1 2 /* 3 * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18 #include "includes.h" 19 20 #include <sys/types.h> 21 #include <sys/select.h> 22 #include <sys/time.h> 23 24 #include <fcntl.h> 25 #include <string.h> 26 #include <signal.h> 27 #include <stdlib.h> 28 #include <stdio.h> 29 #include <time.h> 30 #include <unistd.h> 31 32 /* 33 * NB. duplicate __progname in case it is an alias for argv[0] 34 * Otherwise it may get clobbered by setproctitle() 35 */ 36 char *ssh_get_progname(char *argv0) 37 { 38 char *p, *q; 39 extern char *__progname; 40 41 p = __progname; 42 if ((q = strdup(p)) == NULL) { 43 perror("strdup"); 44 exit(1); 45 } 46 return q; 47 } 48 49 #ifndef HAVE_PLEDGE 50 #ifndef __DragonFly__ 51 int 52 pledge(const char *promises, const char *paths[]) 53 { 54 return 0; 55 } 56 #endif 57 #endif 58