]> arthur.barton.de Git - netatalk.git/commitdiff
Use SUSv3 with Extensions, disable more AT
authorFrank Lahm <franklahm@googlemail.com>
Thu, 2 Dec 2010 14:00:30 +0000 (15:00 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Thu, 2 Dec 2010 14:00:30 +0000 (15:00 +0100)
configure.in
etc/afpd/status.c
etc/afpd/uam.c
include/atalk/dsi.h
include/atalk/util.h
libatalk/Makefile.am
libatalk/compat/rquota_xdr.c

index 3d25dc56d83290fc66e2d005b59a64b777e08088..76b3065a75e7cb42a18c9dbfaadd0f065b948741 100644 (file)
@@ -1261,8 +1261,8 @@ AC_CHECK_HEADER([uuid/uuid.h],
                 AC_MSG_ERROR([missing header <uuid/uuid.> from libuuid required for TimeMachine]))
 
 dnl --------------------- last minute substitutions
-dnl Request SUSv4 standard interfaces
-CFLAGS="$CFLAGS -D_XOPEN_SOURCE=700"
+dnl Request SUSv3 standard interfaces
+CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D__EXTENSIONS__"
 AC_SUBST(LIBS)
 AC_SUBST(CFLAGS)
 AC_SUBST(OVERWRITE_CONFIG)
index bcdca483f38c5d5e3b6ca54fe3e4a533d7c62907..56d61903aec12f44d2b7a0a521abfa7d57aa3ec1 100644 (file)
@@ -90,14 +90,16 @@ static int status_server(char *data, const char *server, const struct afp_option
 
     /* extract the obj part of the server */
     Obj = (char *) server;
+#ifndef NO_DDP
     nbp_name(server, &Obj, &Type, &Zone);
+#endif
     if ((size_t)-1 == (len = convert_string( 
-                       options->unixcharset, options->maccharset, 
-                       Obj, -1, buf, sizeof(buf))) ) {
-       len = MIN(strlen(Obj), 31);
+                           options->unixcharset, options->maccharset, 
+                           Obj, -1, buf, sizeof(buf))) ) {
+        len = MIN(strlen(Obj), 31);
        *data++ = len;
        memcpy( data, Obj, len );
-       LOG ( log_error, logtype_afpd, "Could not set servername, using fallback");
+        LOG ( log_error, logtype_afpd, "Could not set servername, using fallback");
     } else {
        *data++ = len;
        memcpy( data, buf, len );
@@ -375,18 +377,18 @@ static size_t status_utf8servername(char *data, int *nameoffset,
 
     /* extract the obj part of the server */
     Obj = (char *) (options->server ? options->server : options->hostname);
+#ifndef NO_DDP
     nbp_name(options->server ? options->server : options->hostname, &Obj, &Type, &Zone);
-
+#endif
     if ((size_t) -1 == (len = convert_string (
-                                       options->unixcharset, CH_UTF8_MAC, 
-                                       Obj, -1, data+sizeof(namelen), maxstatuslen-offset )) ) {
-       LOG ( log_error, logtype_afpd, "Could not set utf8 servername");
+                            options->unixcharset, CH_UTF8_MAC, 
+                            Obj, -1, data+sizeof(namelen), maxstatuslen-offset )) ) {
+        LOG ( log_error, logtype_afpd, "Could not set utf8 servername");
 
-       /* set offset to 0 */
-       memset(begin + *nameoffset, 0, sizeof(offset));
+        /* set offset to 0 */
+        memset(begin + *nameoffset, 0, sizeof(offset));
         data = begin + offset;
-    }
-    else {
+    } else {
        namelen = htons(len);
        memcpy( data, &namelen, sizeof(namelen));
        data += sizeof(namelen);
@@ -395,11 +397,11 @@ static size_t status_utf8servername(char *data, int *nameoffset,
        memcpy(begin + *nameoffset, &offset, sizeof(u_int16_t));
         
         /* Now set the flag ... */
-       memcpy(&status, begin + AFPSTATUS_FLAGOFF, sizeof(status));
-       status = ntohs(status);
-       status |= AFPSRVRINFO_SRVUTF8;
-       status = htons(status);
-       memcpy(begin + AFPSTATUS_FLAGOFF, &status, sizeof(status));
+        memcpy(&status, begin + AFPSTATUS_FLAGOFF, sizeof(status));
+        status = ntohs(status);
+        status |= AFPSRVRINFO_SRVUTF8;
+        status = htons(status);
+        memcpy(begin + AFPSTATUS_FLAGOFF, &status, sizeof(status));
     }
 
     /* return length of buffer */
index 532a620155f7c748835f32a83a53aa882cdc6575..588c0e273d544a40d612e86f99b5422873658b86 100644 (file)
@@ -491,6 +491,7 @@ int uam_afp_read(void *handle, char *buf, size_t *buflen,
     if (!obj)
         return AFPERR_PARAM;
 
+#ifndef NO_DDP
     switch (obj->proto) {
     case AFPPROTO_ASP:
         if ((len = asp_wrtcont(obj->handle, buf, buflen )) < 0)
@@ -499,6 +500,7 @@ int uam_afp_read(void *handle, char *buf, size_t *buflen,
         break;
 
     case AFPPROTO_DSI:
+#endif
         len = dsi_writeinit(obj->handle, buf, *buflen);
         if (!len || ((len = action(handle, buf, len)) < 0)) {
             dsi_writeflush(obj->handle);
@@ -511,8 +513,10 @@ int uam_afp_read(void *handle, char *buf, size_t *buflen,
                 goto uam_afp_read_err;
             }
         }
+#ifndef NO_DDP
         break;
     }
+#endif
     return 0;
 
 uam_afp_read_err:
index 0616774da18da49e2afb74ccc971bd13d40b6d19..713ed1fba647a49848f5e4fcb5ff6f7deec0f5ee 100644 (file)
@@ -9,6 +9,7 @@
 #include <sys/cdefs.h>
 #include <sys/types.h>
 #include <sys/time.h>
+#include <sys/socket.h>
 #include <signal.h>
 
 #include <netinet/in.h>
 #include <atalk/server_child.h>
 #include <netatalk/endian.h>
 
-#ifdef __OpenBSD__
-#include <sys/socket.h>
-#endif
-
 /* What a DSI packet looks like:
  0                               32
  |-------------------------------|
index d6209ed93c86cf624ba3292c4cd98096cb3b8aab..45c19c6cbf24295d0b00ccf472de3e9763a08711 100644 (file)
 
 #include <sys/cdefs.h>
 #include <sys/types.h>
-#ifdef HAVE_UNISTD_H
+#include <sys/socket.h>
 #include <unistd.h>
-#endif /* HAVE_UNISTD_H */
+
+#ifndef NO_DDP
 #include <netatalk/at.h>
+#endif
 #include <atalk/unicode.h>
 
 /* exit error codes */
@@ -56,7 +58,9 @@ extern void freeifacelist(char **);
 
 #define diatolower(x)     _dialowermap[(unsigned char) (x)]
 #define diatoupper(x)     _diacasemap[(unsigned char) (x)]
+#ifndef NO_DDP
 extern int atalk_aton     (char *, struct at_addr *);
+#endif
 extern void bprint        (char *, int);
 extern int strdiacasecmp  (const char *, const char *);
 extern int strndiacasecmp (const char *, const char *, size_t);
index 4c7500d6dd033db505b49ddc9114e2c403a55473..a70237318ff84c457c5cf8dbae43b39c12123a4a 100644 (file)
@@ -1,7 +1,7 @@
 
 # Makefile.am for libatalk/
 
-SUBDIRS = acl adouble asp atp bstring compat cnid dsi nbp netddp tdb util unicode vfs
+SUBDIRS = acl adouble bstring compat cnid dsi tdb util unicode vfs
 
 lib_LTLIBRARIES = libatalk.la
 
@@ -10,13 +10,9 @@ libatalk_la_SOURCES = dummy.c
 libatalk_la_LIBADD  = \
        acl/libacl.la \
        adouble/libadouble.la   \
-       asp/libasp.la           \
-       atp/libatp.la           \
        bstring/libbstring.la \
        compat/libcompat.la     \
        dsi/libdsi.la           \
-       nbp/libnbp.la           \
-       netddp/libnetddp.la     \
        util/libutil.la         \
        tdb/libtdb.la       \
        unicode/libunicode.la \
@@ -25,13 +21,9 @@ libatalk_la_LIBADD  = \
 libatalk_la_DEPENDENCIES = \
        acl/libacl.la \
        adouble/libadouble.la   \
-       asp/libasp.la           \
-       atp/libatp.la           \
        bstring/libbstring.la \
        compat/libcompat.la     \
        dsi/libdsi.la           \
-       nbp/libnbp.la           \
-       netddp/libnetddp.la     \
        util/libutil.la         \
        tdb/libtdb.la       \
        unicode/libunicode.la \
@@ -39,3 +31,16 @@ libatalk_la_DEPENDENCIES = \
 
 libatalk_la_LDFLAGS = -static
 
+if USE_APPLETALK
+SUBDIRS += asp atp nbp netddp
+libatalk_la_LIBADD += \
+       asp/libasp.la           \
+       atp/libatp.la           \
+       nbp/libnbp.la           \
+       netddp/libnetddp.la
+libatalk_la_DEPENDENCIES += \
+       asp/libasp.la           \
+       atp/libatp.la           \
+       nbp/libnbp.la           \
+       netddp/libnetddp.la
+endif
index 30e26a29c3440b7e4997ed64ba8ab546f4661be5..15e1ff3de028070d7d440fcf97ab3040de88747a 100644 (file)
 #if defined(NEED_RQUOTA) || (defined(sun) && defined(__svr4__)) || \
 (defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 6)
 
+#ifndef u_int
+#define u_int unsigned
+#endif
+
 #include <rpc/rpc.h>
 #include <rpcsvc/rquota.h>