owncloud / client

🖥️ Desktop Syncing Client for ownCloud
GNU General Public License v2.0
1.4k stars 663 forks source link

ConfigFile::excludeFileFromSystem() is returning relative path to etc dir on FreeBSD #8373

Open tuaris opened 3 years ago

tuaris commented 3 years ago

I am upgrading the owncloudclient FreeBSD port from v2.6.0 to v2.7.4 and I am receiving an error saying ownCloud "Could not read system exclude file".

Expected behavior

ConfigFile::excludeFileFromSystem() should return /usr/local/etc/ownCloud

Actual behavior

ConfigFile::excludeFileFromSystem() is returning etc/ownCloud

Steps to reproduce

  1. Build and install client v 2.7.4
  2. Launch
  3. Observe error

Client configuration

Client version: 2.7.4

Operating system: FreeBSD

OS language: English

Logs

01-18 13:14:24:346 [ info sync.configfile ]:    Adding system ignore list to csync: "/usr/home/danny/Shared/Development/ports/deskutils/owncloudclient/etc/ownCloud/sync-exclude.lst"
01-18 13:14:24:346 [ warning gui.folder ]:  Could not read system exclude file

Ktrace shows that it is resolving to a relative path:

 18231 owncloud NAMI  "/usr/home/danny/Shared/Development/ports/deskutils/owncloudclient"
 18231 owncloud RET   __getcwd 0
....
 18231 owncloud STRU  struct stat {dev=10202492494433145596, ino=288741, mode=0100600, nlink=1, uid=1001, gid=1001, rdev=18446744073709551615, atime=1610996815.863931000, mtime=1610996815.864050000, ctime=1610996815.865155000, birthtime=1610996815.863931000, size=1631, blksize=4096, blocks=1, flags=0x800 }
 18231 owncloud RET   fstatat 0
 18231 owncloud CALL  access(0x807108598,0<F_OK>)
 18231 owncloud NAMI  "etc/ownCloud/sync-exclude.lst"
 18231 owncloud RET   access -1 errno 2 No such file or directory
tuaris commented 3 years ago

Here is a ktrace for v2.6.0 showing the path is being resolved correctly

 18303 owncloud RET   fstatat 0
 18303 owncloud CALL  access(0x809a11af8,0<F_OK>)
 18303 owncloud NAMI  "/usr/local/etc/ownCloud/sync-exclude.lst"
 18303 owncloud RET   access 0
 18303 owncloud CALL  write(0x1f,0x80763fa58,0x7c)
 18303 owncloud GIO   fd 31 wrote 124 bytes
       "01-18 14:25:08:637 [ info sync.configfile ]:    Adding system ignore list to csync: "/usr/local/etc/ownCloud/sync-exclude.lst"
tuaris commented 3 years ago

I was able to work around the problem by passing -DSYSCONF_INSTALL_DIR="${PREFIX}/etc" to the cmake args. (where PREFIX is an env usually set to /usr/local).

This wasn't necessary in any previous versions, but it's fine if it required going forward.

github-actions[bot] commented 3 years ago

This issue was marked stale because it has been open for 30 days with no activity. Remove the stale label or comment or this will be closed in 7 days.