smb_common_search.c revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Implementation of smb_rdir_open, smb_rdir_next and smb_rdir_close.
*/
#include <smbsrv/smb_incl.h>
#include <smbsrv/smb_fsops.h>
/*
* smb_rdir_open
*/
int
{
smb_odir_t *od;
char *last_component;
unsigned int rc;
int erc;
&node, last_component)) != 0) {
/* NOTREACHED */
}
/* NOTREACHED */
}
if (erc != 0) {
return (SDRC_NORMAL_REPLY);
} else {
/* NOTREACHED */
}
} else {
/* NOTREACHED */
}
}
sattr);
/* NOTREACHED */
}
return (-1);
}
/*
* smb_rdir_next
*
* Returns:
* 0 Found an entry
* ENOENT There is no (more) entry
* error code An error happened
*/
int
smb_node_t **rnode,
{
char last_component[MAXNAMELEN];
char namebuf[MAXNAMELEN];
return (ENOENT);
}
if (dir->d_wildcards == 0) {
/* There are no wildcards in pattern */
/* Already found entry... */
return (ENOENT);
}
if (rc != 0)
return (rc);
/*
* We are here if there was a successful lookup of the
* name. The name may be a mangled name. If it was,
* then shortname has the copy of it. So, we may
* not need to do mangling later.
*
* dir->name will contain the case-preserved name.
* If that name is not available (this should not
* happen), then copy dir->pattern into dir->name.
*/
} else {
}
/* Root of file system? */
&dnode, last_component);
if (rc != 0) {
} else {
0, 0);
if (rc != 0) {
} else {
}
}
}
/*
* If name not already mangled, do it.
*
* The name will only be mangled if smb_needs_mangle()
* determines that it is required. Mangling due to
* case-insensitive collisions is not necessary here.
*/
if (rnode)
else
return (0);
} /* No wild card search */
for (;;) {
return (ENOENT);
}
/* sizeof dir->name == 256 */
if (rc != 0) {
return (rc);
}
if (n_name == 0) /* EOF */
break;
/*
* Don't return "." or ".." unless SMB_FA_HIDDEN bit is set
* We have to code these specially since we cannot set the
* SMB_FA_HIDDEN bits in these because they are simply links to
* the real directory and the real directory is NOT hidden.
*/
continue;
}
/* may match a mangled name or "real" name */
continue;
/* Look up the "real" name */
if (rc != 0) {
return (rc);
}
else
continue;
/* NOTREACHED */
}
/* Root of file system? */
if (rc != 0) {
continue;
}
if (rc != 0) {
continue;
}
}
/* Obey search attributes */
continue;
}
continue;
}
continue;
}
if (rnode)
else
return (0);
}
return (ENOENT);
}
/*
* smb_rdir_close
*/
void
{
}