samba-tng-alpha-2.2.tar.gz

Michael Tokarev mjt at tls.msk.ru
Mon Apr 10 15:09:00 GMT 2000


David Collier-Brown - Sun Canada wrote:
> 
[]
> |
> | David Allan Finch wrote:
> | >
> | > Attempted to build it on Solaris 8 with the following options:
> | []
> | > /usr/include/rpcsvc/nis.h:519: warning: `GROUP' redefined
> | > /usr/include/sys/acl.h:26: warning: this is the location of the previous
> definition
> | []
> | > /usr/include/sys/acl.h
> | > #define GROUP           (0x08)          /* additional groups */
> | >
> | > /usr/include/rpcsvc/nis.h
> | > #define GROUP(a, m)     (((a) & ((m) << 8)) != 0)
> |
> | Huh. This sort of things should be directed to vendor (Solaris, i.e. Sun) people.
> | Sun _should_ fix this -- it is a bug in Solaris.
> | Please complain to Sun if you can.
> 
>         I can do that, can you give me some more information?
>         I'd like a customer who doesn't mind getting email,
>         and Luke if he doesn't mind, and a little bit
>         about using rpcsvc/nis.h and sys/acl.h in the
>         same module: is the expected workaround NOT to
>         include them both?
> 
>         acl.h is needed by acl(2), rpcsvc/nis.h by nis_names, etc
>         and arguably you'd use them together to find file acl infouser info
>         and then user info about the owner of the acl.

Don't know what additional info your need.  From /usr/include/rpcsvc/nis.h (on my Solaris 2.6):
---
/* 
 * EOL Alert - The following non-prefixed test macros are 
 * here for backward compatability, and will be not be present
 * in future releases - use the NIS_*() macros above.
 */
#define WORLD(a, m)     (((a) & (m)) != 0)
#define GROUP(a, m)     (((a) & ((m) << 8)) != 0)
#define OWNER(a, m)     (((a) & ((m) << 16)) != 0)
#define NOBODY(a, m)    (((a) & ((m) << 24)) != 0)
...
---

As stated in comment, these are a compatibility-only #defines, and marked as this
since a long time.  And as such, probably can be wiped out, or, maybe better, surrounded
by some "#ifdef USE_OLD_NIS_NAMES...#endif" constucts.

But here are more:
/usr/include/rpcsvc/nis.h:
--
enum zotypes {
        BOGUS_OBJ = 0,
        NO_OBJ = 1,
        DIRECTORY_OBJ = 2,
        GROUP_OBJ = 3,
        TABLE_OBJ = 4,
        ENTRY_OBJ = 5,
        LINK_OBJ = 6,
        PRIVATE_OBJ = 7,
        NIS_BOGUS_OBJ = 0,
        NIS_NO_OBJ = 1,
        NIS_DIRECTORY_OBJ = 2,
        NIS_GROUP_OBJ = 3,
        NIS_TABLE_OBJ = 4,
        NIS_ENTRY_OBJ = 5,
...
---
The first part, names without NIS_ prefix, probably also compatibility ones (the same
applies to those).

/usr/include/sys/acl.h:
---
#define USER_OBJ        (0x01)          /* object owner */
#define USER            (0x02)          /* additional users */
#define GROUP_OBJ       (0x04)          /* owning group of the object */
#define GROUP           (0x08)          /* additional groups */
#define CLASS_OBJ       (0x10)          /* file group class and mask entry */
#define OTHER_OBJ       (0x20)          /* other entry for the object */
#define ACL_DEFAULT     (0x1000)        /* default flag */
/* default object owner */
#define DEF_USER_OBJ    (ACL_DEFAULT | USER_OBJ)
/* defalut additional users */
...
---
This is (except of ACL_DEFAULT) are BAD practice again, but it is CURRENT (as of solaris 2.6,
I don't have 2.8).  And also should be replaced by ACL_USER_OBJ, ACL_USER etc, as with
NIS files.  But this will definitely broke existing software, and samba also...
Bad practice from beginning, from design.  Woh!.. :(

> | >
> | > Also they is a class with GROUP_OBJ in /usr/include/rpcsvc/nis.h
> | > and some where else in the Samba source.
> 
>         Sorry, I don't know TNG, can you expand on this one?

TNG is just an example of usage of acl calls. And one of acl object type is (ACL_)GROUP_OBJ
(see acl.h earlier and compare to nis.h here...).
Problems here is not in TNG and it's usage of some system headers, but with bad libraries
design.  Any soft that uses both acl and nis can expect such damage...  Only workaround
I see now (while ACL definitions are cleaned out ...) is to split acl and nis calls to
two different files and include only one of acl.h or nis.h.  Argh!

P.S. The same is true with other libraries.  I don't remember exactly, but there was
a times when I edited headers on Solaris, on Linux (aha, expirimental acl.h on linux
inherited from solaris...) etc.  Namespace pollution -- sigh! :(

> 
> --dave
> --
> David Collier-Brown in Boston
> Phone: (781) 442-0734, Room BUR03-3632


More information about the samba-technical mailing list