/*
SSSD
sss_groupadd
Copyright (C) Jakub Hrozek <jhrozek@redhat.com> 2009
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 <stdio.h>
#include <stdlib.h>
#include <talloc.h>
#include <popt.h>
#include <errno.h>
#include <unistd.h>
#include "tools/tools_util.h"
#include "tools/sss_sync_ops.h"
{
0, _("The debug level to run with"), NULL },
0, _("The GID of the group"), NULL },
};
bool in_transaction = false;
debug_prg_name = argv[0];
ret = set_locale();
ERROR("Error setting the locale\n");
ret = EXIT_FAILURE;
goto fini;
}
/* parse params */
}
/* groupname is an argument, not option */
if (pc_groupname == NULL) {
}
ERROR("Error initializing the tools - no local domain\n");
} else {
ERROR("Error initializing the tools\n");
}
ret = EXIT_FAILURE;
goto fini;
}
/* if the domain was not given as part of FQDN, default to local domain */
ERROR("Invalid domain specified in FQDN\n");
ret = EXIT_FAILURE;
goto fini;
}
/* arguments processed, go on to actual work */
ERROR("The selected GID is outside the allowed range\n");
ret = EXIT_FAILURE;
goto fini;
}
goto done;
}
in_transaction = true;
/* groupadd */
goto done;
}
goto done;
}
in_transaction = false;
done:
if (in_transaction) {
}
}
switch (ret) {
case ERANGE:
ERROR("Could not allocate ID for the group - domain full?\n");
break;
case EEXIST:
ERROR("A group with the same name or GID already exists\n");
break;
default:
ERROR("Transaction error. Could not add group.\n");
break;
}
ret = EXIT_FAILURE;
goto fini;
}
ret = EXIT_SUCCESS;
fini:
}