* fhandler_disk_file.cc (fhandler_disk_file::readdir): Reorganize to avoid
inappropriate .lnk extensions with munged filenames under managed mode.
This commit is contained in:
parent
cc2a11e0d0
commit
93eba3cb60
|
@ -1,3 +1,9 @@
|
||||||
|
2003-11-27 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* fhandler_disk_file.cc (fhandler_disk_file::readdir): Reorganize to
|
||||||
|
avoid inappropriate .lnk extensions with munged filenames under managed
|
||||||
|
mode.
|
||||||
|
|
||||||
2003-11-26 Corinna Vinschen <corinna@vinschen.de>
|
2003-11-26 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* sec_helper.cc (set_process_privilege): Rename restore_priv to
|
* sec_helper.cc (set_process_privilege): Rename restore_priv to
|
||||||
|
|
|
@ -704,29 +704,29 @@ fhandler_disk_file::readdir (DIR *dir)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We get here if `buf' contains valid data. */
|
|
||||||
if (get_encoded ())
|
|
||||||
(void) fnunmunge (dir->__d_dirent->d_name, buf.cFileName);
|
|
||||||
else
|
|
||||||
strcpy (dir->__d_dirent->d_name, buf.cFileName);
|
|
||||||
|
|
||||||
/* Check for Windows shortcut. If it's a Cygwin or U/WIN
|
/* Check for Windows shortcut. If it's a Cygwin or U/WIN
|
||||||
symlink, drop the .lnk suffix. */
|
symlink, drop the .lnk suffix. */
|
||||||
if (buf.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
|
if (buf.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
|
||||||
{
|
{
|
||||||
char *c = dir->__d_dirent->d_name;
|
char *c = buf.cFileName;
|
||||||
int len = strlen (c);
|
int len = strlen (c);
|
||||||
if (strcasematch (c + len - 4, ".lnk"))
|
if (strcasematch (c + len - 4, ".lnk"))
|
||||||
{
|
{
|
||||||
char fbuf[CYG_MAX_PATH + 1];
|
char fbuf[CYG_MAX_PATH + 1];
|
||||||
strcpy (fbuf, dir->__d_dirname);
|
strcpy (fbuf, dir->__d_dirname);
|
||||||
strcpy (fbuf + strlen (fbuf) - 1, dir->__d_dirent->d_name);
|
strcpy (fbuf + strlen (fbuf) - 1, c);
|
||||||
path_conv fpath (fbuf, PC_SYM_NOFOLLOW);
|
path_conv fpath (fbuf, PC_SYM_NOFOLLOW);
|
||||||
if (fpath.issymlink () || fpath.isspecial ())
|
if (fpath.issymlink () || fpath.isspecial ())
|
||||||
c[len - 4] = '\0';
|
c[len - 4] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We get here if `buf' contains valid data. */
|
||||||
|
if (get_encoded ())
|
||||||
|
(void) fnunmunge (dir->__d_dirent->d_name, buf.cFileName);
|
||||||
|
else
|
||||||
|
strcpy (dir->__d_dirent->d_name, buf.cFileName);
|
||||||
|
|
||||||
dir->__d_position++;
|
dir->__d_position++;
|
||||||
res = dir->__d_dirent;
|
res = dir->__d_dirent;
|
||||||
syscall_printf ("%p = readdir (%p) (%s)",
|
syscall_printf ("%p = readdir (%p) (%s)",
|
||||||
|
|
Loading…
Reference in New Issue