WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TC 8.? and TC 9.0 filename globing of ash ignores names of broken symlinks  (Read 4613 times)

Offline TinyErestor

  • Newbie
  • *
  • Posts: 15
Hello,

possibly since TC 8.0 ash in busybox does not include filenames of broken symlinks into the results of filename globbing.
As an example:
Code: [Select]
mkdir glob_test
ln -s missing glob_test/broken
echo glob_test/br*
should echo
Code: [Select]
glob_test/broken but echos
Code: [Select]
glob_test/br*
I remeber, in some other context, something like that was mentioned. But it was not about filename pattern in ash but about rm or mv on such broken symlinks.

And I have not found another topic about that bug in this forum.

Regards

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
This error only happens with 32bit Core and not 64bit CorePure - both use the same busybox config

The error has been reported to busybox, but they cannot reproduce it.

Offline TinyErestor

  • Newbie
  • *
  • Posts: 15
Hello,

in the topic about the new release TC 9.0 I found this statement:
Quote
Note that there is a pending issue in that the 32-bit busybox mv will not move broken symlinks - this seems to be caused by updated versions of gcc and/or glibc.
I have tested the mv command in TC 9.0 and it works with broken symlinks:
Code: [Select]
mkdir glob_test
ln -s missing glob_test/broken
mv glob_test/broken glob_test/newname
ls glob_test
results in
Code: [Select]
newname. The mv worked.
Used software:
Code: [Select]
tc@AcerBox:~$ type mv
mv is /bin/mv
tc@AcerBox:~$ ls -l /bin/mv
lrwxrwxrwx    1 root     root             7 Jan  6 13:10 /bin/mv -> busybox
tc@AcerBox:~$ ls -l /bin/busybox
-rwxr-xr-x    1 root     root        497371 Nov  6 15:00 /bin/busybox
tc@AcerBox:~$ ldd /bin/busybox
linux-gate.so.1 (0xf7788000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xf7743000)
libm.so.6 => /lib/libm.so.6 (0xf7703000)
libc.so.6 => /lib/libc.so.6 (0xf75f0000)
/lib/ld-linux.so.2 (0x565ed000)

So, the above mentioned issue is realy this bug with the globing?
I may see into it, the used sources are in the TinyCore repositories, I guess.

Regards

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
If you try this:
Code: [Select]
$ mkdir -p test/old test/new
$ cd test/old
$ touch some-file
$ ln -s some-file good-link
$ ln -s no-file bad-link
$ mv * ../new
$ cd ..
$ find

The broken link "bad-link" will remain in the old directory, and not get moved to the new directory. In 64-bit they all get moved, as they should.

The busybox source and config are at:

http://tinycorelinux.net/8.x/x86/release/src/busybox/

Note that I have tried busybox-1.28.1 and the problem remains.

Offline TinyErestor

  • Newbie
  • *
  • Posts: 15
Hi Juanito,

The broken link "bad-link" will remain in the old directory, and not get moved to the new directory. In 64-bit they all get moved, as they should.
yes, but this is not the fault of mv. It is the fault of the shell, which expands * wrongly.

Quote
The busybox source and config are at:

http://tinycorelinux.net/8.x/x86/release/src/busybox/

Note that I have tried busybox-1.28.1 and the problem remains.
Thanks, I will take a look.

Regards

Offline TinyErestor

  • Newbie
  • *
  • Posts: 15
Hi Juanito,

I have tested a little with the configuration of busybox:
When I create a busybox after
Code: [Select]
make defconfig and commenting the 3 SUID settings out, the busybox globs the broken symlinks correctly and its top reacts on keys.
When I create a busybox with your
Code: [Select]
busybox-1.27.2_config_nosuid as
Code: [Select]
.config and without your patches, the glob and the top are broken.

I will continue to check the different configuration options.

Regards

Offline TinyErestor

  • Newbie
  • *
  • Posts: 15
Hi Juanito,

I see, the busybox configuration was changed in the last hours. I guess, you have set these features and options, which resolves this and the top issues..

Regards

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
I was tidying up and symlinked the x86_64 config to the x86 config, since they are the same, but I don't believe anything changed - for me at least there is still a problem with the 32-bit busybox

Offline TinyErestor

  • Newbie
  • *
  • Posts: 15
Hi Juanito,

when I do a diff -u between the last two downloaded configurations, I get this:
Code: [Select]
--- busybox-1.27.2_config_nosuid.org 2018-03-17 15:35:01.000000000 +0100
+++ busybox-1.27.2_config_nosuid 2018-03-17 15:51:36.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Busybox version: 1.27.2
-# Sun Jan 14 10:22:25 2018
+# Tue Sep 12 13:00:13 2017
 #
 CONFIG_HAVE_DOT_CONFIG=y
 
@@ -181,10 +181,10 @@
 CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y
 # CONFIG_FEATURE_TAR_SELINUX is not set
 CONFIG_UNZIP=y
-# CONFIG_FEATURE_UNZIP_CDF is not set
-# CONFIG_FEATURE_UNZIP_BZIP2 is not set
-# CONFIG_FEATURE_UNZIP_LZMA is not set
-# CONFIG_FEATURE_UNZIP_XZ is not set
+CONFIG_FEATURE_UNZIP_CDF=y
+CONFIG_FEATURE_UNZIP_BZIP2=y
+CONFIG_FEATURE_UNZIP_LZMA=y
+CONFIG_FEATURE_UNZIP_XZ=y
 
 #
 # Coreutils
@@ -999,7 +999,7 @@
 # CONFIG_SMEMCAP is not set
 CONFIG_BB_SYSCTL=y
 CONFIG_TOP=y
-# CONFIG_FEATURE_TOP_INTERACTIVE is not set
+CONFIG_FEATURE_TOP_INTERACTIVE=y
 CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
 CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
 CONFIG_FEATURE_TOP_SMP_CPU=y
@@ -1053,7 +1053,7 @@
 CONFIG_BASH_IS_NONE=y
 CONFIG_ASH=y
 CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
-# CONFIG_ASH_INTERNAL_GLOB is not set
+CONFIG_ASH_INTERNAL_GLOB=y
 CONFIG_ASH_BASH_COMPAT=y
 CONFIG_ASH_JOB_CONTROL=y
 CONFIG_ASH_ALIAS=y
CONFIG_FEATURE_TOP_INTERACTIVE tells top to react on the keys and CONFIG_ASH_INTERNAL_GLOB corrects the glob in ash so far as I see the consequences. Maybe when building the busybox put into the initrd, you had some not wanted configurations?

Regards

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
I'm pretty sure that the same config files were used, but I'll double-check in the next couple of days.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
If I recompile in core-9.x, I can get top working as expected, but the broken symlinks/glob issue remains (it is OK with defconfig).

If I recompile in core-7.x, then everything is OK - this matches my previous findings.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
core-9.x reposted with updated busybox