Using Drupal 7.39 and Ubercart 7.x-3.8.
I followed the instructions in https://www.drupal.org/node/1309226

First, you must configure the encryption settings for card data during checkout. To do this, you'll need to fill in the filepath textfield. Here you should specify a folder that is outside of your document root (i.e. not in your www or public_html directory) where Ubercart can create a file to hold an encryption key.

You will need to grant permissions on the folder that allow Drupal to write to it, but you can change this once the encryption key file has been created.

The instructions say you have to initially make the directory writeable for Drupal and then it is OK to change it back to, I assume, un-writeable. I set the "keys" directory to 777. I saved the configuration in Home » Administration » Store » Configuration » Payment methods » Credit card settings. No error messages. I verified that the uc_credit.key file was created in the "keys" directory. Then, when I tried to set the "keys" directory attributes to anything but 777 and I refresh the Credit card settings page or save the configuration, I get the following message

Cannot write to directory, please verify the directory permissions.

Also, the Encryption key directory field becomes empty.

I verify that there is the uc_credit.key file and it's in the "keys" directory. When I try to change the "keys" directory's permissions to anything other than 777, and I go to Home » Administration » Store » Configuration » Payment methods » Credit card settings and try save the configuration, I get the following message at :

Cannot write to directory, please verify the directory permissions.

Is it OK to ignore the error message since the uc_credit.key file is in place?
Does Drupal still need access permissions to the directory - does it need read permission?
Why can't I change the directory permissions anything but 777?
What should the "keys" directory permissions be after the uc_credit.key file has been created - I assume 400?

Comments

jabrister created an issue. See original summary.

TR’s picture

Assigned: jabrister » Unassigned
Issue tags: -file attributes encryption key path

I use 755 for the directory and 400 for the key file itself.

longwave’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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