Menu

#574 Compilation error unix.c:ochmod O_IGNORE undeclared in 3.1.3 on Debian Wheezy (amd64, armel)

None
closed
nobody
None
1
2016-07-20
2014-07-21
No

netatalk-3.1.3 fails to compile on Debian Wheezy (tried on both amd64 and armel archs). netatalk-3.1.2 compiles fine on the same machines.

./configure --with-pkgconfdir=/etc/netatalk --with-init-style=debian
make

(...)
make[3]: Entering directory `/home/user/compile/netatalk-3.1.3/libatalk/util'
  CC       libutil_la-bprint.lo
  CC       libutil_la-cnid.lo
  CC       libutil_la-fault.lo
  CC       libutil_la-getiface.lo
  CC       libutil_la-gettok.lo
  CC       libutil_la-locking.lo
  CC       libutil_la-logger.lo
  CC       libutil_la-module.lo
  CC       libutil_la-netatalk_conf.lo
netatalk_conf.c: In function 'creatvol':
netatalk_conf.c:680:25: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
  CC       libutil_la-queue.lo
  CC       libutil_la-server_child.lo
  CC       libutil_la-server_ipc.lo
  CC       libutil_la-server_lock.lo
  CC       libutil_la-socket.lo
  CC       libutil_la-strdicasecmp.lo
  CC       libutil_la-unix.lo
unix.c: In function 'ochmod':
unix.c:272:19: error: 'O_IGNORE' undeclared (first use in this function)
unix.c:272:19: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [libutil_la-unix.lo] Error 1
make[3]: Leaving directory `/home/user/compile/netatalk-3.1.3/libatalk/util'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/user/compile/netatalk-3.1.3/libatalk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/user/compile/netatalk-3.1.3'
make: *** [all] Error 2

Discussion

  • jlec

    jlec - 2014-07-26

    This happens with --without-acls. the acl.h header defining O_IGNORE is only included with acl.

     
  • jlec

    jlec - 2014-07-26
     
  • APastor

    APastor - 2014-08-05

    Will not compile on platforms without ACL support.

    If you do need to compile it before a proper fix is submitted and no ACL support is available:

    1) Modify netatalk/libatalk/util/unix.c so that ochmod() just returns zero (just delete most lines):

    int ochmod(char *path, mode_t mode, const struct stat *st, int options)
    {
        struct stat sb;
    
            return 0;
    }
    

    2) Modify netatalk/include/atalk/volume.h so vol_chmod_opt(vol) always returns zero (replace O_IGNORE with 0):

    #define vol_chmod_opt(vol) (((vol)->v_flags & AFPVOL_CHMOD_PRESERVE_ACL) ? O_NETATALK_ACL : \
                                ((vol)->v_flags & AFPVOL_CHMOD_IGNORE) ? 0 : 0)
    

    That makes it compile on platforms like cygwin and optware where ACLs are not supported. For any large UNIX/Linux variant, running configure --with-acls will work without changes.

     
  • Allen

    Allen - 2014-11-05

    modify include/atalk/acl.h, start at line 63, add #define O_IGNORE 0 to make it look like following:

    #define O_NETATALK_ACL 0
    #define O_IGNORE 0
    #define chmod_acl chmod
    

    which solves the problem failed compile on system without acl support.

     
  • Chris Read

    Chris Read - 2016-01-15

    I got it working with a simple:

    apt-get install libacl1-dev

     
  • avrhack

    avrhack - 2016-01-17

    Or on Centos 7 / RHEL7:

    yum install libacl-devel

     
  •  HAT

    HAT - 2016-07-20

    Fixed in 3.1.9

     
  •  HAT

    HAT - 2016-07-20
    • status: open --> closed
    • Group: -->
     

Log in to post a comment.