]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/desktop.c
Warning fixes.
[netatalk.git] / etc / afpd / desktop.c
index 59a7ba8c1d685d7b645bb8cff2ce77a10ce73b81..2cd1ae896d8934bbafc9dee44721393e907b9af6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: desktop.c,v 1.26 2003-04-09 06:05:24 didg Exp $
+ * $Id: desktop.c,v 1.30 2003-06-09 14:42:38 srittau Exp $
  *
  * See COPYRIGHT.
  *
@@ -151,7 +151,7 @@ int         ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         cc = AFPERR_PARAM;
         goto addicon_err;
     }
@@ -619,7 +619,9 @@ char *dtfile(const struct vol *vol, u_char creator[], char *ext )
 */
 static char  upath[ MAXPATHLEN + 1];
 static char  mpath[ MAXPATHLEN + 1];
+#ifdef AFP3x
 static char  ucs2[ MAXPATHLEN + 1];
+#endif
 
 static char *old_mtoupath(const struct vol *vol, char *mpath)
 {
@@ -629,6 +631,9 @@ static char *old_mtoupath(const struct vol *vol, char *mpath)
         
     m = mpath;
     u = upath;
+    if ((vol->v_casefold & (AFPVOL_MTOUUPPER| AFPVOL_MTOULOWER))) {
+        changed = 1;
+    }
     while ( *m != '\0' ) {
         /* handle case conversion first */
         if (vol->v_casefold & AFPVOL_MTOUUPPER)
@@ -699,6 +704,9 @@ static char *old_utompath(const struct vol *vol, char *upath)
     /* do the hex conversion */
     u = upath;
     m = mpath;
+    if ((vol->v_casefold & (AFPVOL_MTOUUPPER| AFPVOL_MTOULOWER))) {
+        changed = 1;
+    }
     while ( *u != '\0' ) {
         /* we have a code page */
         if (vol->v_utompage && ((*u & 0x80) ||
@@ -744,6 +752,7 @@ static char *old_utompath(const struct vol *vol, char *upath)
 }
 
 /* --------------- */
+#ifdef AFP3x
 extern unsigned int do_precomposition(unsigned int base, unsigned int comb);
 
 static char comp[MAXPATHLEN +1];
@@ -831,14 +840,18 @@ unsigned int result;
      }
      return comp;
 }
+#endif
 
 /* --------------------------- */
 char *mtoupath(const struct vol *vol, char *mpath, int utf8)
 {
-    char       *m, *u, *r;
-    int                 i = 0;
+    int                i = 0;
+    char       *m, *u;
+#ifdef AFP3x
+    char       *r;
     size_t       inplen;
     size_t       outlen;
+#endif
         
     if ( *mpath == '\0' ) {
         return( "." );
@@ -914,11 +927,14 @@ char *mtoupath(const struct vol *vol, char *mpath, int utf8)
 /* --------------- */
 char *utompath(const struct vol *vol, char *upath, int utf8)
 {
-    char        *m, *u, *r;
     int          h;
     int          mangleflag = 0;
+    char       *m, *u;
+#ifdef AFP3x
+    char       *r;
     size_t       inplen;
     size_t       outlen;
+#endif
 
     if (!vol_utf8(vol))
        return old_utompath(vol, upath);
@@ -1036,7 +1052,7 @@ int               ibuflen, *rbuflen;
     clen = min( clen, 199 );
 
     upath = path->u_name;
-    if (check_access(upath, OPENACC_WR ) < 0) {
+    if (!vol_unix_priv(vol) && check_access(upath, OPENACC_WR ) < 0) {
         return AFPERR_ACCESS;
     }
 
@@ -1172,7 +1188,7 @@ int               ibuflen, *rbuflen;
     }
 
     upath = s_path->u_name;
-    if (check_access(upath, OPENACC_WR ) < 0) {
+    if (!vol_unix_priv(vol) && check_access(upath, OPENACC_WR ) < 0) {
         return AFPERR_ACCESS;
     }