/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Replace the smb_shr_load() function in libmlsvc, because
* fksmbd doesn't want the real shares known by libshare,
* instead preferring its own (fake) list of shares.
*/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <syslog.h>
#include <libshare.h>
#include <unistd.h>
#include <note.h>
#include <smbsrv/libsmbns.h>
#include <smbsrv/libmlsvc.h>
#include <smbsrv/smb_share.h>
static void
{
if (smb_shr_add(&si) != 0) {
}
}
/*
* This function loads a list of shares from a text file, where
* each line of the file contains:
* name path comment
*
* This is only for fksmbd, for testing.
*/
void
{
char *p;
return;
}
name = p;
p = strpbrk(p, " \t\n");
if (p == NULL)
continue;
*p++ = '\0';
path = p;
p = strpbrk(p, " \t\n");
if (p == NULL)
comment = "";
else {
*p++ = '\0';
comment = p;
p = strchr(p, '\n');
if (p != NULL)
*p++ = '\0';
}
}
}
/*ARGSUSED*/
void *
{
char *shr_file;
/*
* Not loading the real shares in fksmbd because that
* Also, we won't generally have access to everything
* in the real shares, because fksmbd runs (only) with
* the credentials of the user who runs it.
*/
/* Allow creating lots of shares for testing. */
return (NULL);
}