80 lines
2.0 KiB
C
80 lines
2.0 KiB
C
/*
|
|
* CU sudo version 1.3.1 (based on Root Group sudo version 1.1)
|
|
*
|
|
* This software comes with no waranty whatsoever, use at your own risk.
|
|
*
|
|
* Please send bugs, changes, problems to sudo-bugs.cs.colorado.edu
|
|
*
|
|
*/
|
|
|
|
/*
|
|
* sudo version 1.1 allows users to execute commands as root
|
|
* Copyright (C) 1991 The Root Group, Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 1, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*
|
|
*******************************************************************
|
|
*
|
|
* This module contains strdup() for those systems without it.
|
|
*
|
|
* Jeff Nieusma Thu Mar 21 23:11:23 MST 1991
|
|
*/
|
|
|
|
#ifndef lint
|
|
static char rcsid[] = "$Id$";
|
|
#endif /* lint */
|
|
|
|
#include "config.h"
|
|
|
|
#include <stdio.h>
|
|
#ifdef STDC_HEADERS
|
|
#include <stdlib.h>
|
|
#endif /* STDC_HEADERS */
|
|
#ifdef HAVE_STRING_H
|
|
#include <string.h>
|
|
#endif /* HAVE_STRING_H */
|
|
#ifdef HAVE_STRINGS_H
|
|
#include <strings.h>
|
|
#endif /* HAVE_STRINGS_H */
|
|
#ifdef HAVE_MALLOC_H
|
|
#include <malloc.h>
|
|
#endif /* HAVE_MALLOC_H */
|
|
|
|
#ifndef STDC_HEADERS
|
|
extern char *malloc __P((size_t));
|
|
extern char *strcpy __P((char *, const char *));
|
|
#endif /* !STDC_HEADERS */
|
|
|
|
|
|
/******************************************************************
|
|
*
|
|
* strdup()
|
|
*
|
|
* this function returns a pointer a string copied into
|
|
* a malloc()ed buffer
|
|
*/
|
|
|
|
char * strdup(s1)
|
|
const char * s1;
|
|
{
|
|
register char * s;
|
|
|
|
if ((s = (char *) malloc(strlen(s1) + 1)) == NULL)
|
|
return(NULL);
|
|
|
|
(void) strcpy(s, s1);
|
|
return(s);
|
|
}
|