/*
Authors:
Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) 2009 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.
*/
#include <tevent.h>
#include <talloc.h>
#include "tools/sss_sync_ops.h"
/* Default settings for user attributes */
#define DFL_CREATE_HOMEDIR true
#define DFL_REMOVE_HOMEDIR true
{
char *name;
char **values;
const char *vals;
int nvals;
goto done;
}
goto done;
}
vals++;
goto done;
}
done:
return ret;
}
{
char *name;
char **vals;
int nvals;
int i;
switch(op) {
case SYSDB_MOD_ADD:
case SYSDB_MOD_DEL:
case SYSDB_MOD_REP:
break;
default:
return EINVAL;
}
goto done;
}
goto done;
}
for (i=0; i < nvals; i++) {
continue;
}
}
done:
return ret;
}
/*
* Generic modify groups member
*/
char **grouplist,
int optype)
{
int ret;
int i;
if (!tmpctx) {
return ENOMEM;
}
/* FIXME: add transaction around loop */
for (i = 0; grouplist[i]; i++) {
if (grp_sysdb_fqname == NULL) {
goto done;
}
if (!parent_dn) {
goto done;
}
if (ret) {
goto done;
}
}
done:
return ret;
}
/*
* Modify a user
*/
struct user_mod_state {
};
const char *gecos,
const char *home,
const char *shell,
int lock,
struct sysdb_attrs **_attrs)
{
return ENOMEM;
}
if (shell) {
shell);
}
home);
}
gecos);
}
uid);
}
gid);
}
"true");
}
/* PAM code checks for 'false' value in SYSDB_DISABLED attribute */
"false");
}
"Could not add attribute [%s] to changeset.\n", attr_name);
return ret;
}
return EOK;
}
/*
* Public interface for modifying users
*/
{
int ret;
return ENOMEM;
}
if (!member_dn) {
return ENOMEM;
}
}
&attrs);
return ret;
}
if (ret) {
return ret;
}
}
if (ret) {
return ret;
}
}
if (ret) {
return ret;
}
}
if (ret) {
return ret;
}
}
if (ret) {
return ret;
}
}
if (ret) {
return ret;
}
}
return EOK;
}
/*
* Public interface for modifying groups
*/
{
int ret;
return ENOMEM;
}
if (!member_dn) {
return ENOMEM;
}
}
if (!attrs) {
return ENOMEM;
}
if (ret) {
return ret;
}
if (ret) {
return ret;
}
}
if (ret) {
return ret;
}
}
if (ret) {
return ret;
}
}
return EOK;
}
struct confdb_ctx *confdb,
int remove_home)
{
int ret;
char *conf_path;
bool dfl_remove_home;
if (!conf_path) {
return ENOMEM;
}
/* remove homedir on user creation? */
if (!remove_home) {
goto done;
}
} else {
}
/* a directory to remove mail spools from */
goto done;
}
done:
return ret;
}
/*
* Default values for add operations
*/
struct confdb_ctx *confdb,
const char *gecos,
const char *homedir,
const char *shell,
int create_home,
const char *skeldir)
{
int ret;
if (!conf_path) {
return ENOMEM;
}
/* gecos */
goto done;
}
/* homedir */
if (homedir) {
} else {
goto done;
}
}
goto done;
}
/* default shell */
if (!shell) {
goto done;
}
} else {
goto done;
}
}
/* create homedir on user creation? */
if (!create_home) {
goto done;
}
} else {
}
/* umask to create homedirs */
goto done;
}
/* a directory to create mail spools in */
goto done;
}
/* skeleton dir */
if (!skeldir) {
goto done;
}
} else {
goto done;
}
}
done:
return ret;
}
/*
* Public interface for adding users
*/
{
int ret;
goto done;
}
if (ret) {
goto done;
}
if (!member_dn) {
goto done;
}
if (ret) {
goto done;
}
}
done:
return ret;
}
/*
* Public interface for deleting users
*/
{
int ret;
return ENOMEM;
}
if (!user_dn) {
return ENOMEM;
}
if (ret) {
}
return ret;
}
/*
* Public interface for adding groups
*/
{
int ret;
return ENOMEM;
}
}
return ret;
}
/*
* Public interface for deleting groups
*/
{
int ret;
return ENOMEM;
}
return ENOMEM;
}
if (ret) {
}
return ret;
}
/*
* getpwnam, getgrnam and friends
*/
const char *name,
{
const char *str;
int ret;
return ENOMEM;
}
if (ret) {
return ret;
}
case 0:
return ENOENT;
case 1:
/* fill ops_ctx */
return ENOMEM;
}
return ENOMEM;
}
return ENOMEM;
}
return ENOMEM;
}
} else {
} else { /* Invalid value */
return EIO;
}
}
break;
default:
"More than one result for sysdb_getpwnam call\n");
return EIO;
}
return EOK;
}
const char *name,
{
const char *str;
int ret;
return ENOMEM;
}
if (ret) {
return ret;
}
case 0:
return ENOENT;
case 1:
/* fill ops_ctx */
return ENOMEM;
}
return ENOMEM;
}
break;
default:
"More than one result for sysdb_getgrnam call\n");
return EIO;
}
return EOK;
}