Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max filename length: 254 vs 255 #391

Open
uli-heller opened this issue Jan 3, 2025 · 1 comment · May be fixed by #392
Open

Max filename length: 254 vs 255 #391

uli-heller opened this issue Jan 3, 2025 · 1 comment · May be fixed by #392

Comments

@uli-heller
Copy link

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 How compile PRoot for aarch64 #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
Copy link
Author

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

@uli-heller uli-heller linked a pull request Jan 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant