Skip to content

Commit

Permalink
Merge 3.0.2 release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
franklahm committed Jan 21, 2013
2 parents 29ac6c8 + ca0b818 commit b6f259d
Show file tree
Hide file tree
Showing 228 changed files with 4,528 additions and 2,800 deletions.
34 changes: 34 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
Changes in 3.0.2
================
* NEW: afpd: Put file extension type/creator mapping back in which had
been removed in 3.0.
* NEW: afpd: new option 'ad domain'. From FR #66.
* FIX: volumes and home share with symlinks in the path
* FIX: Copying packages to a Netatalk share could fail, bug #469
* FIX: Reloading volumes from config file was broken. Fixes bug #474.
* FIX: Fix _device-info service type registered with dns-sd API
* FIX: Fix pathname bug for FCE modified event.
* FIX: Remove length limitation of options like "valid users".
Fixes bug #473.
* FIX: Dont copy our metadata EA in copyfile(). Fixes bug #452.
* FIX: Fix an error where catalog search gave incomplete results.
Fixes bug #479.
* REM: Remove TimeMachine volume used size FCE event.
* UPD: Add quoting support to '[in]valid users' option. Fixes bug #472.
* FIX: Install working PAM config on Solaris 11. Fixes bug #481.
* FIX: Fix a race condition between dbd and the cnid_dbd daemon
which could result in users being disconnected from volumes
when dbd was scanning their volumes. Fixes bug #477.
* FIX: Netatalk didn't start when the last line of the config file
afp.conf wasn't terminated by a newline. Fixes bug #476.
* NEW: Add a new volumes option 'follow symlinks'. The default setting is
false, symlinks are not followed on the server. This is the same
behaviour as OS X's AFP server.
Setting the option to true causes afpd to follow symlinks on the
server. symlinks may point outside of the AFP volume, currently
afpd doesn't do any checks for "wide symlinks".
* FIX: Automatic AppleDouble conversion to EAs failing for directories.
Fixes bug #486.
* FIX: dbd failed to convert appledouble files of symlinks.
Fixes bug #490.

Changes in 3.0.1
================
* NEW: afpd: Optional "ldap uuid encoding = string | ms-guid" parameter to
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.1
3.0.2
2 changes: 1 addition & 1 deletion bin/ad/ad.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int main(int argc, char **argv)

setuplog("default:note", "/dev/tty");

if (load_volumes(&obj, NULL) != 0)
if (load_volumes(&obj) != 0)
return 1;

if (STRCMP(argv[1], ==, "ls"))
Expand Down
28 changes: 3 additions & 25 deletions bin/ad/ad_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,36 +95,14 @@ static volatile sig_atomic_t alarmed;
static int badcp, rval;
static int ftw_options = FTW_MOUNT | FTW_PHYS | FTW_ACTIONRETVAL;

static char *netatalk_dirs[] = {
".AppleDouble",
".AppleDB",
".AppleDesktop",
NULL
};

/* Forward declarations */
static int copy(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf);
static int ftw_copy_file(const struct FTW *, const char *, const struct stat *, int);
static int ftw_copy_link(const struct FTW *, const char *, const struct stat *, int);
static int setfile(const struct stat *, int);
static int preserve_dir_acls(const struct stat *, char *, char *);
// static int preserve_dir_acls(const struct stat *, char *, char *);
static int preserve_fd_acls(int, int);

/*
Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop"
Returns pointer to name or NULL.
*/
static const char *check_netatalk_dirs(const char *name)
{
int c;

for (c=0; netatalk_dirs[c]; c++) {
if ((strcmp(name, netatalk_dirs[c])) == 0)
return netatalk_dirs[c];
}
return NULL;
}

static void upfunc(void)
{
did = pdid;
Expand Down Expand Up @@ -953,9 +931,9 @@ static int preserve_fd_acls(int source_fd, int dest_fd)
return (0);
}

#if 0
static int preserve_dir_acls(const struct stat *fs, char *source_dir, char *dest_dir)
{
#if 0
acl_t (*aclgetf)(const char *, acl_type_t);
int (*aclsetf)(const char *, acl_type_t, acl_t);
struct acl *aclp;
Expand Down Expand Up @@ -1037,6 +1015,6 @@ static int preserve_dir_acls(const struct stat *fs, char *source_dir, char *dest
return (1);
}
acl_free(acl);
#endif
return (0);
}
#endif
32 changes: 0 additions & 32 deletions bin/ad/ad_mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,9 @@ static int fflg, iflg, nflg, vflg;
static afpvol_t svolume, dvolume;
static cnid_t did, pdid;
static volatile sig_atomic_t alarmed;
static char *netatalk_dirs[] = {
".AppleDouble",
".AppleDB",
".AppleDesktop",
NULL
};

static int copy(const char *, const char *);
static int do_move(const char *, const char *);
static void preserve_fd_acls(int source_fd, int dest_fd, const char *source_path,
const char *dest_path);
/*
Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop"
Returns pointer to name or NULL.
*/
static const char *check_netatalk_dirs(const char *name)
{
int c;

for (c=0; netatalk_dirs[c]; c++) {
if ((strcmp(name, netatalk_dirs[c])) == 0)
return netatalk_dirs[c];
}
return NULL;
}

/*
SIGNAL handling:
Expand Down Expand Up @@ -242,7 +220,6 @@ int ad_mv(int argc, char *argv[], AFPObj *obj)
}
}

exit:
closevol(&dvolume);
return rval;
}
Expand Down Expand Up @@ -465,12 +442,3 @@ static int copy(const char *from, const char *to)
}
return 0;
}

static void
preserve_fd_acls(int source_fd,
int dest_fd,
const char *source_path,
const char *dest_path)
{
;
}
3 changes: 1 addition & 2 deletions bin/ad/ad_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ static void change_label(char *path, afpvol_t *vol, const struct stat *st, struc

static void change_attributes(char *path, afpvol_t *vol, const struct stat *st, struct adouble *ad, char *new_attributes)
{
char *FinderInfo;
uint16_t AFPattributes;

ad_getattr(ad, &AFPattributes);
Expand Down Expand Up @@ -256,7 +255,7 @@ static void change_flags(char *path, afpvol_t *vol, const struct stat *st, struc

int ad_set(int argc, char **argv, AFPObj *obj)
{
int c, firstarg;
int c;
afpvol_t vol;
struct stat st;
int adflags = 0;
Expand Down
1 change: 0 additions & 1 deletion bin/cnid/cnid2_create.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#
# Upgrade version 1 CNID databases to version 2
#
# $Id: cnid2_create.in,v 1.2 2005-04-28 20:49:19 bfernhomberg Exp $
#
# Copyright (C) Joerg Lenneis 2003
# All Rights Reserved. See COPYING.
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/asingle.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: asingle.c,v 1.14 2010-01-27 21:27:53 didg Exp $
*/

#ifdef HAVE_CONFIG_H
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/asingle.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: asingle.h,v 1.4 2010-01-27 21:27:53 didg Exp $
*/

#ifndef _ASINGLE_H
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/hqx.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: hqx.c,v 1.18 2010-01-27 21:27:53 didg Exp $
*/

#ifdef HAVE_CONFIG_H
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/hqx.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: hqx.h,v 1.3 2010-01-27 21:27:53 didg Exp $
*/

#ifndef _HQX_H
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/macbin.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: macbin.c,v 1.15 2010-01-27 21:27:53 didg Exp $
*/

#ifdef HAVE_CONFIG_H
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/macbin.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: macbin.h,v 1.4 2010-01-27 21:27:53 didg Exp $
*/

#ifndef _MACBIN_H
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/megatron.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: megatron.h,v 1.5 2009-10-14 01:38:28 didg Exp $
*/

#ifndef _MEGATRON_H
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/nad.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: nad.c,v 1.18 2010-01-27 21:27:53 didg Exp $
*/

#ifdef HAVE_CONFIG_H
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/nad.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: nad.h,v 1.5 2010-01-27 21:27:53 didg Exp $
*/

#ifndef _NAD_H
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/updcrc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: updcrc.c,v 1.5 2009-10-13 22:55:36 didg Exp $
*
* updcrc(3), crc(1) - calculate crc polynomials
*
Expand Down
1 change: 0 additions & 1 deletion bin/megatron/updcrc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* $Id: updcrc.h,v 1.1 2009-10-13 22:55:36 didg Exp $
*/

#ifndef _UPDCRC_H
Expand Down
25 changes: 3 additions & 22 deletions bin/misc/fce.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,9 @@ static char *fce_ev_names[] = {
"FCE_FILE_DELETE",
"FCE_DIR_DELETE",
"FCE_FILE_CREATE",
"FCE_DIR_CREATE",
"FCE_TM_SIZE"
"FCE_DIR_CREATE"
};

// get sockaddr, IPv4 or IPv6:
static void *get_in_addr(struct sockaddr *sa)
{
if (sa->sa_family == AF_INET) {
return &(((struct sockaddr_in*)sa)->sin_addr);
}

return &(((struct sockaddr_in6*)sa)->sin6_addr);
}

