Menu

#198 appmgr: install action files executable

open
nobody
None
2026-06-10
2026-06-03
Trung Le
No

I bumped into this issue when I was packaging CDE for Fedora

The dtfile only treats a file as an action when it is executable. In cde/programs/dtfile/Directory.c:904-911, a regular file is classified DtEXECUTABLE only if one of the execute bits is set, otherwise DtDATA:

  else if ((stat_buf.st_mode & S_IFMT) == S_IFREG)
  {
     if ((stat_buf.st_mode & S_IXUSR) ||
         (stat_buf.st_mode & S_IXGRP) ||
         (stat_buf.st_mode & S_IXOTH))
        file_data->physical_type = DtEXECUTABLE;
     else
        file_data->physical_type = DtDATA;
  }

A DtDATA file gets the default "open" behavior (text editor); only a DtEXECUTABLE file whose name matches an action in the *.dt database is launched as that action. The action template even documents this requirement in its own header comment ("If this file is executable and the name of the file matches an entry in the action database, the CDE File Manager will treat this file as an action").

But the Application Manager entries are installed without the execute bit:

  • The source template cde/programs/types/action is mode 0644.
  • cde/programs/localized/templates/appmgr.am copies it into every entry verbatim, preserving
    0644:
    $(appmgr_allfiles): $(ACTION)
    $(CP) $(ACTION) $@ || $(RM) $@

So every installed action file is non-executable → DtDATA → opens as text.

On Fedora there is an additional twist: even if the bit is set later, the rpm pipeline's
brp-mangle-shebangs strips the execute bit from any "executable" whose first line is not a #!shebang — and the template's first line is a # comment — so it reverses the bit before the package payload is built.

1 Attachments

Discussion

  • Jon Trulson

    Jon Trulson - 2026-06-07

    Hmm. On current master, the action files are indeed installed as 644. But what seems strange is that on my ubuntu system, I do not see these actions opening up in dtpad - they try to actually run the Action "TYPE COMMAND".

    I had thought that is what was considered when deciding what is data and what is executable. Maybe I'm missing something?

    Here, I went in to Application Manager -> Graphics -> Xv

    And this was the result (see attachment):

     

    Last edit: Jon Trulson 2026-06-07
    • Jon Trulson

      Jon Trulson - 2026-06-07

      Correction: I DO NOT see these actions opening up in dtpad

       
      • Trung Le

        Trung Le - 2026-06-10

        @jon13 let me try to verify this issue again on my end with a fresh build in sandbox environment

         

Log in to post a comment.

Auth0 Logo