net_cfg_service.c revision cee0fb94c0d4227de0a00efc162fb2739844b641
/*
* 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
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <syslog.h>
#include "mms_list.h"
#include "mms_parser.h"
#include "mms_network.h"
#include "mms_cfg.h"
#include <mms_trace.h>
#include "net_cfg_service.h"
int
{
char *value;
/* read common service config */
return (1);
}
}
}
return (1);
}
return (2);
}
return (0);
}
/* ARGSUSED1 */
char *
{
if (password) {
/*
* Put obfuscation algorithm here.
*
* If ed is zero then encrypt else decrypt.
*/
}
return (buf);
}
int
{
int fd = -1;
int n;
int rc = 1;
const char *newline = "\n";
char *p;
int len;
return (1);
}
"net cfg write file %s null password", file);
return (1);
}
return (1);
}
}
"net cfg write file %s alloc %s",
file,
return (1);
}
*p = 0;
}
return (1);
}
"net cfg write file %s password obfuscation",
file);
} else {
rc = 0;
} else {
"net cfg write file %s write %s n %d len %d",
}
}
if (fd >= 0)
return (rc);
}
char *
mms_net_cfg_read_pass_file(char *file)
{
int fd = -1;
char *p;
int n;
int len;
goto out;
}
goto out;
}
"net cfg read file %s mode %x",
file,
goto out;
}
"net cfg read file %s open %s",
file,
goto out;
}
"net cfg read file %s alloc %s",
file,
goto out;
}
"net cfg read file %s read %s n %d len %d",
file,
n,
len);
goto out;
}
*p = (char)0;
}
"net cfg read file %s password un-obfuscate",
file);
}
out:
if (obfpass)
if (fd >= 0)
return (password);
}