mirror of https://github.com/FDOS/kernel.git
Don't allow wildcards for internal truename processing, except for
DosFindfirst and DosTruename. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@536 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
ec8b97be38
commit
9bcd6b125a
|
@ -94,3 +94,4 @@ struct cds {
|
||||||
|
|
||||||
#define CDS_MODE_SKIP_PHYSICAL 0x01 /* don't resolve SUBST, JOIN, NETW */
|
#define CDS_MODE_SKIP_PHYSICAL 0x01 /* don't resolve SUBST, JOIN, NETW */
|
||||||
#define CDS_MODE_CHECK_DEV_PATH 0x02 /* check for existence of device path */
|
#define CDS_MODE_CHECK_DEV_PATH 0x02 /* check for existence of device path */
|
||||||
|
#define CDS_MODE_ALLOW_WILDCARDS 0x04 /* allow wildcards in "truename" */
|
||||||
|
|
|
@ -1009,7 +1009,8 @@ COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name)
|
||||||
int rc;
|
int rc;
|
||||||
register dmatch FAR *dmp = dta;
|
register dmatch FAR *dmp = dta;
|
||||||
|
|
||||||
rc = truename(name, PriPathName, CDS_MODE_CHECK_DEV_PATH);
|
rc = truename(name, PriPathName,
|
||||||
|
CDS_MODE_CHECK_DEV_PATH | CDS_MODE_ALLOW_WILDCARDS);
|
||||||
if (rc < SUCCESS)
|
if (rc < SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@ -1546,7 +1547,7 @@ COUNT DosTruename(const char FAR *src, char FAR *dest)
|
||||||
Therefore, the name is created in an internal buffer
|
Therefore, the name is created in an internal buffer
|
||||||
and copied into the user buffer only on success.
|
and copied into the user buffer only on success.
|
||||||
*/
|
*/
|
||||||
COUNT rc = truename(src, PriPathName, 0);
|
COUNT rc = truename(src, PriPathName, CDS_MODE_ALLOW_WILDCARDS);
|
||||||
if (rc >= SUCCESS)
|
if (rc >= SUCCESS)
|
||||||
fstrcpy(dest, PriPathName);
|
fstrcpy(dest, PriPathName);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
|
@ -532,6 +532,8 @@ COUNT truename(const char FAR * src, char * dest, COUNT mode)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (gotAnyWildcards && !(mode & CDS_MODE_ALLOW_WILDCARDS))
|
||||||
|
return DE_PATHNOTFND;
|
||||||
if (addSep == ADD || p == dest + 2)
|
if (addSep == ADD || p == dest + 2)
|
||||||
{
|
{
|
||||||
/* MS DOS preserves a trailing '\\', so an access to "C:\\DOS\\"
|
/* MS DOS preserves a trailing '\\', so an access to "C:\\DOS\\"
|
||||||
|
|
Loading…
Reference in New Issue