Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: CalebCarroll on August 03, 2021, 06:29:02 PM

Title: Issue with Package Manager, File Permissions Field: "Local path to SMF"
Post by: CalebCarroll on August 03, 2021, 06:29:02 PM
Hello all.  Just to be clear this is not a request for help - this is just to outline a fix for a problem with the "package_ftp" structure:


Sources/Packages.php Line 1575:  $detect_path provides incorrect or incomplete path...
'path' => : $detect_path,

Replacement line to provide correct value obtained from {db_prefix}_settings database table:
'path' => isset($modSettings['package_path']) ? $modSettings['package_path'] : $detect_path,

For reference here is the database table - in my case {db_prefix} = "smf"

mysql> select * from smf_settings where variable rlike "package";
+----------------------+---------------+
| variable             | value         |
+----------------------+---------------+
| package_make_backups |               |
| package_path         | /var/www/html |
| package_server       | localhost     |
| package_port         | 21            |
| package_username     | www-data      |
+----------------------+---------------+
5 rows in set (0.00 sec)
Title: Re: Issue with Package Manager, File Permissions Field: "Local path to SMF"
Post by: Kindred on August 03, 2021, 07:11:02 PM
the path to packages is defined by the variable that defines the board directory and then packages is a subdirectory.

if you have anything else, then you have modified the core routines
Title: Re: Issue with Package Manager, File Permissions Field: "Local path to SMF"
Post by: Aleksi "Lex" Kilpinen on August 04, 2021, 02:10:25 AM
I'm not 100% sure I follow the issue outlined, but the actual FTP accessible directory structure will vary based on your FTP user - There is no real actual way for SMF to know what it is,
so I think the detect_path is simply attempting to provide you with a hint, and anything you fix for yourself might not work for others.
Title: Re: Issue with Package Manager, File Permissions Field: "Local path to SMF"
Post by: CalebCarroll on August 04, 2021, 02:46:48 PM
First of all, I certainly haven't modified core routines.  I did however update from an older version.  Yes, I think $detect_path is related to the FTP user path but it can be set and that setting seems to have been stored in the database (perhaps by a previous version of SMF - I sure didn't place it there).
Title: Re: Issue with Package Manager, File Permissions Field: "Local path to SMF"
Post by: Steve on August 04, 2021, 03:02:09 PM
As this is not really a support request, I'm moving this to the Tips and Tricks board which hopefully is the best place for it.