[Bug 287183] nuageinit fails to execute shell script due to permission issues

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 31 May 2025 09:31:07 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287183

            Bug ID: 287183
           Summary: nuageinit fails to execute shell script due to
                    permission issues
           Product: Base System
           Version: 14.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: olgeni@FreeBSD.org

Created attachment 260829
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=260829&action=edit
nuageinit script exec fix

nuageinit fails to execute user-data shell scripts on Digital Ocean because
their platform (possibly others?) delivers these files without executable
permissions.

When nuageinit processes a user-data file, it checks if the first line is
"#cloud-config". If not, it attempts to execute the file directly using
os.execute(), which fails with "Permission denied" when the file lacks
executable permissions.

The fix involves detecting #!/bin/sh scripts and executing them through sh
directly. This minimal change allows nuageinit to work with non-executable
shell scripts while maintaining backward compatibility \o/

Tested on Digital Ocean and now the script is now running correctly.

-- 
You are receiving this mail because:
You are the assignee for the bug.