Import ncpfs 0.12
This commit is contained in:
@@ -567,6 +567,7 @@ ncp_init_root(struct ncp_server *server)
|
||||
root->finfo.opened = 0;
|
||||
i->attributes = aDIR;
|
||||
i->dataStreamSize = 1024;
|
||||
i->volNumber = NCP_NUMBER_OF_VOLUMES+1; /* illegal volnum */
|
||||
ncp_date_unix2dos(0, &(i->creationTime), &(i->creationDate));
|
||||
ncp_date_unix2dos(0, &(i->modifyTime), &(i->modifyDate));
|
||||
ncp_date_unix2dos(0, &dummy, &(i->lastAccessDate));
|
||||
@@ -624,6 +625,7 @@ ncp_find_inode(struct inode *dir, const char *name)
|
||||
do
|
||||
{
|
||||
if ( (result->dir->finfo.i.DosDirNum == dir_info->DosDirNum)
|
||||
&& (result->dir->finfo.i.volNumber == dir_info->volNumber)
|
||||
&& (strcmp(result->finfo.i.entryName, name) == 0))
|
||||
{
|
||||
return result;
|
||||
@@ -645,6 +647,8 @@ ncp_lookup(struct inode *dir, const char *__name, int len,
|
||||
struct ncp_inode_info *result_info;
|
||||
int found_in_cache;
|
||||
|
||||
char name[len+1];
|
||||
|
||||
*result = NULL;
|
||||
|
||||
if (!dir || !S_ISDIR(dir->i_mode))
|
||||
@@ -687,7 +691,10 @@ ncp_lookup(struct inode *dir, const char *__name, int len,
|
||||
}
|
||||
}
|
||||
|
||||
result_info = ncp_find_inode(dir, __name);
|
||||
memcpy(name, __name, len);
|
||||
name[len] = 0;
|
||||
|
||||
result_info = ncp_find_inode(dir, name);
|
||||
|
||||
if (result_info != 0)
|
||||
{
|
||||
@@ -726,7 +733,7 @@ ncp_lookup(struct inode *dir, const char *__name, int len,
|
||||
DDPRINTK("ncp_lookup: trying index: %d, name: %s\n",
|
||||
i, c_entry[i].i.entryName);
|
||||
|
||||
if (strcmp(c_entry[i].i.entryName, __name) == 0)
|
||||
if (strcmp(c_entry[i].i.entryName, name) == 0)
|
||||
{
|
||||
DPRINTK("ncp_lookup: found in cache!\n");
|
||||
finfo.i = c_entry[i].i;
|
||||
@@ -740,20 +747,15 @@ ncp_lookup(struct inode *dir, const char *__name, int len,
|
||||
|
||||
if (found_in_cache == 0)
|
||||
{
|
||||
char this_name[len+1];
|
||||
|
||||
memcpy(this_name, __name, len);
|
||||
this_name[len] = 0;
|
||||
str_upper(this_name);
|
||||
str_upper(name);
|
||||
|
||||
DDPRINTK("ncp_lookup: do_lookup on %s/%s\n",
|
||||
NCP_ISTRUCT(dir)->entryName, this_name);
|
||||
NCP_ISTRUCT(dir)->entryName, name);
|
||||
|
||||
if (ncp_do_lookup(server,
|
||||
dir->i_ino == (int)&(NCP_SERVER(dir)->root)
|
||||
? NULL : NCP_ISTRUCT(dir),
|
||||
this_name,
|
||||
&(finfo.i)) != 0)
|
||||
name, &(finfo.i)) != 0)
|
||||
{
|
||||
iput(dir);
|
||||
return -ENOENT;
|
||||
|
||||
Reference in New Issue
Block a user