Closed (fixed)
Project:
Drush
Version:
7.x-5.x-dev
Component:
Core Commands
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2012 at 12:49 UTC
Updated:
5 Jun 2013 at 17:50 UTC
I need to set the variable file_chmod_directory which is an octal integer with leading zero. When you set this variable with ...
drush vset file_chmod_directory 0755
...in database you will see:
| file_chmod_directory | i:755; |
The leading zero is missing, changing it into a totally different decimal number. Since the value field is a Blob, you even cannot simply correct this error with phpmyadmin. Please correct this bug, because I don't know any other easy way to set this variable.
Comments
Comment #1
starlocke commentedWhile octal is consise and easy-to-understand by most system admins, since we're limited to decimal values for
file_chmod_directory, it is simply a matter of converting your octal value to a decimal value.A neat one-liner with most *nix command lines to convert numbers to decimal format:
echo $((some_number))Then you plug that value into the
file_chmod_directory.For example:
echo $((02775))-- directory permissions; effectively = rwx:rws:r-x; note that I like using "setgid", known as the octal 02000.drush variable-set file_chmod_directory 1533-- setting the variable using drushRef: http://linuxcommando.blogspot.ca/2008/04/quick-hex-decimal-conversion-us...
Comment #2
greg.1.anderson commentedYes, Drupal expects file_chmod_directory to be stored as an integer. Rather than support octal in vset, it seems that the best solution is, per #1:
drush vset file_chmod_directory $((0755))