]> arthur.barton.de Git - netatalk.git/commitdiff
Merge fixes
authorFrank Lahm <franklahm@googlemail.com>
Mon, 28 Nov 2011 16:17:21 +0000 (17:17 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 28 Nov 2011 16:17:21 +0000 (17:17 +0100)
etc/afpd/fork.c
etc/cnid_dbd/cmd_dbd_scanvol.c
include/atalk/Makefile.am
include/atalk/util.h
libatalk/adouble/ad_open.c
libatalk/compat/misc.c
libatalk/dsi/dsi_cmdreply.c
libatalk/vfs/vfs.c

index 2887f93e332767983bd43a5e2f92cb9e9c62d325..ad92ff4a431a413517d49c7109214f4070d92dc4 100644 (file)
@@ -269,7 +269,7 @@ int afp_openfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, si
 
     LOG(log_debug, logtype_afpd,
         "afp_openfork(\"%s\", %s)",
-        abspath(s_path->u_name),
+        fullpathname(s_path->u_name),
         (fork & OPENFORK_RSCS) ? "OPENFORK_RSCS" : "OPENFORK_DATA");
 
     /* stat() data fork st is set because it's not a dir */
@@ -405,7 +405,7 @@ int afp_openfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, si
                 break;
             default:
                 LOG(log_error, logtype_afpd, "afp_openfork(\"%s\"): %s",
-                    abspath(s_path->m_name), strerror(errno) );
+                    fullpathname(s_path->m_name), strerror(errno) );
                 goto openfork_err;
                 break;
             }
@@ -879,14 +879,10 @@ static int read_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, si
         goto afp_read_err;
     }
 
-<<<<<<< HEAD
-#define min(a,b)    ((a)<(b)?(a):(b))
-    *rbuflen = min( reqcount, *rbuflen );
-=======
     *rbuflen = MIN(reqcount, *rbuflen);
     LOG(log_debug, logtype_afpd, "afp_read(name: \"%s\", offset: %jd, reqcount: %jd): reading %jd bytes from file",
         of_name(ofork), (intmax_t)offset, (intmax_t)reqcount, (intmax_t)*rbuflen);
->>>>>>> netafp/master
+
     err = read_file(ofork, eid, offset, nlmask, nlchar, rbuf, rbuflen, xlate);
     if (err < 0)
         goto afp_read_done;
