Bug 3686 - Testparm can't use relative paths
Testparm can't use relative paths
Product: Samba 3.0
Classification: Unclassified
Component: Config Files
All All
: P3 normal
: none
Assigned To: Amit Regmi
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2006-04-15 13:32 UTC by David S. Collier-Brown
Modified: 2006-04-29 11:16 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description David S. Collier-Brown 2006-04-15 13:32:36 UTC
froggy> samba testparm  ./smb.conf
Load smb config files from ./smb.conf
params.c:OpenConfFile() - Unable to open configuration file "./smb.conf":
        No such file or directory
Error loading services.

This is startling: ./smb.conf is a perfectly legal and
proper path.  Truss/strace suggests that we are not in the
directory where we started, as open returns ENOENT:

9914:   open64("./smb.conf", O_RDONLY)                  Err#2 ENOENT

By the same logic, it is not running from root, as ./usr/local/samba/lib/smb.conf fails as well.

This looks rather as if someone is calling chdir(1)
as a side-effect, as there is no deliberate call
to chdir in tbe path from testparm:main() to the
open call...
Comment 1 Gerald (Jerry) Carter 2006-04-20 08:35:46 UTC
Amit, please look into this.  First make sure you can reproduce Dave's
report.  Thanks.
Comment 2 Amit Regmi 2006-04-29 11:16:21 UTC
The problem David reported can not be re-produced. (I could not).
To my knowledge ... exactly similar output I got when the file (smb.conf) was not present in the current directory (./smb.conf) . So that must have been the issue with David. 

[quote] "By the same logic, it is not running from root, as
./usr/local/samba/lib/smb.conf fails as well. "[quote]

This is sure to fail. Because there won't be any valid directory structure like the one Used here .. unless David was in the root (/) directory .. 

This might Help.