/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 2013 RackTop Systems.
*/
/*LINTLIBRARY*/
#include <stdio.h>
#include <string.h>
#include <userdefs.h>
#include <user_attr.h>
#include <limits.h>
#include <stdlib.h>
#include <stddef.h>
#include <time.h>
#include <unistd.h>
#include "userdisp.h"
#include "funcs.h"
#include "messages.h"
/* Print out a NL when the line gets too long */
#define PRINTNL() \
if (outcount > 40) { \
outcount = 0; \
}
static char *dup_to_nl(char *);
};
#define INT 0
typedef struct parsent {
} parsent_t;
};
static const parsent_t *
{
return (NULL);
/*
* The magic in this loop is remembering the last index when
* reentering the function; the entries above are also used to
* order the output to the default file.
*/
do {
ind++;
}
return (NULL);
}
/*
* getusrdef - access the user defaults file. If it doesn't exist,
* then returns default values of (values in userdefs.h):
* defrid = 100
* defgroup = 1
* defgname = other
* defparent = /home
* definact = 0
* defexpire = 0
* defauth = 0
* defprof = 0
* defrole = 0
*
* If getusrdef() is unable to access the defaults file, it
* returns a NULL pointer.
*
* If user defaults file exists, then getusrdef uses values
* in it to override the above values.
*/
struct userdefs *
{
return (&defaults);
}
} else {
return (&defaults);
}
if (*ptr == '#')
continue;
case INT:
break;
case PROJID:
break;
case STR:
break;
}
}
}
return (&defaults);
}
static char *
{
if (p)
*p = '\0';
return (res);
}
void
{
int outcount = 0;
/* Print out values */
PRINTNL();
}
PRINTNL();
}
PRINTNL();
}
PRINTNL();
}
PRINTNL();
}
PRINTNL();
}
PRINTNL();
}
PRINTNL();
}
PRINTNL();
}
PRINTNL();
}
PRINTNL();
}
deflts->deflimpriv);
PRINTNL();
}
PRINTNL();
}
}
if (outcount > 0)
}
/*
* putusrdef -
* changes default values in defadduser file
*/
int
{
int i;
char *hdr;
/*
* file format is:
* defgroup=m (m=default group id)
* defgname=str1 (str1=default group name)
* defparent=str2 (str2=default base directory)
* definactive=x (x=default inactive)
* defexpire=y (y=default expire)
* defproj=z (z=numeric project id)
* defprojname=str3 (str3=default project name)
* ... etc ...
*/
return (EX_UPDATE);
}
} else {
return (EX_UPDATE);
}
}
/* print error if can't lock whole of DEFFILE */
return (EX_UPDATE);
}
/* If it's a role, we must skip the defrole field */
hdr = FHEADER_ROLE;
} else {
skip = -1;
}
/* get time */
/* write it to file */
return (EX_UPDATE);
}
for (i = 0; i < NDEF; i++) {
int res = 0;
continue;
case INT:
break;
case STR:
break;
case PROJID:
break;
}
if (res <= 0) {
return (EX_UPDATE);
}
}
return (EX_SUCCESS);
}
/* Export command line keys to defaults for useradd -D */
void
{
int i;
for (i = 0; i < NDEF; i++) {
char *val;
}
}
/* Import default keys for ordinary useradd */
void
{
int i;
for (i = 0; i < NDEF; i++) {
nkeys ++;
}
}
}