static int unpack_fce_packet(unsigned char *buf, struct fce_packet *packet)
{
unsigned char *p = buf;
Expand All @@ -63,6 +52,7 @@ static int unpack_fce_packet(unsigned char *buf, struct fce_packet *packet)
packet->datalen = ntohs(packet->datalen);

memcpy(&packet->data[0], p, packet->datalen);
packet->data[packet->datalen] = 0; /* 0 terminate strings */
p += packet->datalen;

return 0;
Expand All @@ -77,8 +67,6 @@ int main(void)
struct sockaddr_storage their_addr;
char buf[MAXBUFLEN];
socklen_t addr_len;
char s[INET6_ADDRSTRLEN];
uint64_t tmsize;

memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC; // set to AF_INET to force IPv4
Expand Down Expand Up @@ -129,18 +117,11 @@ int main(void)
exit(1);
}

unpack_fce_packet(buf, &packet);
unpack_fce_packet((unsigned char *)buf, &packet);

if (memcmp(packet.magic, FCE_PACKET_MAGIC, sizeof(packet.magic)) == 0) {

switch (packet.mode) {
case FCE_TM_SIZE:
memcpy(&tmsize, packet.data, sizeof(uint64_t));
tmsize = ntoh64(tmsize);
printf("ID: %" PRIu32 ", Event: %s, Volume: %s, TM used size: %" PRIu64 " \n",
packet.event_id, fce_ev_names[packet.mode], packet.data + sizeof(uint64_t), tmsize);
break;

case FCE_CONN_START:
printf("FCE Start\n");
break;
Expand Down
18 changes: 18 additions & 0 deletions bin/misc/logger_test.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
Copyright (c) 2009 Frank Lahm <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */

#include <stdio.h>
#include <stdbool.h>

Expand Down
21 changes: 13 additions & 8 deletions bin/misc/netacnv.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ struct flag_map {

struct flag_map flag_map[] = {
flag(CONV_ESCAPEHEX),
flag(CONV_ALLOW_COLON),
flag(CONV_UNESCAPEHEX),
flag(CONV_ESCAPEDOTS),
flag(CONV_IGNORE),
Expand All @@ -39,29 +38,32 @@ int main(int argc, char **argv)
{
int opt;
uint16_t flags = 0;
char *string;
char *string, *macName = MACCHARSET;
char *f = NULL, *t = NULL;
charset_t from, to, mac;

while ((opt = getopt(argc, argv, ":o:f:t:")) != -1) {
while ((opt = getopt(argc, argv, "m:o:f:t:")) != -1) {
switch(opt) {
case 'm':
macName = strdup(optarg);
break;
case 'o':
for (int i = 0; i < sizeof(flag_map)/sizeof(struct flag_map) - 1; i++)
if ((strcmp(flag_map[i].flagname, optarg)) == 0)
flags |= flag_map[i].flag;
break;
case 'f':
f = optarg;
f = strdup(optarg);
break;
case 't':
t = optarg;
t = strdup(optarg);
break;
}
}

if ((optind + 1) != argc) {
printf("Usage: test [-o <conversion option> [...]] [-f <from charset>] [-t <to charset>] <string>\n");
printf("Defaults: -f: UTF8-MAC , -t: UTF8 \n");
printf("Usage: test [-o <conversion option> [...]] [-f <from charset>] [-t <to charset>] [-m legacy Mac charset] <string>\n");
printf("Defaults: -f: UTF8-MAC, -t: UTF8, -m MAC_ROMAN\n");
printf("Available conversion options:\n");
for (int i = 0; i < (sizeof(flag_map)/sizeof(struct flag_map) - 1); i++) {
printf("%s\n", flag_map[i].flagname);
Expand All @@ -70,6 +72,9 @@ int main(int argc, char **argv)
}
string = argv[optind];

set_charset_name(CH_UNIX, "UTF8");
set_charset_name(CH_MAC, macName);

if ( (charset_t) -1 == (from = add_charset(f ? f : "UTF8-MAC")) ) {
fprintf( stderr, "Setting codepage %s as from codepage failed\n", f ? f : "UTF8-MAC");
return (-1);
Expand All @@ -80,7 +85,7 @@ int main(int argc, char **argv)
return (-1);
}

if ( (charset_t) -1 == (mac = add_charset(MACCHARSET)) ) {
if ( (charset_t) -1 == (mac = add_charset(macName)) ) {
fprintf( stderr, "Setting codepage %s as Mac codepage failed\n", MACCHARSET);
return (-1);
}
Expand Down
Loading

0 comments on commit b6f259d

Please sign in to comment.