krb5_utils.c revision c1e843e07dc2cc8156b7a669add88f4a215f9ca4
/*
SSSD
Kerberos 5 Backend Module -- Utilities
Authors:
Sumit Bose <sbose@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 <string.h>
#include <stdlib.h>
#include "providers/krb5/krb5_utils.h"
#include "providers/krb5/krb5_auth.h"
bool *private_path)
{
char *copy;
char *p;
char *n;
char *dummy;
const char *cache_dir_tmpl;
*private_path = false;
return NULL;
}
goto done;
}
goto done;
}
p = copy;
*n = '\0';
n++;
if ( *n == '\0' ) {
goto done;
}
switch( *n ) {
case 'u':
"because user name is empty.\n"));
goto done;
}
if (!file_mode) *private_path = true;
break;
case 'U':
"because uid is invalid.\n"));
goto done;
}
if (!file_mode) *private_path = true;
break;
case 'p':
"because upn is empty.\n"));
goto done;
}
if (!file_mode) *private_path = true;
break;
case '%':
break;
case 'r':
goto done;
}
break;
case 'h':
"because the path is not available.\n"));
goto done;
}
if (!file_mode) *private_path = true;
break;
case 'd':
if (file_mode) {
if (cache_dir_tmpl == NULL) {
goto done;
}
false, private_path);
"template failed.\n"));
goto done;
}
} else {
goto done;
}
break;
case 'P':
if (!file_mode) {
goto done;
}
"because PID is not available.\n"));
goto done;
}
break;
default:
goto done;
}
goto done;
}
p = n + 1;
}
goto done;
}
done:
return res;
}
{
if (private_path) {
"directory belonging to root or to [%d][%d].\n",
return EINVAL;
}
"the owner.\n"));
return EINVAL;
}
} else {
"others.\n"));
return EINVAL;
}
}
} else {
"directory.\n"));
return EINVAL;
}
"others.\n"));
return EINVAL;
}
}
return EOK;
}
struct string_list {
struct string_list *next;
struct string_list *prev;
char *s;
};
struct stat *parent_stat,
struct string_list **missing_parents)
{
char *end;
struct string_list *li;
return EINVAL;
}
return EOK;
} else {
return ret;
}
}
return ENOMEM;
}
return ENOMEM;
}
return ENOMEM;
}
dirname));
goto done;
}
*end = '\0';
done:
return ret;
}
bool private_path)
{
char *dirname;
char *end;
struct stat parent_stat;
return ENOMEM;
}
offset = 5;
}
goto done;
}
if (*dirname != '/') {
goto done;
}
if (illegal_re != NULL) {
0, 0, NULL, 0);
if (ret == 0) {
dirname));
goto done;
} else if ( ret == PCRE_ERROR_NOMATCH) {
"illegal patterns.\n", dirname));
} else {
goto done;
}
}
goto done;
}
*end = '\0';
goto done;
}
goto done;
}
} else {
if (private_path &&
new_dir_mode = 0700;
} else {
new_dir_mode = 0755;
}
}
goto done;
}
if (private_path &&
goto done;
}
}
}
done:
return ret;
}
{
char *server_name;
if (kerr != 0) {
goto done;
}
if (kerr != 0) {
goto done;
}
if (server_name == NULL) {
goto done;
}
if (kerr != 0) {
goto done;
}
if (kerr != 0) {
goto done;
}
if (kerr != 0) {
goto done;
}
if (kerr != 0) {
goto done;
}
kerr = 0;
done:
}
if (client_princ != NULL) {
}
if (server_princ != NULL) {
}
}
if (kerr != 0) {
return EIO;
}
return EOK;
}