/*
Authors:
Benjamin Franzke <benjaminfranzke@googlemail.com>
Copyright (C) 2013 Benjamin Franzke
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/>.
*/
/* TODO: Support of [all] samba's Unix SIDs:
* Users: S-1-22-1-%UID
* Groups: S-1-22-2-%GID
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <limits.h>
#include <stdarg.h>
#include <cifsidmap.h>
#include "lib/idmap/sss_idmap.h"
#include "sss_client/idmap/sss_nss_idmap.h"
#ifdef DEBUG
#include <syslog.h>
#else
#define debug(...) do { } while(0)
#endif
struct sssd_ctx {
const char **errmsg;
};
do { \
} while (0);
{
return EINVAL;
if (!ctx) {
*errmsg = "Failed to allocate context";
return -1;
}
if (err != IDMAP_SUCCESS) {
return -1;
}
return 0;
}
{
debug("exit");
return;
}
/* Test with `getcifsacl file` on client. */
char **name)
{
char *sid;
int err;
if (iderr != IDMAP_SUCCESS) {
return -1;
}
if (err != 0) {
return -err;
}
/* FIXME: Map Samba Unix SIDs? (sid->id and use getpwuid)? */
return 0;
}
{
if (err != IDMAP_SUCCESS) {
return -1;
}
return -1;
}
return 0;
}
/* Test with setcifsacl -a */
{
int err;
int success = 0;
if (err != 0) {
/* Might be a raw string representation of SID,
* try converting that before returning an error. */
return 0;
return -err;
}
success = -1;
return success;
}
{
return -1;
switch (type) {
case 1:
break;
case 2:
break;
default:
return -1;
}
return 0;
}
{
int err;
if (err != 0) {
return -1;
}
switch (id_type) {
case SSS_ID_TYPE_UID:
break;
case SSS_ID_TYPE_GID:
break;
case SSS_ID_TYPE_BOTH:
break;
default:
return -1;
}
return 0;
}
/**
* cifs_idmap_sids_to_ids - convert struct cifs_sids to struct cifs_uxids
* usecase: mount.cifs -o sec=krb5,multiuser,cifsacl,nounix
* test: ls -n on mounted share
*/
{
size_t i;
char *sid;
return EINVAL;
}
for (i = 0; i < num; ++i) {
if (err != IDMAP_SUCCESS) {
continue;
}
success = 0;
}
}
return success;
}
{
char *sid;
size_t i;
return EINVAL;
}
for (i = 0; i < num; ++i) {
if (err != 0) {
* SAMBA's UNIX SIDs? */
continue;
}
success = 0;
else
}
return success;
}