/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <libgen.h>
#include "stdusers.h"
static int suppress = 0;
static void usage(void);
static char *find_basename(const char *str);
void
usage(void)
{
"usage: install [-sd][-m mode][-g group][-u owner] "
"-f dir file ...\n");
}
void
{
int src_fd;
int dest_fd;
int count;
exit(1);
}
exit(1);
}
}
if (count == -1) {
exit(1);
}
if (!suppress)
}
void
{
if (group) {
if (grp < 0)
}
if (owner) {
if (own < 0) {
exit(1);
}
}
exit(1);
}
}
char *
{
int i;
int len;
for (i = len-1; i >= 0; i--)
if (str[i] == '/')
return ((char *)(str + i + 1));
return ((char *)str);
}
int
errno = 0;
return (errno);
} else if (!suppress) {
}
return (0);
}
int
{
int c;
int errflg = 0;
int dirflg = 0;
int rv = 0;
switch (c) {
case 'f':
break;
case 'g':
break;
case 'u':
break;
case 'd':
dirflg = 1;
break;
case 'm':
break;
case 's':
suppress = 1;
break;
case '?':
errflg++;
break;
}
}
if (errflg) {
usage();
return (1);
}
usage();
return (1);
}
"install: no destination directory specified.\n");
return (1);
}
if (dirflg) {
if (rv) {
"install: creatdir %s (%d): %s\n",
return (rv);
}
} else {
}
if (mode != -1) {
(void) umask(0);
"install: chmod of %s to mode %o failed "
"(%d): %s\n",
return (1);
}
}
}
return (0);
}