Motion - Bug Report 2008x 02x 25x 013419
You are here: Foswiki>Motion Web>BugReports>BugReport2008x02x25x013419 (18 May 2008, AngelCarpintero)Edit Attach

BUG: motion can't open motion.conf

Describe the bug in plain text here. Paste in error messages and other text where new-lines must be preserved in the field below

angel and i found that when motion is started as ./motion, it can't open motion.conf for writing, when you try to write config changes in the web interface.

Paste in your error messages, config settings, terminal window output etc in this text field.

error angel discovered was:

Feb 24 18:20:34 cheetah motion: [0] Error opening file motion.conf with mode w: Permission denied

the following patch fixes the problem:

Index: conf.c
===================================================================
--- conf.c      (revision 318)
+++ conf.c      (working copy)
@@ -1620,7 +1620,7 @@
        if (!fp){      /* Commandline didn't work, try current dir */
                if (cnt[0]->conf_filename[0])
                        motion_log(-1, 1, "Configfile %s not found - trying defaults.", filename);
-               sprintf(filename, "motion.conf");
+               snprintf(filename, PATH_MAX, "%s/motion.conf", get_current_dir_name());
                fp = fopen (filename, "r");
        }
        if (!fp) {     /* specified file does not exist... try default file */

Environment

Motion version: motion trunk r318
ffmpeg version: ffmpeg-0.4.9-26_r12135.fc7
Shared libraries: ffmpeg, mysql, postgresql
Server OS: fedora 7

-- JohnBray - 25 Feb 2008

Follow up

Fix record

Thanks John, already committed in trunk.

-- AngelCarpintero - 25 Feb 2008
Topic revision: r3 - 18 May 2008, AngelCarpintero
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.