proot icon indicating copy to clipboard operation
proot copied to clipboard

Max filename length: 254 vs 255

Open uli-heller opened this issue 11 months ago • 1 comments

Expected Behavior

Creating files with long filenames works identical within PROOT and in the outside world

Outside

$ LEN=255; touch "$(expr substr "$(seq 1 200|tr -d "\n")" 1 $LEN)"; rm -f 12345*

... shows no error

Within PROOT

# LEN=255; touch "$(expr substr "$(seq 1 200|tr -d "\n")" 1 $LEN)"; rm -f 12345*

... should not show an error, too

Actual Behavior

Outside

$ LEN=255; touch "$(expr substr "$(seq 1 200|tr -d "\n")" 1 $LEN)"; rm -f 12345*
$ LEN=256; touch "$(expr substr "$(seq 1 200|tr -d "\n")" 1 $LEN)"; rm -f 12345*
touch: '1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757

In the outside world, I can create files with a name len of 255.

Within PROOT

# LEN=254; touch "$(expr substr "$(seq 1 200|tr -d "\n")" 1 $LEN)"; rm -f 12345*
# LEN=255; touch "$(expr substr "$(seq 1 200|tr -d "\n")" 1 $LEN)"; rm -f 12345*
touch: cannot touch '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869

Within PROOT, I cannot create files with a name len of 255.

Steps to Reproduce the Problem

  1. Extract a root filesystem to a folder, for example ubuntu-22.04 -> jammy
  2. Start proot: proot -S jammy/rootfs/ -w / bash
  3. Create a file: LEN=255; touch "$(expr substr "$(seq 1 200|tr -d "\n")" 1 $LEN)"

Specifications

  • Proot/Care version: 5.4.0
  • Kernel version: 5.15.0-130-generic #140~20.04.1-Ubuntu
  • Host distribution: Ubuntu-20.04
  • Guest distribution: Ubuntu-22.04

Command Output

# LEN=255; touch "$(expr substr "$(seq 1 200|tr -d "\n")" 1 $LEN)";
touch: cannot touch '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121': File name too long

uli-heller avatar Jan 03 '25 14:01 uli-heller

I tried creating the long filename within a bind mounted folder. Doesn't work either.

uli-heller avatar Jan 03 '25 14:01 uli-heller