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

Characters not properly escaped or quoted in path #241

Closed
cwinebrinner opened this issue Jul 3, 2017 · 7 comments
Closed

Characters not properly escaped or quoted in path #241

cwinebrinner opened this issue Jul 3, 2017 · 7 comments

Comments

@cwinebrinner
Copy link

remove_cmd '/home/user/mnt/usb/Backup/Desktop [20110731]/Documents/Java Documentation & Books/JDK 6 Docs/jre/api/security/smartcardio/spec/package-list' '/home/user/mnt/usb/Backup/Desktop [20110731-alt]/Documents/Java Documentation & Books/JDK 6 Docs/jre/api/security/smartcardio/spec/package-list' # duplicate

[ 3%] Deleting: /home/user/mnt/usb/Backup/Desktop [20110731]/Documents/Java Documentation & Books/JDK 6 Docs/jre/api/security/smartcardio/spec/package-list
ls: cannot access '[20110731]/Documents/Java': No such file or directory
ls: cannot access 'Documentation': No such file or directory
ls: cannot access '&': No such file or directory
ls: cannot access 'Books/JDK': No such file or directory
ls: cannot access '6': No such file or directory
ls: cannot access 'Docs/jre/api/security/smartcardio/spec': No such file or directory

@sahib
Copy link
Owner

sahib commented Jul 3, 2017

Thanks for that report, but something is weird here. We do quote our commands. You can actually see that
in the command you posted. Manually pasting that command will actually work fine.

You also forgot to tell us which version you are using, which operating system you're running and which shell you're using. Also the rmlint.sh in question would be helpful.

@cwinebrinner
Copy link
Author

cwinebrinner commented Jul 3, 2017 via email

@cwinebrinner
Copy link
Author

I just found the code using my phone and I believe the relevant bit is:

while [ ! "$(ls -A $DIR)" ]; do

I am by no means an expert in shell scripting, but it appears to me that $DIR isn't quoted there.

@sahib
Copy link
Owner

sahib commented Jul 3, 2017

Sorry then, I also only had a quick look at your example; I should have spotted the ls.
You appear to be right in all points otherweise. This code was added in the latest release also.

I'll push a fix tomorrow and a testcase for that (we have one, but that one didn't trigger...)

SeeSpotRun added a commit to SeeSpotRun/rmlint that referenced this issue Jul 3, 2017
SeeSpotRun added a commit to SeeSpotRun/rmlint that referenced this issue Jul 3, 2017
SeeSpotRun added a commit to SeeSpotRun/rmlint that referenced this issue Jul 3, 2017
@SeeSpotRun
Copy link
Collaborator

SeeSpotRun commented Jul 3, 2017

but that one didn't trigger...

It will only trigger if rmlint.sh is run with -c option

Should be fixed by #242

@sahib
Copy link
Owner

sahib commented Jul 4, 2017

Thanks for the PR @SeeSpotRun, had to make a small comment there, but looks good to me otherwise.

It will only trigger if rmlint.sh is run with -c option

Right. Not my brightest hour.

@sahib
Copy link
Owner

sahib commented Jul 4, 2017

Should be closed as of c9f5eaa (and the followup commits).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants