Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-08

unix platform maintainers :setuid, setsgid

4 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marco van de Voort

Not all permission bits have constants predeclared. Michael and I checked and Linux/FreeBSD/Darwin all have the upper bits declared like this:

#define S_ISUID 0004000 /* [XSI] set user id on execution */ #define S_ISGID 0002000 /* [XSI] set group id on execution #define S_ISVTX 0001000 /* [XSI] directory restrcted delete #define S_ISTXT S_ISVTX /* sticky bit: not supported */

Hereby a request to other "unix" port maintainers to check their headers to see if your OS implements these constants. (Solaris and Haiku mainly I guess, though the sleeping QNX and netwarelibc ports too I assume)

Note that the latter two are both the sticky bit, the TXT alias is the original BSD symbol for it, the VTX declaration the current (XSI/POSIX) name. Most manpages warn that the sticky bit is hardly implemented, so it is probably less important than the other two.

Reply by email

Ludo Brands
to Marco van de Voort
Show quoted text 25 lines
Not all permission bits have constants predeclared. Michael and I checked and Linux/FreeBSD/Darwin all have the upper bits declared like this: #define S_ISUID 0004000 /* [XSI] set user id on execution */ #define S_ISGID 0002000 /* [XSI] set group id on execution #define S_ISVTX 0001000 /* [XSI] directory restrcted delete #define S_ISTXT S_ISVTX /* sticky bit: not supported */ Hereby a request to other "unix" port maintainers to check their headers to see if your OS implements these constants. (Solaris and Haiku mainly I guess, though the sleeping QNX and netwarelibc ports too I assume) Note that the latter two are both the sticky bit, the TXT alias is the original BSD symbol for it, the VTX declaration the current (XSI/POSIX) name. Most manpages warn that the sticky bit is hardly implemented, so it is probably less important than the other two.

solaris 10 x86. From sys/stat.h:

#define S_ISUID 0x800 /* set user id on execution */ #define S_ISGID 0x400 /* set group id on execution */ #define S_ISVTX 0x200 /* save swapped text even after use */

S_ISTXT is not defined

Ludo

Reply by email

Olivier Coursière
to Marco van de Voort: Not all permission bits have constants predeclared. Michael and I checked and…

Hi,

Marco van de Voort wrote 16 lines
Not all permission bits have constants predeclared. Michael and I checked and Linux/FreeBSD/Darwin all have the upper bits declared like this: #define S_ISUID 0004000 /* [XSI] set user id on execution */ #define S_ISGID 0002000 /* [XSI] set group id on execution #define S_ISVTX 0001000 /* [XSI] directory restrcted delete #define S_ISTXT S_ISVTX /* sticky bit: not supported */ Hereby a request to other "unix" port maintainers to check their headers to see if your OS implements these constants. (Solaris and Haiku mainly I guess, though the sleeping QNX and netwarelibc ports too I assume) Note that the latter two are both the sticky bit, the TXT alias is the original BSD symbol for it, the VTX declaration the current (XSI/POSIX) name. Most manpages warn that the sticky bit is hardly implemented, so it is probably less important than the other two.

Under Haiku, those symbols are defined like this in sys/stat.h :

#define S_IUMSK 07777 /* user settable bits */

#define S_ISUID 04000 /* set user id on execution */ #define S_ISGID 02000 /* set group id on execution */

#define S_ISVTX 01000 /* save swapped text even after use (sticky bit) */

S_ISTXT is not declared and i have included S_IUMSK as i thought it might be related (but i have no knowledge in that area).

Olivier

Reply by email

Armin Diehl
to Marco van de Voort: Not all permission bits have constants predeclared. Michael and I checked and…
Marco van de Voort wrote 22 lines
Not all permission bits have constants predeclared. Michael and I checked and Linux/FreeBSD/Darwin all have the upper bits declared like this: #define S_ISUID 0004000 /* [XSI] set user id on execution */ #define S_ISGID 0002000 /* [XSI] set group id on execution #define S_ISVTX 0001000 /* [XSI] directory restrcted delete #define S_ISTXT S_ISVTX /* sticky bit: not supported */ Hereby a request to other "unix" port maintainers to check their headers to see if your OS implements these constants. (Solaris and Haiku mainly I guess, though the sleeping QNX and netwarelibc ports too I assume) Note that the latter two are both the sticky bit, the TXT alias is the original BSD symbol for it, the VTX declaration the current (XSI/POSIX) name. Most manpages warn that the sticky bit is hardly implemented, so it is probably less important than the other two. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

for netwlibc they are defined as follows:

{ POSIX setuid(), setgid(), and sticky...  }
      S_ISUID = $0800;
      S_ISGID = $0400;
      S_ISVTX = $0200;

S_ISTXT is not defined

Reply by email