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

Bugfix: filenames w/ special characters and permissions #547

Merged
merged 1 commit into from Oct 29, 2013

Conversation

@cchandler
Copy link

cchandler commented Sep 12, 2013

Filenames containing special characters like '%' won't stat correctly because they've already been sanitized and the current working directory could potentially be off.

I've added a test case for this but it's kind of gross. I didn't see a way to get at file permissions from the RPM object, but maybe I'm just missing something. Feedback on making it cleaner would be appreciated :-)

Filenames containing special characters like '%' won't stat correctly
because they've already been sanitized and the current working directory could
potentially be off.
@pforman

This comment has been minimized.

Copy link

pforman commented on 0a7bba9 Sep 13, 2013

I was working on the same bug today, weird.

Your solution is much nicer, so I'll close my pull request in favor of this one. The only thing I'd say is that the "File.stat" on your line 143 should be "File.lstat", or fpm will crash on a symbolic link with no target instead of preserving it in the RPM.

Also, running --rpm-use-file-permissions without --rpm-auto-add-directories will create some weird results, since directories will use default user:group and permissions instead of the source permissions.

@jf647

This comment has been minimized.

Copy link

jf647 commented Oct 24, 2013

Any chance this is going to get folded in? It's required to package rails apps if you ship the installed gem because it includes paths like

railties-4.0.0/lib/rails/generators/rails/plugin_new/templates/app/controllers/%name%

jordansissel added a commit that referenced this pull request Oct 29, 2013
Bugfix: filenames w/ special characters and permissions
@jordansissel jordansissel merged commit 015905e into jordansissel:master Oct 29, 2013
@jordansissel

This comment has been minimized.

Copy link
Owner

jordansissel commented Oct 29, 2013

Merged! Thank you for your patience and also for helping improve fpm!

@shrijeet

This comment has been minimized.

Copy link

shrijeet commented Sep 4, 2014

I encountered issue described the user in this comment #547 (comment). I have symlinks with non existing targets & I want to preserve file permissions. Unless I replace stat with lstat, rpm creation fails with ENOENT error.

My FPM command is using both rpm-auto-add-directories and rpm-use-file-permissions flags.

prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014
Bugfix: filenames w/ special characters and permissions
prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014
Bugfix: filenames w/ special characters and permissions
jordansissel added a commit that referenced this pull request Apr 24, 2015
Bugfix: filenames w/ special characters and permissions
jordansissel added a commit that referenced this pull request Jun 20, 2016
Bugfix: filenames w/ special characters and permissions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.