Bug 16008 - Building fails if the source path contain a space
Summary: Building fails if the source path contain a space
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.23.4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-02-23 11:32 UTC by R. Diez
Modified: 2026-02-25 20:50 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description R. Diez 2026-02-23 11:32:01 UTC
I needed a newer version of tool smbcacls because of its new options '--save savefile' and '--recurse'. So I downloaded the sources (samba-4.23.4.tar.gz) and built Samba like this:

cd "$HOME/name with spaces/samba-4.23.4"
./configure --prefix="$HOME/name with spaces/samba-4.23.4-bin"
make

After a while, I got this error:

[640/770] Processing librpc/idl/browser.idl
/usr/bin/python3: can't open file '/home/rdiez/name': [Errno 2] No such file or directory

I am guessing that the invocation of the Python tool which processes such IDL files is not properly quoting/escaping the filename argument, and that is why the filename argument breaks at the first space in "/home/rdiez/name with spaces".

There are 2 ways to fix this issue:

1) Check upfront that the source path contains no spaces, tabs, and probably any problematic shell characters too, depending on how the invocation of that Python script is coded.

2) Properly quote all arguments to that Python script.

I personally would change the Continuous Integration to build with a source directory which contains a space, and possibly other problematic shell characters like $. That way, you can be pretty confident that all paths are properly quoted everywhere.
Comment 1 R. Diez 2026-02-25 20:50:22 UTC
I would start with the "configure" shell script. This is a fixed version (better too many quotes, just in case, than too few):


#!/bin/sh

PREVPATH="$(dirname "$0")"

WAF="./buildtools/bin/waf"

# using JOBS=1 gives maximum compatibility with
# systems like AIX which have broken threading in python
JOBS=1
export JOBS

# Make sure we don't have any library preloaded.
unset LD_PRELOAD

# Make sure we get stable hashes
PYTHONHASHSEED=1
export PYTHONHASHSEED

cd . || exit 1
"$PYTHON" "$WAF" configure "$@" || exit 1
cd "$PREVPATH"