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