comp.lang.ada
 help / color / mirror / Atom feed
From: mockturtle <framefritti@gmail.com>
Subject: Raising "exception" in a .gpr file
Date: Fri, 13 Aug 2021 00:23:14 -0700 (PDT)	[thread overview]
Message-ID: <ce96c9ca-ae18-4ccd-a6c9-768a6a28ff8cn@googlegroups.com> (raw)

Dear.all,
I am linting an old library of mine (suid_helper) thought to help in writing setuid programs. (Basically, it drops suid privileges when program starts and allows to run in privileged mode only via few selected procedures, see https://gitlab.com/mockturtle/suid-helper  if you are curious).

At the moment the library works for Linux (since I use Linux) and I guess it could work with most other *nixes (but setuid stuff portability is tricky).  
As you can imagine, there is a part that is OS-dependent.  I isolated it into a directory that is selected in the gpr files on the basis of the current OS 

(BTW: I am using an external value for this, there is some more "standard" way to get the OS within the gpr file?)

For sure it does not work with Windows since that OS does not have the concept of "setuid executable" (as far as I know).  
It would be nice to be able to "raise an exception" when the OS is Windows, in the sense that the user that tries to compile (by mistake) the library under Windows  gets a message like 

"You cannot compile this in Windows since Windows has no setuid concept"

rather than getting some mysterious compile error later.

Just to be clear, I am thinking to something like


  case OS is
  ...when "linux" =>
   ......Arch_Sources := "src/Linux";

  ...when "macos" =>
   ......Arch_Sources := "src/Mac";

  ...when "windows" =>
   ......raise "This library makes no sense with this OS";
    end case;

I tried to look in the manual, this newsgroup and googled a bit, but I did not find anything.  I am afraid that this is not possible (although I think it could be a nice addition).

Do you know if this is possible and how?

Thank you in advance

Riccardo

             reply	other threads:[~2021-08-13  7:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13  7:23 mockturtle [this message]
2021-08-13  7:44 ` Raising "exception" in a .gpr file Dmitry A. Kazakov
2021-08-13  8:11   ` mockturtle
2021-08-13 15:40     ` Björn Lundin
2021-08-15 16:00       ` Mark Lorenzen
2021-08-15 16:21 ` Britt
2021-08-16 13:13 ` Fabien Chouteau
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox