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

starlocke’s picture

Version: » 7.x-5.x-dev

While 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 drush

Ref: http://linuxcommando.blogspot.ca/2008/04/quick-hex-decimal-conversion-us...

greg.1.anderson’s picture

Category: bug » support
Status: Active » Fixed

Yes, 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))

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.