@@ -1178,17 +1174,10 @@ static ssize_t write_file(struct ofork *ofork, int eid,
  * in reqcount et al. */
 static int write_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen, int is64)
 {
-<<<<<<< HEAD
     struct ofork    *ofork;
-    off_t               offset, saveoff, reqcount;
+    off_t               offset, saveoff, reqcount, oldsize, newsize;
     int             endflag, eid, xlate = 0, err = AFP_OK;
     uint16_t       ofrefnum;
-=======
-    struct ofork       *ofork;
-    off_t           offset, saveoff, reqcount, oldsize, newsize;
-    int                        endflag, eid, xlate = 0, err = AFP_OK;
-    u_int16_t          ofrefnum;
->>>>>>> netafp/master
     ssize_t             cc;
 
     /* figure out parameters */
index d661071d03b57c8e853e59cd431b2523f5474e69..75f51fa6463d78757f520954fee0324833555c25 100644 (file)
@@ -761,7 +761,7 @@ static cnid_t check_cnid(const char *name, cnid_t did, struct stat *st, int adfi
             dbd_log(LOGSTD, "Updating AppleDouble file for '%s/%s' with CNID: %u from database",
                             cwdbuf, name, ntohl(db_cnid));
             ad_init(&ad, myvolinfo->v_adouble, myvolinfo->v_ad_options);
-            if (ad_open_metadata( name, adflags, O_RDWR, &ad) != 0) {
+            if (ad_open(&ad, name, adflags | ADFLAGS_HF, O_RDWR, 0666, &ad) != 0) {
                 dbd_log(LOGSTD, "Error opening AppleDouble file for '%s/%s': %s",
                         cwdbuf, name, strerror(errno));
                 return CNID_INVALID;
index f4c2258df50027f6a51e35ba99af11a6b2e1e4fd..bb4beae11b3ed76be666a599b594a2ed38ad51d4 100644 (file)
@@ -37,7 +37,6 @@ noinst_HEADERS = \
        talloc.h \
        tevent.h \
        tsocket.h \
-       boolean.h \
        compat.h \
        dsi.h \
        ldapconfig.h \
index 1febc062c0128fee626f5d64845b413effd0e2ab..7fbae2dfc07838c91bce2aa1d5975eafcd5b902a 100644 (file)
@@ -175,7 +175,6 @@ extern int recv_fd(int fd, int nonblocking);
  * unix.c
  *****************************************************************/
 
-extern const char *abspath(const char *name);
 extern const char *getcwdpath(void);
 extern const char *fullpathname(const char *);
 extern char *stripped_slashes_basename(char *p);
index ea4ee2405b95d09baf7d9af07975b6e0fece4108..ffb188eadf551cbdb574d9bc41ebe5535cf9aa8f 100644 (file)
@@ -506,7 +506,7 @@ static int ad_open_df(const char *path, int adflags, int oflags, int mode, struc
     int         st_invalid = -1;
 
     LOG(log_debug, logtype_default, "ad_open_df(\"%s\", %s, %04o)",
-        abspath(path), oflags2logstr(oflags), mode);
+        fullpathname(path), oflags2logstr(oflags), mode);
 
     if (ad_data_fileno(ad) == -1) {
         hoflags = (oflags & ~(O_RDONLY | O_WRONLY)) | O_RDWR;
@@ -591,7 +591,7 @@ static int ad_open_hf_v2(const char *path, int adflags, int oflags, int mode, st
              * if ((oflags & O_CREAT) ==> (oflags & O_RDWR)
              */
             LOG(log_debug, logtype_default, "ad_open(\"%s\"): creating adouble file",
-                abspath(path));
+                fullpathname(path));
             admode = mode;
             errno = 0;
             st_invalid = ad_mode_st(ad_p, &admode, &st_dir);
@@ -680,7 +680,7 @@ static int ad_open_hf_ea(const char *path, int adflags, int oflags, int mode, st
         /* Create one */
         if (new_ad_header(path, ad, adflags) < 0) {
             LOG(log_error, logtype_default, "ad_open_hf_ea: can't create new header: %s",
-                abspath(path));
+                fullpathname(path));
             goto error;
         }
         ad->ad_md->adf_flags |= O_CREAT; /* mark as just created */
@@ -752,7 +752,7 @@ static int ad_open_rf(const char *path, int adflags, int oflags, int mode, struc
             break;
         default:
             LOG(log_warning, logtype_default, "ad_open_rf(\"%s\"): %s",
-                abspath(path), strerror(errno));
+                fullpathname(path), strerror(errno));
             ret = -1;
             goto exit;
         }
@@ -1091,13 +1091,13 @@ static int vad_open(struct adouble *ad, const char *path, int adflags, va_list a
     int mode = 0;
     
     LOG(log_debug, logtype_default, "ad_open(\"%s\", %s)",
-        abspath(path), adflags2logstr(adflags));
+        fullpathname(path), adflags2logstr(adflags));
 
     if (ad->ad_inited != AD_INITED) /* 1 */
         AFP_PANIC("ad_open: not initialized");
 
     if (ad->ad_fullpath == NULL) { /* 2 */
-        if ((ad->ad_fullpath = bfromcstr(abspath(path))) == NULL) {
+        if ((ad->ad_fullpath = bfromcstr(fullpathname(path))) == NULL) {
             ret = -1;
             goto exit;
         }
index cf11aeb45782605b9b8c493d63008c8b6e88158b..dc4869e7d6735c085be56a2453a8c59182fc00ec 100644 (file)
@@ -4,18 +4,6 @@
 
 #include <atalk/compat.h>
 
-#ifndef HAVE_STRNLEN
-size_t strnlen(const char *s, size_t max)
-{
-    size_t len;
-  
-    for (len = 0; len < max; len++) {
-        if (s[len] == '\0') {
-            break;
-        }
-    }
-    return len;  
-
 #if !defined HAVE_DIRFD && defined SOLARIS
 #include <dirent.h>
 int dirfd(DIR *dir)
index 45798b09e6f026715fb0fc4a1cd9956f56b40bd9..eb8cfd385b0d6a7d73539ec18d4ffc255b1e6763 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <atalk/dsi.h>
 #include <atalk/logger.h>
-#include <netatalk/endian.h>
 
 /* this assumes that the reply follows right after the command, saving
  * on a couple assignments. specifically, command, requestID, and
index b33138bc26ab22efe1fbd4d795b9a1b467f18c3c..0eaacfaee8af8fc5f6babb34709d2e7f7c8022f9 100644 (file)
@@ -505,33 +505,6 @@ static int validupath_ea(VFS_FUNC_ARGS_VALIDUPATH)
 /* ----------------- */
 static int RF_chown_ea(VFS_FUNC_ARGS_CHOWN)
 {
-    mode_t file_mode = ad_hf_mode(mode);
-    mode_t dir_mode = file_mode;
-    struct set_mode param;
-
-    if ((dir_mode & (S_IRUSR | S_IWUSR )))
-        dir_mode |= S_IXUSR;
-    if ((dir_mode & (S_IRGRP | S_IWGRP )))
-        dir_mode |= S_IXGRP;
-    if ((dir_mode & (S_IROTH | S_IWOTH )))
-        dir_mode |= S_IXOTH;
-
-       /* change folder */
-       dir_mode |= DIRBITS;
-    if (dir_rx_set(dir_mode)) {
-        if (chmod_acl( name,  dir_mode ) < 0)
-            return -1;
-    }
-    param.st = st;
-    param.mode = file_mode;
-    if (for_each_adouble("setfilmode_ads", name, ads_setfilmode_loop, &param, 0, v_umask) < 0)
-        return -1;
-
-    if (!dir_rx_set(dir_mode)) {
-        if (chmod_acl( name,  dir_mode ) < 0)
-            return -1;
-    }
-
     return 0;
 }