update to netatalk 2.2.2, from Brad, tested by william@ and Ian McWilliam
- support for MacOS X Lion and TimeMachine - add rc scripts
This commit is contained in:
parent
f5375bde7b
commit
bbad8b5b92
@ -1,60 +1,72 @@
|
||||
# $OpenBSD: Makefile,v 1.37 2012/01/25 20:21:31 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.38 2012/04/11 18:39:13 sthen Exp $
|
||||
|
||||
COMMENT= AFP file and print services for AppleTalk/IP networks
|
||||
SHARED_ONLY= Yes
|
||||
|
||||
DISTNAME= netatalk-2.0.3
|
||||
REVISION= 10
|
||||
COMMENT= AFP file and print services for IP networks
|
||||
|
||||
DISTNAME= netatalk-2.2.2
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=netatalk/}
|
||||
EXTRACT_SUFX= .tar.bz2
|
||||
|
||||
HOMEPAGE= http://netatalk.sourceforge.net/
|
||||
|
||||
# Mainly GPL, some parts BSD or similar
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
# GPLv2+ and BSD or similar
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
WANTLIB= asn1 c crypto db>=4 gcrypt gpg-error gssapi krb5 pthread \
|
||||
rpcsvc wrap
|
||||
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=netatalk/}
|
||||
MODULES= devel/gettext
|
||||
LIB_DEPENDS= databases/db/v4 \
|
||||
security/libgcrypt
|
||||
|
||||
CONFIGURE_STYLE= gnu
|
||||
USE_LIBTOOL= Yes
|
||||
USE_GROFF = Yes
|
||||
USE_GROFF= Yes
|
||||
USE_LIBTOOL= Yes
|
||||
CONFIGURE_STYLE= gnu
|
||||
CONFIGURE_ARGS= --disable-cups \
|
||||
--disable-overwrite \
|
||||
--enable-krbV-uam \
|
||||
--with-ssl-dir=/usr \
|
||||
--with-uams-path=${PREFIX}/lib/netatalk/uams \
|
||||
--without-acls \
|
||||
--without-ldap
|
||||
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
|
||||
LDFLAGS="-L${LOCALBASE}/lib"
|
||||
|
||||
WANTLIB= c crypto rpcsvc db>=4
|
||||
LIB_DEPENDS= databases/db/v4
|
||||
FLAVORS= avahi
|
||||
FLAVOR?=
|
||||
|
||||
CONFIGURE_ARGS+= --with-db4=${LOCALBASE}
|
||||
CONFIGURE_ARGS+= ${CONFIGURE_SHARED}
|
||||
CONFIGURE_ARGS+= --with-ssl=/usr
|
||||
CONFIGURE_ARGS+= --with-uams-path=${PREFIX}/lib/netatalk/uams
|
||||
CONFIGURE_ARGS+= --disable-overwrite
|
||||
CONFIGURE_ARGS+= --disable-cups
|
||||
.if ${FLAVOR:L:Mavahi}
|
||||
WANTLIB+= avahi-client avahi-common dbus-1
|
||||
LIB_DEPENDS+= net/avahi
|
||||
.else
|
||||
CONFIGURE_ARGS+= --disable-zeroconf
|
||||
.endif
|
||||
|
||||
CONFIGURE_ENV+= netatalk_cv_install_pam=no
|
||||
NO_REGRESS= Yes
|
||||
|
||||
EXAMPLES= AppleVolumes.default AppleVolumes.system netatalk.conf \
|
||||
afpd.conf
|
||||
|
||||
post-extract:
|
||||
@${INSTALL} -m 555 ${FILESDIR}/krb5-config ${WRKDIR}/bin
|
||||
|
||||
post-build:
|
||||
@cd ${WRKSRC}/distrib/initscripts; make rc.atalk.bsd
|
||||
@cd ${WRKSRC}/config; make afpd.conf
|
||||
@cd ${WRKSRC}/config; make afpd.conf AppleVolumes.default
|
||||
|
||||
post-install:
|
||||
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/netatalk
|
||||
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/netatalk
|
||||
|
||||
.for i in AppleVolumes.default AppleVolumes.system \
|
||||
atalkd.conf papd.conf netatalk.conf afpd.conf
|
||||
${INSTALL_DATA} ${WRKSRC}/config/$i \
|
||||
${PREFIX}/share/examples/netatalk
|
||||
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/netatalk
|
||||
${INSTALL_DATA} ${WRKSRC}/doc/README.AppleTalk \
|
||||
${PREFIX}/share/doc/netatalk
|
||||
.for i in ${EXAMPLES}
|
||||
${INSTALL_DATA} ${WRKSRC}/config/$i ${PREFIX}/share/examples/netatalk
|
||||
.endfor
|
||||
@find ${PREFIX}/lib/netatalk/uams -name '*.a' -print | xargs rm
|
||||
@find ${PREFIX}/lib/netatalk/uams -name '*.la' -print | xargs rm
|
||||
|
||||
${INSTALL_DATA} ${WRKSRC}/distrib/initscripts/rc.atalk.bsd \
|
||||
${PREFIX}/share/examples/netatalk
|
||||
|
||||
${INSTALL_DATA} ${WRKSRC}/COPYRIGHT ${WRKSRC}/COPYING\
|
||||
${PREFIX}/share/doc/netatalk
|
||||
|
||||
.for i in FAQ README.hidden-items README.platforms README.logger \
|
||||
README.ids Netatalk-Manual.txt Netatalk-Manual.pdf
|
||||
${INSTALL_DATA} ${WRKSRC}/doc/$i ${PREFIX}/share/doc/netatalk
|
||||
.endfor
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,5 +1,5 @@
|
||||
MD5 (netatalk-2.0.3.tar.gz) = F5F6vX0lXSMcwMYYjM0n+w==
|
||||
RMD160 (netatalk-2.0.3.tar.gz) = VdEgzZeooQ+ewRL0P5lS+6ygNKM=
|
||||
SHA1 (netatalk-2.0.3.tar.gz) = X5TZaR4UzPZuN2ZK/HO7DDG8hDc=
|
||||
SHA256 (netatalk-2.0.3.tar.gz) = tuAc/AtCI/YP2ZTu6VBjWxZdVKls9ju+YHpf9kNVvYw=
|
||||
SIZE (netatalk-2.0.3.tar.gz) = 1920570
|
||||
MD5 (netatalk-2.2.2.tar.bz2) = vUK2huxyCdmrR72OLiQxxA==
|
||||
RMD160 (netatalk-2.2.2.tar.bz2) = ze3V/0uLrnz5D4xETDnbhQ/CEOc=
|
||||
SHA1 (netatalk-2.2.2.tar.bz2) = 1Dx10EpmrVnFsMeX/6Hm4+E7IQU=
|
||||
SHA256 (netatalk-2.2.2.tar.bz2) = RDAxuQ2d1icNmGWdIQ9AhDfY5x6AlNbwtxcGpcSB46A=
|
||||
SIZE (netatalk-2.2.2.tar.bz2) = 1239433
|
||||
|
9
net/netatalk/files/krb5-config
Normal file
9
net/netatalk/files/krb5-config
Normal file
@ -0,0 +1,9 @@
|
||||
#! /bin/sh
|
||||
|
||||
case x$1 in
|
||||
x--libs)
|
||||
echo '-lgssapi -lkrb5 -lasn1 -lcrypto';;
|
||||
x--cflags)
|
||||
echo '-I/usr/include/kerberosV';;
|
||||
esac
|
||||
exit 0
|
@ -1,65 +0,0 @@
|
||||
$OpenBSD: patch-bin_afile_common_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- bin/afile/common.c.orig Fri Jun 29 16:14:46 2001
|
||||
+++ bin/afile/common.c Thu Oct 25 20:30:05 2007
|
||||
@@ -64,22 +64,23 @@ char *dataname_to_adname(const char *dataname)
|
||||
{
|
||||
const char *filepart;
|
||||
char *adname;
|
||||
- size_t adlen = strlen(AD_PREFIX);
|
||||
+ size_t adlen = strlen(AD_PREFIX) + strlen(dataname) + 1;
|
||||
size_t dirlen;
|
||||
|
||||
/* Construct the AppleDouble file name from data fork file name. */
|
||||
- adname = calloc(adlen + strlen(dataname) + 1, sizeof(char));
|
||||
+ adname = (char *)malloc(adlen);
|
||||
filepart = rindex(dataname, '/');
|
||||
if (filepart == NULL) {
|
||||
/* Filename doesn't contain a path. */
|
||||
- strcpy(adname, AD_PREFIX);
|
||||
- strcpy(adname + adlen, dataname);
|
||||
+ strlcpy(adname, AD_PREFIX, adlen);
|
||||
+ strlcat(adname, dataname, adlen);
|
||||
} else {
|
||||
/* Filename does contain a path. */
|
||||
- dirlen = (size_t) (filepart - dataname);
|
||||
- strncpy(adname, dataname, dirlen + 1);
|
||||
- strcpy(adname + dirlen + 1, AD_PREFIX);
|
||||
- strcpy(adname + dirlen + adlen + 1, filepart + 1);
|
||||
+ dirlen = (filepart - dataname) + 1;
|
||||
+ strncpy(adname, dataname, dirlen);
|
||||
+ adname[dirlen] = '\0';
|
||||
+ strlcat(adname, AD_PREFIX, adlen);
|
||||
+ strlcat(adname, filepart + 1, adlen);
|
||||
}
|
||||
|
||||
return adname;
|
||||
@@ -89,20 +90,21 @@ char *adname_to_dataname(const char *adname)
|
||||
{
|
||||
const char *filepart;
|
||||
char *dataname;
|
||||
- size_t plen = strlen(PARENT_PREFIX);
|
||||
+ size_t datalen = strlen(adname) + strlen(PARENT_PREFIX) + 1;
|
||||
size_t dirlen;
|
||||
|
||||
/* Construct the data file name from the AppleDouble file name. */
|
||||
- dataname = calloc(strlen(adname) + plen + 1, sizeof(char));
|
||||
+ dataname = (char *)malloc(datalen);
|
||||
filepart = rindex(adname, '/');
|
||||
if (filepart == NULL) {
|
||||
- strcpy(dataname, PARENT_PREFIX);
|
||||
- strcpy(dataname + plen, adname);
|
||||
+ strlcpy(dataname, PARENT_PREFIX, datalen);
|
||||
+ strlcat(dataname, adname, datalen);
|
||||
} else {
|
||||
- dirlen = (size_t) (filepart - adname);
|
||||
- strncpy(dataname, adname, dirlen + 1);
|
||||
- strcpy(dataname + dirlen + 1, PARENT_PREFIX);
|
||||
- strcpy(dataname + dirlen + plen + 1, filepart + 1);
|
||||
+ dirlen = (size_t) (filepart - adname) + 1;
|
||||
+ strncpy(dataname, adname, dirlen);
|
||||
+ dataname[dirlen] = '\0';
|
||||
+ strlcpy(dataname, PARENT_PREFIX, datalen);
|
||||
+ strlcpy(dataname, filepart + 1, datalen);
|
||||
}
|
||||
|
||||
return dataname;
|
@ -1,118 +0,0 @@
|
||||
$OpenBSD: patch-bin_afppasswd_afppasswd_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- bin/afppasswd/afppasswd.c.orig Thu Feb 10 02:23:07 2005
|
||||
+++ bin/afppasswd/afppasswd.c Thu Oct 25 20:30:05 2007
|
||||
@@ -64,7 +64,7 @@
|
||||
#define HEXPASSWDLEN 16
|
||||
#define PASSWDLEN 8
|
||||
|
||||
-static char buf[MAXPATHLEN + 1];
|
||||
+static char buf[MAXPATHLEN];
|
||||
|
||||
/* if newpwd is null, convert buf from hex to binary. if newpwd isn't
|
||||
* null, convert newpwd to hex and save it in buf. */
|
||||
@@ -117,7 +117,7 @@ static void convert_passwd(char *buf, char *newpwd, co
|
||||
/* this matches the code in uam_randnum.c */
|
||||
static int update_passwd(const char *path, const char *name, int flags)
|
||||
{
|
||||
- char password[PASSWDLEN + 1], *p, *passwd;
|
||||
+ char password[PASSWDLEN], *p, *passwd;
|
||||
FILE *fp;
|
||||
off_t pos;
|
||||
int keyfd = -1, err = 0;
|
||||
@@ -128,9 +128,9 @@ static int update_passwd(const char *path, const char
|
||||
}
|
||||
|
||||
/* open the key file if it exists */
|
||||
- strcpy(buf, path);
|
||||
+ strlcpy(buf, path, sizeof(buf));
|
||||
if (strlen(path) < sizeof(buf) - 5) {
|
||||
- strcat(buf, ".key");
|
||||
+ strlcat(buf, ".key", sizeof(buf));
|
||||
keyfd = open(buf, O_RDONLY);
|
||||
}
|
||||
|
||||
@@ -154,8 +154,8 @@ static int update_passwd(const char *path, const char
|
||||
}
|
||||
|
||||
if (flags & OPT_ADDUSER) {
|
||||
- strcpy(buf, name);
|
||||
- strcat(buf, FORMAT);
|
||||
+ strlcpy(buf, name, sizeof(buf));
|
||||
+ strlcat(buf, FORMAT, sizeof(buf));
|
||||
p = strchr(buf, ':') + 1;
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
} else {
|
||||
@@ -239,8 +239,8 @@ static int create_file(const char *path, uid_t minuid)
|
||||
/* a little paranoia */
|
||||
if (strlen(pwd->pw_name) + FORMAT_LEN > sizeof(buf) - 1)
|
||||
continue;
|
||||
- strcpy(buf, pwd->pw_name);
|
||||
- strcat(buf, FORMAT);
|
||||
+ strlcpy(buf, pwd->pw_name, sizeof(buf));
|
||||
+ strlcat(buf, FORMAT, sizeof(buf));
|
||||
len = strlen(buf);
|
||||
if (write(fd, buf, len) != len) {
|
||||
fprintf(stderr, "afppasswd: problem writing to %s: %s\n", path,
|
||||
@@ -255,6 +255,22 @@ static int create_file(const char *path, uid_t minuid)
|
||||
return err;
|
||||
}
|
||||
|
||||
+void usage(void) {
|
||||
+#ifdef USE_CRACKLIB
|
||||
+ fprintf(stderr, "Usage: afppasswd [-acfn] [-u minuid] [-p path] [username]\n");
|
||||
+#else /* USE_CRACKLIB */
|
||||
+ fprintf(stderr, "Usage: afppasswd [-acf] [-u minuid] [-p path] [username]\n");
|
||||
+#endif /* USE_CRACKLIB */
|
||||
+ fprintf(stderr, " -a add a new user\n");
|
||||
+ fprintf(stderr, " -c create and initialize password file or specific user\n");
|
||||
+ fprintf(stderr, " -f force an action\n");
|
||||
+#ifdef USE_CRACKLIB
|
||||
+ fprintf(stderr, " -n disable cracklib checking of passwords\n");
|
||||
+#endif /* USE_CRACKLIB */
|
||||
+ fprintf(stderr, " -u uid minimum uid to use, defaults to 100\n");
|
||||
+ fprintf(stderr, " -p path path to afppasswd file\n");
|
||||
+ exit(-1);
|
||||
+}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -270,16 +286,7 @@ int main(int argc, char **argv)
|
||||
flags = ((uid = getuid()) == 0) ? OPT_ISROOT : 0;
|
||||
|
||||
if (((flags & OPT_ISROOT) == 0) && (argc > 1)) {
|
||||
- fprintf(stderr, "Usage: afppasswd [-acfn] [-u minuid] [-p path] [username]\n");
|
||||
- fprintf(stderr, " -a add a new user\n");
|
||||
- fprintf(stderr, " -c create and initialize password file or specific user\n");
|
||||
- fprintf(stderr, " -f force an action\n");
|
||||
-#ifdef USE_CRACKLIB
|
||||
- fprintf(stderr, " -n disable cracklib checking of passwords\n");
|
||||
-#endif /* USE_CRACKLIB */
|
||||
- fprintf(stderr, " -u uid minimum uid to use, defaults to 100\n");
|
||||
- fprintf(stderr, " -p path path to afppasswd file\n");
|
||||
- return -1;
|
||||
+ usage();
|
||||
}
|
||||
|
||||
while ((i = getopt(argc, argv, OPTIONS)) != EOF) {
|
||||
@@ -312,20 +319,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (err || (optind + ((flags & OPT_CREATE) ? 0 :
|
||||
(flags & OPT_ISROOT)) != argc)) {
|
||||
-#ifdef USE_CRACKLIB
|
||||
- fprintf(stderr, "Usage: afppasswd [-acfn] [-u minuid] [-p path] [username]\n");
|
||||
-#else /* USE_CRACKLIB */
|
||||
- fprintf(stderr, "Usage: afppasswd [-acf] [-u minuid] [-p path] [username]\n");
|
||||
-#endif /* USE_CRACKLIB */
|
||||
- fprintf(stderr, " -a add a new user\n");
|
||||
- fprintf(stderr, " -c create and initialize password file or specific user\n");
|
||||
- fprintf(stderr, " -f force an action\n");
|
||||
-#ifdef USE_CRACKLIB
|
||||
- fprintf(stderr, " -n disable cracklib checking of passwords\n");
|
||||
-#endif /* USE_CRACKLIB */
|
||||
- fprintf(stderr, " -u uid minimum uid to use, defaults to 100\n");
|
||||
- fprintf(stderr, " -p path path to afppasswd file\n");
|
||||
- return -1;
|
||||
+ usage();
|
||||
}
|
||||
|
||||
i = stat(path, &st);
|
@ -1,15 +0,0 @@
|
||||
$OpenBSD: patch-bin_cnid_cnid_index_c,v 1.1 2007/10/26 14:27:23 steven Exp $
|
||||
--- bin/cnid/cnid_index.c.orig Sun Apr 10 14:49:18 2005
|
||||
+++ bin/cnid/cnid_index.c Thu Oct 25 20:45:50 2007
|
||||
@@ -274,7 +274,11 @@ static int dbif_count(const int dbi, u_int32_t *count)
|
||||
DB_BTREE_STAT *sp;
|
||||
DB *db = db_table[dbi].db;
|
||||
|
||||
+#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 2
|
||||
+ ret = db->stat(db, NULL, &sp, 0);
|
||||
+#else
|
||||
ret = db->stat(db, &sp, 0);
|
||||
+#endif
|
||||
|
||||
if (ret) {
|
||||
LOG(log_error, logtype_cnid, "error getting stat infotmation on database: %s", db_strerror(errno));
|
@ -1,30 +0,0 @@
|
||||
$OpenBSD: patch-bin_megatron_megatron_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- bin/megatron/megatron.c.orig Mon Apr 29 03:52:49 2002
|
||||
+++ bin/megatron/megatron.c Thu Oct 25 20:30:05 2007
|
||||
@@ -246,7 +246,7 @@ int megatron( path, module, newname, flags )
|
||||
*/
|
||||
|
||||
if (*newname)
|
||||
- strcpy(fh.name, newname);
|
||||
+ strlcpy(fh.name, newname, sizeof(fh.name));
|
||||
|
||||
if ( to_open( module, path, &fh, flags ) < 0 ) {
|
||||
(void)from_close( module );
|
||||
@@ -302,7 +302,7 @@ int main( argc, argv )
|
||||
int converts = sizeof(name) / sizeof(char *);
|
||||
int module = -1;
|
||||
int flags = 0;
|
||||
- char *progname, newname[ADEDLEN_NAME + 1];
|
||||
+ char *progname, newname[ADEDLEN_NAME];
|
||||
|
||||
progname = strrchr( argv[ 0 ], '/' );
|
||||
if (( progname == NULL ) || ( progname == '\0' )) {
|
||||
@@ -334,7 +334,7 @@ int main( argc, argv )
|
||||
continue;
|
||||
}
|
||||
if ( strcmp( argv [ c ], "--filename" ) == 0 ) {
|
||||
- if(++c < argc) strncpy(newname,argv[c], ADEDLEN_NAME);
|
||||
+ if(++c < argc) strlcpy(newname,argv[c], sizeof(newname));
|
||||
continue;
|
||||
}
|
||||
if (strcmp(argv[c], "--stdout") == 0) {
|
@ -1,65 +0,0 @@
|
||||
$OpenBSD: patch-bin_megatron_nad_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- bin/megatron/nad.c.orig Thu Feb 10 02:23:08 2005
|
||||
+++ bin/megatron/nad.c Thu Oct 25 20:30:05 2007
|
||||
@@ -414,8 +414,8 @@ void select_charset( int options)
|
||||
#endif /* HEXOUTPUT */
|
||||
|
||||
struct nad_file_data {
|
||||
- char macname[ MAXPATHLEN + 1 ];
|
||||
- char adpath[ 2 ][ MAXPATHLEN + 1];
|
||||
+ char macname[ MAXPATHLEN];
|
||||
+ char adpath[ 2 ][ MAXPATHLEN];
|
||||
int offset[ NUMFORKS ];
|
||||
struct adouble ad;
|
||||
} nad;
|
||||
@@ -451,9 +451,10 @@ int nad_open( path, openflags, fh, options )
|
||||
|
||||
if ( openflags == O_RDONLY ) {
|
||||
initvol(path);
|
||||
- strcpy( nad.adpath[0], path );
|
||||
- strcpy( nad.adpath[1],
|
||||
- nad.ad.ad_path( nad.adpath[0], ADFLAGS_DF|ADFLAGS_HF ));
|
||||
+ strlcpy( nad.adpath[0], path, sizeof(nad.adpath[0]) );
|
||||
+ strlcpy( nad.adpath[1],
|
||||
+ nad.ad.ad_path( nad.adpath[0], ADFLAGS_DF|ADFLAGS_HF ),
|
||||
+ sizeof(nad.adpath[1]));
|
||||
for ( fork = 0 ; fork < NUMFORKS ; fork++ ) {
|
||||
if ( stat( nad.adpath[ fork ], &st ) < 0 ) {
|
||||
if ( errno == ENOENT ) {
|
||||
@@ -478,10 +479,11 @@ int nad_open( path, openflags, fh, options )
|
||||
|
||||
} else {
|
||||
initvol (".");
|
||||
- strcpy( nad.macname, fh->name );
|
||||
- strcpy( nad.adpath[0], mtoupath( nad.macname ));
|
||||
- strcpy( nad.adpath[1],
|
||||
- nad.ad.ad_path( nad.adpath[0], ADFLAGS_DF|ADFLAGS_HF ));
|
||||
+ strlcpy( nad.macname, fh->name, sizeof(nad.macname) );
|
||||
+ strlcpy( nad.adpath[0], mtoupath( nad.macname ), sizeof(nad.adpath[0]));
|
||||
+ strlcpy( nad.adpath[1],
|
||||
+ nad.ad.ad_path( nad.adpath[0], ADFLAGS_DF|ADFLAGS_HF ),
|
||||
+ sizeof(nad.adpath[1]) );
|
||||
#if DEBUG
|
||||
fprintf(stderr, "%s\n", nad.macname);
|
||||
fprintf(stderr, "%s is adpath[0]\n", nad.adpath[0]);
|
||||
@@ -512,7 +514,7 @@ int nad_header_read( fh )
|
||||
memcpy( nad.macname, ad_entry( &nad.ad, ADEID_NAME ),
|
||||
ad_getentrylen( &nad.ad, ADEID_NAME ));
|
||||
nad.macname[ ad_getentrylen( &nad.ad, ADEID_NAME ) ] = '\0';
|
||||
- strcpy( fh->name, nad.macname );
|
||||
+ strlcpy( fh->name, nad.macname, sizeof(fh->name) );
|
||||
#endif
|
||||
|
||||
/* just in case there's nothing in macname */
|
||||
@@ -521,9 +523,9 @@ int nad_header_read( fh )
|
||||
p = nad.adpath[DATA];
|
||||
else p++;
|
||||
#if 0
|
||||
- strcpy(fh->name, utompath(nad.adpath[DATA]));
|
||||
+ strlcpy(fh->name, utompath(nad.adpath[DATA]), sizeof(fh->name));
|
||||
#endif
|
||||
- strcpy(fh->name, utompath(p));
|
||||
+ strlcpy(fh->name, utompath(p), sizeof(fh->name));
|
||||
}
|
||||
|
||||
if ( stat( nad.adpath[ DATA ], &st ) < 0 ) {
|
@ -1,32 +0,0 @@
|
||||
$OpenBSD: patch-bin_nbp_nbplkup_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- bin/nbp/nbplkup.c.orig Mon Jan 31 14:50:35 2005
|
||||
+++ bin/nbp/nbplkup.c Sat Dec 31 00:15:28 2005
|
||||
@@ -126,25 +126,22 @@ int main( ac, av )
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
- if (( name = (char *)malloc( strlen( Obj ) + 1 )) == NULL ) {
|
||||
+ if (asprintf(&name, "%s", Obj)) {
|
||||
perror( "malloc" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( name, Obj );
|
||||
Obj = name;
|
||||
|
||||
- if (( name = (char *)malloc( strlen( Type ) + 1 )) == NULL ) {
|
||||
+ if (asprintf(&name, "%s", Type)) {
|
||||
perror( "malloc" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( name, Type );
|
||||
Type = name;
|
||||
|
||||
- if (( name = (char *)malloc( strlen( Zone ) + 1 )) == NULL ) {
|
||||
+ if (asprintf(&name, "%s", Zone)) {
|
||||
perror( "malloc" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( name, Zone );
|
||||
Zone = name;
|
||||
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
$OpenBSD: patch-bin_psorder_psorder_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- bin/psorder/psorder.c.orig Fri Jun 29 10:14:46 2001
|
||||
+++ bin/psorder/psorder.c Sat Dec 31 11:48:01 2005
|
||||
@@ -151,7 +151,7 @@ filesetup( inputfile, infd, tfile, tfd )
|
||||
make temporary file
|
||||
*/
|
||||
|
||||
- (void *)strncpy( tfile, template, MAXNAMLEN );
|
||||
+ (void *)strlcpy( tfile, template, MAXNAMLEN );
|
||||
if (( *tfd = mkstemp( tfile )) == -1 ) {
|
||||
fprintf( stderr, "can't create temporary file %s\n", tfile );
|
||||
filecleanup( -1, -1, "" );
|
||||
@@ -391,11 +391,12 @@ writeps( tempfd, tempfile )
|
||||
} else if (( strncmp( psinfo.pages.order, "", ORDERLEN ) == 0 ) ||
|
||||
( strncmp( psinfo.pages.order, "1", ORDERLEN ) == 0 )) {
|
||||
order = orderflag;
|
||||
- if ( order == REVERSE ) strcpy( psinfo.pages.order, "-1" );
|
||||
+ if ( order == REVERSE )
|
||||
+ strlcpy( psinfo.pages.order, "-1", sizeof(psinfo.pages.order) );
|
||||
} else if ( strncmp( psinfo.pages.order, "-1", ORDERLEN ) == 0 ) {
|
||||
if ( orderflag == FORWARD ) {
|
||||
order = REVERSE;
|
||||
- strcpy( psinfo.pages.order, "1" );
|
||||
+ strlcpy( psinfo.pages.order, "1", sizeof(psinfo.pages.order) );
|
||||
} else order = FORWARD;
|
||||
} else if (( strncmp( psinfo.pages.order, "0", ORDERLEN ) == 0 ) &&
|
||||
forceflag ) {
|
||||
@@ -481,7 +482,7 @@ writelable( tempfd, tempfile, lable )
|
||||
} else {
|
||||
argone = argtwo = NULL;
|
||||
}
|
||||
- (void)sprintf( line, "%s %s %s", lable, argone, argtwo );
|
||||
+ (void)snprintf( line, sizeof(line), "%s %s %s", lable, argone, argtwo );
|
||||
linelen = strlen( line );
|
||||
|
||||
ccwrite = write( 1, line, linelen );
|
@ -1,21 +0,0 @@
|
||||
$OpenBSD: patch-bin_uniconv_uniconv_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- bin/uniconv/uniconv.c.orig Mon Jul 12 02:15:18 2004
|
||||
+++ bin/uniconv/uniconv.c Thu Oct 25 20:30:05 2007
|
||||
@@ -105,7 +105,7 @@ static int veto(const char *path)
|
||||
|
||||
static int do_rename( char* src, char *dst, struct stat *st)
|
||||
{
|
||||
- char adsrc[ MAXPATHLEN + 1];
|
||||
+ char adsrc[ MAXPATHLEN];
|
||||
struct stat tmp_st;
|
||||
|
||||
if (!stat(dst, &tmp_st)) {
|
||||
@@ -121,7 +121,7 @@ static int do_rename( char* src, char *dst, struct sta
|
||||
if (S_ISDIR(st->st_mode))
|
||||
return 0;
|
||||
|
||||
- strcpy( adsrc, ad_path( src, 0 ));
|
||||
+ strlcpy( adsrc, ad_path( src, 0 ), sizeof(adsrc));
|
||||
|
||||
if (rename( adsrc, ad_path( dst, 0 )) < 0 ) {
|
||||
struct stat ad_st;
|
@ -1,13 +1,14 @@
|
||||
$OpenBSD: patch-configure,v 1.1 2010/03/01 13:41:31 espie Exp $
|
||||
--- configure.orig Mon Mar 1 14:34:29 2010
|
||||
+++ configure Mon Mar 1 14:35:13 2010
|
||||
@@ -16705,6 +16705,9 @@ fi
|
||||
fi
|
||||
|
||||
netatalk_cv_install_pam=yes
|
||||
+ if test x"$pam_found" = "xno"; then
|
||||
+ netatalk_cv_install_pam=no
|
||||
+ fi
|
||||
if test x"$pam_found" = "xyes" -a "x$PAMDIR" = "xNONE"; then
|
||||
{ echo "$as_me:$LINENO: WARNING: PAM support can be compiled, but the install location for the netatalk.pamd file could not be determined. Either install this file by hand or specify the install path." >&5
|
||||
echo "$as_me: WARNING: PAM support can be compiled, but the install location for the netatalk.pamd file could not be determined. Either install this file by hand or specify the install path." >&2;}
|
||||
$OpenBSD: patch-configure,v 1.2 2012/04/11 18:39:13 sthen Exp $
|
||||
--- configure.orig Thu Jan 12 04:11:55 2012
|
||||
+++ configure Mon Jan 16 16:35:56 2012
|
||||
@@ -25308,8 +25308,8 @@ for ac_lib in '' pthread; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
- ac_res=-l$ac_lib
|
||||
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
+ ac_res=-$ac_lib
|
||||
+ LIBS="-$ac_lib $ac_func_search_save_LIBS"
|
||||
fi
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
|
@ -1,42 +0,0 @@
|
||||
$OpenBSD: patch-etc_afpd_auth_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- etc/afpd/auth.c.orig Fri Mar 11 16:36:58 2005
|
||||
+++ etc/afpd/auth.c Thu Oct 25 20:30:05 2007
|
||||
@@ -244,7 +244,7 @@ static int login(AFPObj *obj, struct passwd *pwd, void
|
||||
int mypid = getpid();
|
||||
struct stat stat_buf;
|
||||
|
||||
- sprintf(nodename, "%s/net%d.%dnode%d", obj->options.authprintdir,
|
||||
+ snprintf(nodename, sizeof(nodename), "%s/net%d.%dnode%d", obj->options.authprintdir,
|
||||
addr_net / 256, addr_net % 256, addr_node);
|
||||
LOG(log_info, logtype_afpd, "registering %s (uid %d) on %u.%u as %s",
|
||||
pwd->pw_name, pwd->pw_uid, addr_net, addr_node, nodename);
|
||||
@@ -333,7 +333,7 @@ static int login(AFPObj *obj, struct passwd *pwd, void
|
||||
else
|
||||
clientname = inet_ntoa( dsi->client.sin_addr );
|
||||
|
||||
- sprintf( hostname, "%s@%s", pwd->pw_name, clientname );
|
||||
+ snprintf( hostname, sizeof(hostname), "%s@%s", pwd->pw_name, clientname );
|
||||
|
||||
if( sia_become_user( NULL, argc, argv, hostname, pwd->pw_name,
|
||||
NULL, FALSE, NULL, NULL,
|
||||
@@ -999,7 +999,7 @@ int auth_register(const int type, struct uam_obj *uam)
|
||||
/* load all of the modules */
|
||||
int auth_load(const char *path, const char *list)
|
||||
{
|
||||
- char name[MAXPATHLEN + 1], buf[MAXPATHLEN + 1], *p;
|
||||
+ char name[MAXPATHLEN], buf[MAXPATHLEN], *p;
|
||||
struct uam_mod *mod;
|
||||
struct stat st;
|
||||
size_t len;
|
||||
@@ -1011,9 +1011,9 @@ int auth_load(const char *path, const char *list)
|
||||
if ((p = strtok(buf, ",")) == NULL)
|
||||
return -1;
|
||||
|
||||
- strcpy(name, path);
|
||||
+ strlcpy(name, path, sizeof(name));
|
||||
if (name[len - 1] != '/') {
|
||||
- strcat(name, "/");
|
||||
+ strlcat(name, "/", sizeof(name));
|
||||
len++;
|
||||
}
|
||||
|
@ -1,181 +0,0 @@
|
||||
$OpenBSD: patch-etc_afpd_directory_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- etc/afpd/directory.c.orig Thu Feb 10 02:23:10 2005
|
||||
+++ etc/afpd/directory.c Thu Oct 25 20:30:05 2007
|
||||
@@ -681,7 +681,7 @@ int netatalk_unlink(const char *name)
|
||||
/* ------------------- */
|
||||
static int deletedir(char *dir)
|
||||
{
|
||||
- char path[MAXPATHLEN + 1];
|
||||
+ char path[MAXPATHLEN];
|
||||
DIR *dp;
|
||||
struct dirent *de;
|
||||
struct stat st;
|
||||
@@ -696,8 +696,8 @@ static int deletedir(char *dir)
|
||||
if ((dp = opendir(dir)) == NULL)
|
||||
return AFP_OK;
|
||||
|
||||
- strcpy(path, dir);
|
||||
- strcat(path, "/");
|
||||
+ strlcpy(path, dir, sizeof(path));
|
||||
+ strlcat(path, "/", sizeof(path));
|
||||
len++;
|
||||
remain = sizeof(path) -len -1;
|
||||
while ((de = readdir(dp)) && err == AFP_OK) {
|
||||
@@ -709,7 +709,7 @@ static int deletedir(char *dir)
|
||||
err = AFPERR_PARAM;
|
||||
break;
|
||||
}
|
||||
- strcpy(path + len, de->d_name);
|
||||
+ strlcat(path, de->d_name, sizeof(path));
|
||||
if (stat(path, &st)) {
|
||||
continue;
|
||||
}
|
||||
@@ -732,7 +732,7 @@ static int deletedir(char *dir)
|
||||
/* do a recursive copy. */
|
||||
static int copydir(const struct vol *vol, char *src, char *dst)
|
||||
{
|
||||
- char spath[MAXPATHLEN + 1], dpath[MAXPATHLEN + 1];
|
||||
+ char spath[MAXPATHLEN], dpath[MAXPATHLEN];
|
||||
DIR *dp;
|
||||
struct dirent *de;
|
||||
struct stat st;
|
||||
@@ -754,13 +754,13 @@ static int copydir(const struct vol *vol, char *src, c
|
||||
}
|
||||
|
||||
/* set things up to copy */
|
||||
- strcpy(spath, src);
|
||||
- strcat(spath, "/");
|
||||
+ strlcpy(spath, src, sizeof(spath));
|
||||
+ strlcat(spath, "/", sizeof(spath));
|
||||
slen++;
|
||||
srem = sizeof(spath) - slen -1;
|
||||
|
||||
- strcpy(dpath, dst);
|
||||
- strcat(dpath, "/");
|
||||
+ strlcpy(dpath, dst, sizeof(dpath));
|
||||
+ strlcat(dpath, "/", sizeof(dpath));
|
||||
dlen++;
|
||||
drem = sizeof(dpath) - dlen -1;
|
||||
|
||||
@@ -774,14 +774,14 @@ static int copydir(const struct vol *vol, char *src, c
|
||||
err = AFPERR_PARAM;
|
||||
break;
|
||||
}
|
||||
- strcpy(spath + slen, de->d_name);
|
||||
+ strlcat(spath, de->d_name, sizeof(spath));
|
||||
|
||||
if (stat(spath, &st) == 0) {
|
||||
if (strlen(de->d_name) > drem) {
|
||||
err = AFPERR_PARAM;
|
||||
break;
|
||||
}
|
||||
- strcpy(dpath + dlen, de->d_name);
|
||||
+ strlcpy(dpath, de->d_name, sizeof(dpath));
|
||||
|
||||
if (S_ISDIR(st.st_mode)) {
|
||||
if (AFP_OK != (err = copydir(vol, spath, dpath)))
|
||||
@@ -969,7 +969,7 @@ struct dir *dir;
|
||||
char **cpath;
|
||||
{
|
||||
struct dir *cdir;
|
||||
- static char path[ MAXPATHLEN + 1];
|
||||
+ static char path[ MAXPATHLEN ];
|
||||
static struct path ret;
|
||||
|
||||
char *data, *p;
|
||||
@@ -1045,16 +1045,13 @@ char **cpath;
|
||||
if ( movecwd( vol, dir->d_parent ) < 0 ) {
|
||||
return NULL;
|
||||
}
|
||||
- strcpy(path, dir->d_m_name);
|
||||
+ strlcpy(path, dir->d_m_name, sizeof(path));
|
||||
if (dir->d_m_name == dir->d_u_name) {
|
||||
ret.u_name = path;
|
||||
}
|
||||
else {
|
||||
- size_t tp = strlen(path)+1;
|
||||
-
|
||||
- strcpy(path +tp, dir->d_u_name);
|
||||
- ret.u_name = path +tp;
|
||||
-
|
||||
+ ret.u_name = path + (strlen(path) + 1);
|
||||
+ strlcat(path, dir->d_u_name, sizeof(path));
|
||||
}
|
||||
/* FIXME should we set :
|
||||
ret.st_valid = 1;
|
||||
@@ -1120,7 +1117,7 @@ char **cpath;
|
||||
afp_errno = AFPERR_PARAM;
|
||||
return( NULL );
|
||||
}
|
||||
- strcpy(path, temp);
|
||||
+ strlcpy(path, temp, sizeof(path));
|
||||
}
|
||||
/* check for OS X mangled filename :( */
|
||||
|
||||
@@ -1132,8 +1129,8 @@ char **cpath;
|
||||
*/
|
||||
if ( (t = utompath(vol, ret.u_name, fileid, utf8_encoding())) ) {
|
||||
/* at last got our view of mac name */
|
||||
- strcpy(path,t);
|
||||
- }
|
||||
+ strlcpy(path, t, sizeof(path));
|
||||
+ }
|
||||
}
|
||||
}
|
||||
if ( !extend ) {
|
||||
@@ -1192,7 +1189,7 @@ int movecwd( vol, dir)
|
||||
const struct vol *vol;
|
||||
struct dir *dir;
|
||||
{
|
||||
- char path[MAXPATHLEN + 1];
|
||||
+ char path[MAXPATHLEN];
|
||||
struct dir *d;
|
||||
char *p, *u;
|
||||
int n;
|
||||
@@ -2111,25 +2108,25 @@ struct dir *dir, *newparent;
|
||||
if (dir->d_m_name == dir->d_u_name)
|
||||
dir->d_u_name = NULL;
|
||||
|
||||
- if ((buf = (char *) realloc( dir->d_m_name, len + 1 )) == NULL ) {
|
||||
+ if ((buf = strdup(newname)) == NULL ) {
|
||||
LOG(log_error, logtype_afpd, "renamedir: realloc mac name: %s", strerror(errno) );
|
||||
/* FIXME : fatal ? */
|
||||
return AFPERR_MISC;
|
||||
}
|
||||
+ free(dir->d_m_name);
|
||||
dir->d_m_name = buf;
|
||||
- strcpy( dir->d_m_name, newname );
|
||||
|
||||
if (newname == dst) {
|
||||
free(dir->d_u_name);
|
||||
dir->d_u_name = dir->d_m_name;
|
||||
}
|
||||
else {
|
||||
- if ((buf = (char *) realloc( dir->d_u_name, strlen(dst) + 1 )) == NULL ) {
|
||||
+ if ((buf = strdup(dst)) == NULL ) {
|
||||
LOG(log_error, logtype_afpd, "renamedir: realloc unix name: %s", strerror(errno) );
|
||||
return AFPERR_MISC;
|
||||
}
|
||||
+ free(dir->d_u_name);
|
||||
dir->d_u_name = buf;
|
||||
- strcpy( dir->d_u_name, dst );
|
||||
}
|
||||
|
||||
if (( parent = dir->d_parent ) == NULL ) {
|
||||
@@ -2146,7 +2143,6 @@ struct dir *dir, *newparent;
|
||||
return( AFP_OK );
|
||||
}
|
||||
|
||||
-#define DOT_APPLEDOUBLE_LEN 13
|
||||
/* delete an empty directory */
|
||||
int deletecurdir( vol, path, pathlen )
|
||||
const struct vol *vol;
|
||||
@@ -2200,7 +2196,7 @@ int pathlen;
|
||||
return AFPERR_DIRNEMPT;
|
||||
}
|
||||
|
||||
- strcpy(path + DOT_APPLEDOUBLE_LEN, de->d_name);
|
||||
+ strcat(path, de->d_name);
|
||||
if ((err = netatalk_unlink(path))) {
|
||||
closedir(dp);
|
||||
return err;
|
@ -1,21 +0,0 @@
|
||||
$OpenBSD: patch-etc_afpd_file_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/afpd/file.c.orig Thu Apr 28 05:24:04 2005
|
||||
+++ etc/afpd/file.c Fri Dec 30 23:30:05 2005
|
||||
@@ -1026,7 +1026,7 @@ const struct vol *vol;
|
||||
char *src, *dst, *newname;
|
||||
struct adouble *adp;
|
||||
{
|
||||
- char adsrc[ MAXPATHLEN + 1];
|
||||
+ char adsrc[ MAXPATHLEN];
|
||||
int rc;
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -1061,7 +1061,7 @@ struct adouble *adp;
|
||||
}
|
||||
}
|
||||
|
||||
- strcpy( adsrc, vol->ad_path( src, 0 ));
|
||||
+ strlcpy( adsrc, vol->ad_path( src, 0 ), sizeof(adsrc));
|
||||
|
||||
if (unix_rename( adsrc, vol->ad_path( dst, 0 )) < 0 ) {
|
||||
struct stat st;
|
@ -1,39 +0,0 @@
|
||||
$OpenBSD: patch-etc_afpd_mangle_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- etc/afpd/mangle.c.orig Mon Feb 14 17:01:54 2005
|
||||
+++ etc/afpd/mangle.c Thu Oct 25 20:30:05 2007
|
||||
@@ -235,7 +235,7 @@ unsigned char *
|
||||
mangle(const struct vol *vol, unsigned char *filename, size_t filenamelen, unsigned char *uname, cnid_t id, int flags) {
|
||||
unsigned char *ext = NULL;
|
||||
unsigned char *m = NULL;
|
||||
- static unsigned char mfilename[MAXPATHLEN + 1];
|
||||
+ static unsigned char mfilename[MAXPATHLEN];
|
||||
unsigned char mangle_suffix[MANGLE_LENGTH + 1];
|
||||
size_t ext_len = 0;
|
||||
size_t maxlen;
|
||||
@@ -259,19 +259,19 @@ mangle(const struct vol *vol, unsigned char *filename,
|
||||
ext_len = MAX_EXT_LENGTH;
|
||||
}
|
||||
}
|
||||
- m = mfilename;
|
||||
- k = sprintf(mangle_suffix, "%c%X", MANGLE_CHAR, ntohl(id));
|
||||
+ k = snprintf(mangle_suffix, sizeof(mangle_suffix), "%c%X", MANGLE_CHAR, ntohl(id));
|
||||
|
||||
- strlcpy(m, filename, maxlen - k - ext_len +1);
|
||||
+ strlcpy(mfilename, filename, maxlen - k - ext_len +1);
|
||||
+ m = mfilename;
|
||||
if (flags & 2)
|
||||
m = utf8_mangle_validate(m, maxlen - k - ext_len +1);
|
||||
if (*m == 0) {
|
||||
- strcat(m, "???");
|
||||
+ strlcat(mfilename, "???", sizeof(mfilename));
|
||||
}
|
||||
- strcat(m, mangle_suffix);
|
||||
+ strlcat(mfilename, mangle_suffix, sizeof(mfilename));
|
||||
if (ext) {
|
||||
- strncat(m, ext, ext_len);
|
||||
+ strlcat(mfilename, ext, sizeof(mfilename));
|
||||
}
|
||||
|
||||
- return m;
|
||||
+ return mfilename;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
$OpenBSD: patch-etc_afpd_ofork_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/afpd/ofork.c.orig Wed Feb 9 20:23:15 2005
|
||||
+++ etc/afpd/ofork.c Sat Dec 31 00:29:55 2005
|
||||
@@ -289,7 +289,7 @@ int ret;
|
||||
/* -------------------------- */
|
||||
int of_statdir (const struct vol *vol, struct path *path)
|
||||
{
|
||||
-static char pathname[ MAXPATHLEN + 1];
|
||||
+static char pathname[ MAXPATHLEN];
|
||||
int ret;
|
||||
|
||||
if (*path->m_name) {
|
||||
@@ -299,8 +299,8 @@ int ret;
|
||||
path->st_errno = 0;
|
||||
path->st_valid = 1;
|
||||
/* FIXME, what about: we don't have r-x perm anymore ? */
|
||||
- strcpy(pathname, "../");
|
||||
- strlcat(pathname, path->d_dir->d_u_name, MAXPATHLEN);
|
||||
+ strlcpy(pathname, "../", sizeof(pathname));
|
||||
+ strlcat(pathname, path->d_dir->d_u_name, sizeof(pathname));
|
||||
|
||||
if (!(ret = stat(pathname, &path->st)))
|
||||
return 0;
|
@ -1,140 +0,0 @@
|
||||
$OpenBSD: patch-etc_afpd_unix_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- etc/afpd/unix.c.orig Wed Jun 16 00:53:55 2004
|
||||
+++ etc/afpd/unix.c Thu Oct 25 20:30:05 2007
|
||||
@@ -342,8 +342,8 @@ const mode_t mode;
|
||||
strcmp( deskp->d_name, ".." ) == 0 || strlen( deskp->d_name ) > 2 ) {
|
||||
continue;
|
||||
}
|
||||
- strcpy( modbuf, deskp->d_name );
|
||||
- strcat( modbuf, "/" );
|
||||
+ strlcpy( modbuf, deskp->d_name, sizeof(modbuf) );
|
||||
+ strlcat( modbuf, "/", sizeof(modbuf) );
|
||||
m = strchr( modbuf, '\0' );
|
||||
if (( sub = opendir( deskp->d_name )) == NULL ) {
|
||||
continue;
|
||||
@@ -354,7 +354,7 @@ const mode_t mode;
|
||||
continue;
|
||||
}
|
||||
*m = '\0';
|
||||
- strcat( modbuf, subp->d_name );
|
||||
+ strlcat( modbuf, subp->d_name, sizeof(modbuf) );
|
||||
/* XXX: need to preserve special modes */
|
||||
if (stat(modbuf, &st) < 0) {
|
||||
LOG(log_error, logtype_afpd, "setdeskmode: stat %s: %s",fullpathname(modbuf), strerror(errno) );
|
||||
@@ -471,7 +471,7 @@ const struct vol *vol;
|
||||
const char *name;
|
||||
const mode_t mode;
|
||||
{
|
||||
- char buf[ MAXPATHLEN + 1];
|
||||
+ char buf[ MAXPATHLEN];
|
||||
struct stat st;
|
||||
char *m;
|
||||
struct dirent *dirp;
|
||||
@@ -540,8 +540,8 @@ const mode_t mode;
|
||||
LOG(log_error, logtype_afpd, "setdirmode: opendir %s: %s", fullpathname(".AppleDouble"),strerror(errno) );
|
||||
return( -1 );
|
||||
}
|
||||
- strcpy( buf, adouble_p);
|
||||
- strcat( buf, "/" );
|
||||
+ strlcpy( buf, adouble_p, sizeof(buf));
|
||||
+ strlcat( buf, "/", sizeof(buf) );
|
||||
m = strchr( buf, '\0' );
|
||||
for ( dirp = readdir( dir ); dirp != NULL; dirp = readdir( dir )) {
|
||||
if ( strcmp( dirp->d_name, "." ) == 0 ||
|
||||
@@ -549,7 +549,7 @@ const mode_t mode;
|
||||
continue;
|
||||
}
|
||||
*m = '\0';
|
||||
- strcat( buf, dirp->d_name );
|
||||
+ strlcat( buf, dirp->d_name, sizeof(buf) );
|
||||
|
||||
if ( stat( buf, &st ) < 0 ) {
|
||||
LOG(log_error, logtype_afpd, "setdirmode: stat %s: %s", buf, strerror(errno) );
|
||||
@@ -582,7 +582,7 @@ int setdeskowner( uid, gid )
|
||||
const uid_t uid;
|
||||
const gid_t gid;
|
||||
{
|
||||
- char wd[ MAXPATHLEN + 1];
|
||||
+ char wd[ MAXPATHLEN];
|
||||
char modbuf[12 + 1], *m;
|
||||
struct dirent *deskp, *subp;
|
||||
DIR *desk, *sub;
|
||||
@@ -605,8 +605,8 @@ const gid_t gid;
|
||||
strlen( deskp->d_name ) > 2 ) {
|
||||
continue;
|
||||
}
|
||||
- strcpy( modbuf, deskp->d_name );
|
||||
- strcat( modbuf, "/" );
|
||||
+ strlcpy( modbuf, deskp->d_name, sizeof(modbuf));
|
||||
+ strlcat( modbuf, "/", sizeof(modbuf) );
|
||||
m = strchr( modbuf, '\0' );
|
||||
if (( sub = opendir( deskp->d_name )) == NULL ) {
|
||||
continue;
|
||||
@@ -617,7 +617,7 @@ const gid_t gid;
|
||||
continue;
|
||||
}
|
||||
*m = '\0';
|
||||
- strcat( modbuf, subp->d_name );
|
||||
+ strlcat( modbuf, subp->d_name, sizeof(modbuf) );
|
||||
/* XXX: add special any uid, ignore group bits */
|
||||
if ( chown( modbuf, uid, gid ) < 0 && errno != EPERM ) {
|
||||
LOG(log_error, logtype_afpd, "setdeskown: chown %s: %s", fullpathname(modbuf), strerror(errno) );
|
||||
@@ -692,7 +692,7 @@ const char *name;
|
||||
const uid_t uid;
|
||||
const gid_t gid;
|
||||
{
|
||||
- char buf[ MAXPATHLEN + 1];
|
||||
+ char buf[ MAXPATHLEN];
|
||||
struct stat st;
|
||||
char *m;
|
||||
struct dirent *dirp;
|
||||
@@ -735,16 +735,16 @@ const gid_t gid;
|
||||
goto setdirowner_noadouble;
|
||||
return( -1 );
|
||||
}
|
||||
- strcpy( buf, adouble_p );
|
||||
- strcat( buf, "/" );
|
||||
- m = strchr( buf, '\0' );
|
||||
+ strlcpy( buf, adouble_p, sizeof(buf) );
|
||||
+ strlcat( buf, "/", sizeof(buf) );
|
||||
+ m = strchr(buf, '\0');
|
||||
for ( dirp = readdir( dir ); dirp != NULL; dirp = readdir( dir )) {
|
||||
if ( strcmp( dirp->d_name, "." ) == 0 ||
|
||||
strcmp( dirp->d_name, ".." ) == 0 ) {
|
||||
continue;
|
||||
}
|
||||
*m = '\0';
|
||||
- strcat( buf, dirp->d_name );
|
||||
+ strlcat( buf, dirp->d_name, sizeof(buf));
|
||||
if ( chown( buf, uid, gid ) < 0 && errno != EPERM ) {
|
||||
LOG(log_debug, logtype_afpd, "setdirowner: chown %d/%d %s: %s",
|
||||
uid, gid, fullpathname(buf), strerror(errno) );
|
||||
@@ -788,8 +788,8 @@ static int recursive_chown(const char *path, uid_t uid
|
||||
struct dirent *entry;
|
||||
char *name;
|
||||
int ret = 0;
|
||||
- char newpath[PATH_MAX+1];
|
||||
- newpath[PATH_MAX] = '\0';
|
||||
+ char newpath[PATH_MAX];
|
||||
+ newpath[PATH_MAX - 1] = '\0';
|
||||
|
||||
if (chown(path, uid, gid) < 0) {
|
||||
LOG(log_error, logtype_afpd, "cannot chown() file [%s] (uid = %d): %s", path, uid, strerror(errno));
|
||||
@@ -831,7 +831,7 @@ recursive_chown_end:
|
||||
int unix_rename(const char *oldpath, const char *newpath)
|
||||
{
|
||||
#if 0
|
||||
- char pd_name[PATH_MAX+1];
|
||||
+ char pd_name[PATH_MAX];
|
||||
int i;
|
||||
struct stat pd_stat;
|
||||
uid_t uid;
|
||||
@@ -840,7 +840,7 @@ int unix_rename(const char *oldpath, const char *newpa
|
||||
if (rename(oldpath, newpath) < 0)
|
||||
return -1;
|
||||
#if 0
|
||||
- for (i = 0; i <= PATH_MAX && newpath[i] != '\0'; i++)
|
||||
+ for (i = 0; i < PATH_MAX && newpath[i] != '\0'; i++)
|
||||
pd_name[i] = newpath[i];
|
||||
pd_name[i] = '\0';
|
||||
|
@ -1,208 +0,0 @@
|
||||
$OpenBSD: patch-etc_afpd_volume_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- etc/afpd/volume.c.orig Mon Apr 25 00:26:31 2005
|
||||
+++ etc/afpd/volume.c Thu Oct 25 20:30:05 2007
|
||||
@@ -231,13 +231,14 @@ static char *volxlate(AFPObj *obj, char *dest, size_t
|
||||
return NULL;
|
||||
}
|
||||
if (!dest) {
|
||||
- dest = calloc(destlen +1, 1);
|
||||
+ destlen++;
|
||||
+ dest = malloc(destlen);
|
||||
}
|
||||
ret = dest;
|
||||
if (!ret) {
|
||||
return NULL;
|
||||
}
|
||||
- strlcpy(dest, src, destlen +1);
|
||||
+ strlcpy(dest, src, destlen);
|
||||
if ((p = strchr(src, '$')) == NULL) /* nothing to do */
|
||||
return ret;
|
||||
|
||||
@@ -262,7 +263,7 @@ static char *volxlate(AFPObj *obj, char *dest, size_t
|
||||
if (obj->proto == AFPPROTO_ASP) {
|
||||
ASP asp = obj->handle;
|
||||
|
||||
- len = sprintf(dest, "%u.%u", ntohs(asp->asp_sat.sat_addr.s_net),
|
||||
+ len = snprintf(dest, destlen, "%u.%u", ntohs(asp->asp_sat.sat_addr.s_net),
|
||||
asp->asp_sat.sat_addr.s_node);
|
||||
dest += len;
|
||||
destlen -= len;
|
||||
@@ -270,7 +271,7 @@ static char *volxlate(AFPObj *obj, char *dest, size_t
|
||||
} else if (obj->proto == AFPPROTO_DSI) {
|
||||
DSI *dsi = obj->handle;
|
||||
|
||||
- len = sprintf(dest, "%s:%u", inet_ntoa(dsi->client.sin_addr),
|
||||
+ len = snprintf(dest, destlen, "%s:%u", inet_ntoa(dsi->client.sin_addr),
|
||||
ntohs(dsi->client.sin_port));
|
||||
dest += len;
|
||||
destlen -= len;
|
||||
@@ -291,7 +292,7 @@ static char *volxlate(AFPObj *obj, char *dest, size_t
|
||||
if (obj->proto == AFPPROTO_ASP) {
|
||||
ASP asp = obj->handle;
|
||||
|
||||
- len = sprintf(dest, "%u", ntohs(asp->asp_sat.sat_addr.s_net));
|
||||
+ len = snprintf(dest, destlen, "%u", ntohs(asp->asp_sat.sat_addr.s_net));
|
||||
dest += len;
|
||||
destlen -= len;
|
||||
|
||||
@@ -606,14 +607,13 @@ static int creatvol(AFPObj *obj, struct passwd *pwd,
|
||||
free(volume);
|
||||
return -1;
|
||||
}
|
||||
- if (!( volume->v_path = (char *)malloc( strlen( path ) + 1 )) ) {
|
||||
+ if ((volume->v_path = strdup( path )) == NULL) {
|
||||
LOG(log_error, logtype_afpd, "creatvol: malloc: %s", strerror(errno) );
|
||||
free(volume->v_name);
|
||||
free(volume);
|
||||
return -1;
|
||||
}
|
||||
volume->v_hide = hide;
|
||||
- strcpy( volume->v_path, path );
|
||||
|
||||
#ifdef __svr4__
|
||||
volume->v_qfd = -1;
|
||||
@@ -910,8 +910,8 @@ int user;
|
||||
struct passwd *pwent;
|
||||
{
|
||||
FILE *fp;
|
||||
- char path[ MAXPATHLEN + 1], tmp[ MAXPATHLEN + 1],
|
||||
- volname[ AFPVOL_NAMELEN + 1 ], buf[ BUFSIZ ],
|
||||
+ char path[ MAXPATHLEN ], tmp[ MAXPATHLEN ],
|
||||
+ volname[ AFPVOL_NAMELEN ], buf[ BUFSIZ ],
|
||||
type[ 5 ], creator[ 5 ];
|
||||
char *u, *p;
|
||||
struct passwd *pw;
|
||||
@@ -923,10 +923,10 @@ struct passwd *pwent;
|
||||
if (!p1->name)
|
||||
return -1;
|
||||
p1->mtime = 0;
|
||||
- strcpy( path, p1->name );
|
||||
+ strlcpy( path, p1->name , sizeof(path));
|
||||
if ( p2 != NULL ) {
|
||||
- strcat( path, "/" );
|
||||
- strcat( path, p2 );
|
||||
+ strlcat( path, "/", sizeof(path) );
|
||||
+ strlcat( path, p2, sizeof(path) );
|
||||
if (p1->full_name) {
|
||||
free(p1->full_name);
|
||||
}
|
||||
@@ -942,9 +942,9 @@ struct passwd *pwent;
|
||||
}
|
||||
|
||||
memset(save_options, 0, sizeof(save_options));
|
||||
- while ( myfgets( buf, sizeof( buf ), fp ) != NULL ) {
|
||||
+ while ( myfgets( buf, sizeof( buf ) - 1, fp ) != NULL ) {
|
||||
initline( strlen( buf ), buf );
|
||||
- parseline( sizeof( path ) - 1, path );
|
||||
+ parseline( sizeof( path ) , path );
|
||||
switch ( *path ) {
|
||||
case '\0' :
|
||||
case '#' :
|
||||
@@ -955,10 +955,10 @@ struct passwd *pwent;
|
||||
if (strncmp(path, VOLOPT_DEFAULT, VOLOPT_DEFAULT_LEN) == 0) {
|
||||
*tmp = '\0';
|
||||
for (i = 0; i < VOLOPT_NUM; i++) {
|
||||
- if (parseline( sizeof( path ) - VOLOPT_DEFAULT_LEN - 1,
|
||||
+ if (parseline( sizeof( path ) - VOLOPT_DEFAULT_LEN,
|
||||
path + VOLOPT_DEFAULT_LEN) < 0)
|
||||
break;
|
||||
- volset(save_options, NULL, tmp, sizeof(tmp) - 1,
|
||||
+ volset(save_options, NULL, tmp, sizeof(tmp),
|
||||
path + VOLOPT_DEFAULT_LEN);
|
||||
}
|
||||
}
|
||||
@@ -976,10 +976,10 @@ struct passwd *pwent;
|
||||
if ( u == NULL || *u == '\0' || ( pw = getpwnam( u )) == NULL ) {
|
||||
continue;
|
||||
}
|
||||
- strcpy( tmp, pw->pw_dir );
|
||||
+ strlcpy( tmp, pw->pw_dir, sizeof(tmp) );
|
||||
if ( p != NULL && *p != '\0' ) {
|
||||
- strcat( tmp, "/" );
|
||||
- strcat( tmp, p );
|
||||
+ strlcat( tmp, "/", sizeof(tmp) );
|
||||
+ strlcat( tmp, p, sizeof(tmp) );
|
||||
}
|
||||
/* Tag a user's home directory with their umask. Note, this will
|
||||
* be overwritten if the user actually specifies a umask: option
|
||||
@@ -990,7 +990,7 @@ struct passwd *pwent;
|
||||
case '/' :
|
||||
/* send path through variable substitution */
|
||||
if (*path != '~') /* need to copy path to tmp */
|
||||
- strcpy(tmp, path);
|
||||
+ strlcpy(tmp, path, sizeof(tmp));
|
||||
if (!pwent)
|
||||
pwent = getpwnam(obj->username);
|
||||
volxlate(obj, path, sizeof(path) - 1, tmp, pwent, NULL, NULL);
|
||||
@@ -1019,10 +1019,10 @@ struct passwd *pwent;
|
||||
|
||||
/* read in up to VOLOP_NUM possible options */
|
||||
for (i = 0; i < VOLOPT_NUM; i++) {
|
||||
- if (parseline( sizeof( tmp ) - 1, tmp ) < 0)
|
||||
+ if (parseline( sizeof( tmp ), tmp ) < 0)
|
||||
break;
|
||||
|
||||
- volset(options, save_options, volname, sizeof(volname) - 1, tmp);
|
||||
+ volset(options, save_options, volname, sizeof(volname), tmp);
|
||||
}
|
||||
|
||||
/* check allow/deny lists:
|
||||
@@ -2103,9 +2103,9 @@ static int create_special_folder (const struct vol *vo
|
||||
u_int16_t attr;
|
||||
struct stat st;
|
||||
int ret;
|
||||
+ size_t plen = strlen(vol->v_path) + strlen(folder->name) + 2;
|
||||
|
||||
-
|
||||
- p = (char *) malloc ( strlen(vol->v_path)+strlen(folder->name)+2);
|
||||
+ p = (char *) malloc(plen);
|
||||
if ( p == NULL) {
|
||||
LOG(log_error, logtype_afpd,"malloc failed");
|
||||
exit (EXITERR_SYS);
|
||||
@@ -2117,8 +2117,8 @@ static int create_special_folder (const struct vol *vo
|
||||
exit (EXITERR_SYS);
|
||||
}
|
||||
|
||||
- strcpy(p, vol->v_path);
|
||||
- strcat(p, "/");
|
||||
+ strlcpy(p, vol->v_path, plen);
|
||||
+ strlcat(p, "/", plen);
|
||||
|
||||
r=q;
|
||||
while (*r) {
|
||||
@@ -2128,7 +2128,7 @@ static int create_special_folder (const struct vol *vo
|
||||
*r=tolower(*r);
|
||||
r++;
|
||||
}
|
||||
- strcat(p, q);
|
||||
+ strlcat(p, q, plen);
|
||||
|
||||
if ( (ret = stat( p, &st )) < 0 ) {
|
||||
if (folder->precreate) {
|
||||
@@ -2259,7 +2259,7 @@ static int savevoloptions (const struct vol *vol)
|
||||
snprintf(item, sizeof(item), "CNIDDBDPORT:%u\n", Cnid_port);
|
||||
strlcat(buf, item, sizeof(buf));
|
||||
|
||||
- strcpy(item, "CNID_DBPATH:");
|
||||
+ strlcpy(item, "CNID_DBPATH:", sizeof(item));
|
||||
if (vol->v_dbpath)
|
||||
strlcat(item, vol->v_dbpath, sizeof(item));
|
||||
else
|
||||
@@ -2268,7 +2268,7 @@ static int savevoloptions (const struct vol *vol)
|
||||
strlcat(buf, item, sizeof(buf));
|
||||
|
||||
/* volume flags */
|
||||
- strcpy(item, "VOLUME_OPTS:");
|
||||
+ strlcpy(item, "VOLUME_OPTS:", sizeof(item));
|
||||
for (;op->name; op++) {
|
||||
if ( (vol->v_flags & op->option) ) {
|
||||
strlcat(item, op->name, sizeof(item));
|
||||
@@ -2279,7 +2279,7 @@ static int savevoloptions (const struct vol *vol)
|
||||
strlcat(buf, item, sizeof(buf));
|
||||
|
||||
/* casefold flags */
|
||||
- strcpy(item, "VOLCASEFOLD:");
|
||||
+ strlcpy(item, "VOLCASEFOLD:", sizeof(item));
|
||||
for (;cf->name; cf++) {
|
||||
if ( (vol->v_casefold & cf->option) ) {
|
||||
strlcat(item, cf->name, sizeof(item));
|
@ -1,53 +0,0 @@
|
||||
$OpenBSD: patch-etc_atalkd_config_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/atalkd/config.c.orig Sun Feb 6 05:16:02 2005
|
||||
+++ etc/atalkd/config.c Sat Dec 31 01:17:42 2005
|
||||
@@ -101,12 +101,11 @@ char **parseline(const char *line)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- buffer = (char *) malloc( strlen( p ) + 1 );
|
||||
- if ( !buffer ) {
|
||||
- /* FIXME: error handling */
|
||||
- return NULL;
|
||||
- }
|
||||
- strcpy( buffer, p );
|
||||
+ buffer = strdup(p);
|
||||
+ if (buffer == NULL) {
|
||||
+ /* FIXME: error handling */
|
||||
+ return NULL;
|
||||
+ }
|
||||
tmpbuf = buffer;
|
||||
|
||||
argv = (char **) malloc( ARGV_CHUNK_SIZE * sizeof( char * ) );
|
||||
@@ -207,9 +206,9 @@ int writeconf( cf )
|
||||
}
|
||||
|
||||
if (( p = strrchr( path, '/' )) == NULL ) {
|
||||
- strcpy( newpath, _PATH_ATALKDTMP );
|
||||
+ strlcpy( newpath, _PATH_ATALKDTMP, sizeof(newpath) );
|
||||
} else {
|
||||
- sprintf( newpath, "%.*s/%s", (int)(p - path), path, _PATH_ATALKDTMP );
|
||||
+ snprintf( newpath, sizeof(newpath), "%.*s/%s", (int)(p - path), path, _PATH_ATALKDTMP );
|
||||
}
|
||||
if (( fd = open( newpath, O_WRONLY|O_CREAT|O_TRUNC, mode )) < 0 ) {
|
||||
LOG(log_error, logtype_atalkd, "%s: %s", newpath, strerror(errno) );
|
||||
@@ -832,7 +831,7 @@ struct interface *newiface( name )
|
||||
int plumb()
|
||||
{
|
||||
struct interface *iface;
|
||||
- char device[ MAXPATHLEN + 1], *p;
|
||||
+ char device[ MAXPATHLEN ], *p;
|
||||
int fd, ppa;
|
||||
|
||||
for ( iface = interfaces; iface != NULL; iface = iface->i_next ) {
|
||||
@@ -840,8 +839,8 @@ int plumb()
|
||||
continue;
|
||||
}
|
||||
|
||||
- strcpy( device, "/dev/" );
|
||||
- strcat( device, iface->i_name );
|
||||
+ strlcpy( device, "/dev/", sizeof(device) );
|
||||
+ strlcat( device, iface->i_name, sizeof(device) );
|
||||
if (( p = strpbrk( device, "0123456789" )) == NULL ) {
|
||||
LOG(log_error, logtype_atalkd, "plumb: invalid device: %s", device );
|
||||
return -1;
|
@ -1,12 +0,0 @@
|
||||
$OpenBSD: patch-etc_atalkd_main_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/atalkd/main.c.orig Mon Jan 31 12:01:04 2005
|
||||
+++ etc/atalkd/main.c Sat Dec 31 12:43:51 2005
|
||||
@@ -1456,7 +1456,7 @@ int ifconfig( iname, cmd, sa )
|
||||
int s;
|
||||
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
- strcpy( ifr.ifr_name, iname );
|
||||
+ strlcpy( ifr.ifr_name, iname, ifr.ifr_name );
|
||||
ifr.ifr_addr = *(struct sockaddr *)sa;
|
||||
|
||||
if (( s = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0 ) {
|
@ -1,56 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_cnid_metad_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- etc/cnid_dbd/cnid_metad.c.orig Mon Sep 6 09:19:21 2004
|
||||
+++ etc/cnid_dbd/cnid_metad.c Thu Oct 25 20:30:06 2007
|
||||
@@ -270,8 +270,8 @@ static int maybe_start_dbd(char *dbdpn, char *dbdir, c
|
||||
}
|
||||
}
|
||||
|
||||
- sprintf(buf1, "%i", sv[1]);
|
||||
- sprintf(buf2, "%i", rqstfd);
|
||||
+ snprintf(buf1, sizeof(buf1), "%i", sv[1]);
|
||||
+ snprintf(buf2, sizeof(buf2), "%i", rqstfd);
|
||||
|
||||
if (up->count == MAXSPAWN) {
|
||||
/* there's a pb with the db inform child
|
||||
@@ -298,7 +298,7 @@ static int maybe_start_dbd(char *dbdpn, char *dbdir, c
|
||||
}
|
||||
|
||||
/* ------------------ */
|
||||
-static int set_dbdir(char *dbdir, int len)
|
||||
+static int set_dbdir(char *dbdir, size_t len)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
@@ -310,11 +310,11 @@ static int set_dbdir(char *dbdir, int len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (dbdir[len - 1] != '/') {
|
||||
- strcat(dbdir, "/");
|
||||
+ if (dbdir[strlen(dbdir) - 1] != '/') {
|
||||
+ strlcat(dbdir, "/", len);
|
||||
len++;
|
||||
}
|
||||
- strcpy(dbdir + len, DBHOME);
|
||||
+ strlcat(dbdir, DBHOME, len);
|
||||
if (stat(dbdir, &st) < 0 && mkdir(dbdir, 0755 ) < 0) {
|
||||
LOG(log_error, logtype_cnid, "set_dbdir: mkdir failed for %s", dbdir);
|
||||
return -1;
|
||||
@@ -365,7 +365,7 @@ char *group;
|
||||
/* ------------------ */
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
- char dbdir[MAXPATHLEN + 1];
|
||||
+ char dbdir[MAXPATHLEN];
|
||||
int len;
|
||||
pid_t pid;
|
||||
int status;
|
||||
@@ -529,7 +529,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
dbdir[len] = '\0';
|
||||
|
||||
- if (set_dbdir(dbdir, len) < 0) {
|
||||
+ if (set_dbdir(dbdir, sizeof(dbdir)) < 0) {
|
||||
goto loop_end;
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_db_param_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/cnid_dbd/db_param.c.orig Tue Dec 21 08:36:12 2004
|
||||
+++ etc/cnid_dbd/db_param.c Sat Dec 31 12:34:18 2005
|
||||
@@ -43,29 +43,27 @@
|
||||
static struct db_param params;
|
||||
static int parse_err;
|
||||
|
||||
-static int usock_maxlen()
|
||||
+static size_t usock_maxlen()
|
||||
{
|
||||
struct sockaddr_un addr;
|
||||
|
||||
- return sizeof(addr.sun_path) - 1;
|
||||
+ return sizeof(addr.sun_path);
|
||||
}
|
||||
|
||||
-static int make_pathname(char *path, char *dir, char *fn, int maxlen)
|
||||
+static int make_pathname(char *path, char *dir, char *fn, size_t maxlen)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
if (fn[0] != '/') {
|
||||
- len = strlen(dir);
|
||||
- if (len + 1 + strlen(fn) > maxlen)
|
||||
- return -1;
|
||||
- strcpy(path, dir);
|
||||
+ if ((len = strlcpy(path, dir, maxlen)) >= maxlen)
|
||||
+ return -1;
|
||||
if (path[len - 1] != '/')
|
||||
- strcat(path, "/");
|
||||
- strcat(path, fn);
|
||||
+ strlcat(path, "/", maxlen);
|
||||
+ if (strlcat(path, fn, maxlen) >= maxlen)
|
||||
+ return -1;
|
||||
} else {
|
||||
- if (strlen(fn) > maxlen)
|
||||
- return -1;
|
||||
- strcpy(path, fn);
|
||||
+ if (strlcpy(path, fn, maxlen) >= maxlen)
|
||||
+ return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_dbd_dbcheck_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/cnid_dbd/dbd_dbcheck.c.orig Tue Jan 25 09:34:27 2005
|
||||
+++ etc/cnid_dbd/dbd_dbcheck.c Fri Dec 30 23:50:57 2005
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/param.h>
|
||||
#include <errno.h>
|
||||
+#include <sys/types.h>
|
||||
#include <netatalk/endian.h>
|
||||
#include <atalk/logger.h>
|
||||
#include <atalk/cnid_dbd_private.h>
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_dbd_delete_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/cnid_dbd/dbd_delete.c.orig Wed Jan 21 16:28:42 2004
|
||||
+++ etc/cnid_dbd/dbd_delete.c Fri Dec 30 23:47:29 2005
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
+#include <sys/types.h>
|
||||
#include <netatalk/endian.h>
|
||||
#include <atalk/logger.h>
|
||||
#include <atalk/cnid_dbd_private.h>
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_dbd_get_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/cnid_dbd/dbd_get.c.orig Wed Jan 21 16:28:42 2004
|
||||
+++ etc/cnid_dbd/dbd_get.c Fri Dec 30 23:51:53 2005
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <atalk/logger.h>
|
||||
#include <errno.h>
|
||||
+#include <sys/types.h>
|
||||
#include <netatalk/endian.h>
|
||||
#include <atalk/cnid_dbd_private.h>
|
||||
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_dbd_getstamp_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/cnid_dbd/dbd_getstamp.c.orig Sat Feb 7 14:46:08 2004
|
||||
+++ etc/cnid_dbd/dbd_getstamp.c Fri Dec 30 23:49:23 2005
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <string.h>
|
||||
#include <atalk/logger.h>
|
||||
#include <errno.h>
|
||||
+#include <sys/types.h>
|
||||
#include <netatalk/endian.h>
|
||||
#include <atalk/cnid_dbd_private.h>
|
||||
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_dbd_lookup_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/cnid_dbd/dbd_lookup.c.orig Sat Feb 7 14:46:08 2004
|
||||
+++ etc/cnid_dbd/dbd_lookup.c Fri Dec 30 23:53:00 2005
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/param.h>
|
||||
#include <errno.h>
|
||||
+#include <sys/types.h>
|
||||
#include <netatalk/endian.h>
|
||||
#include <atalk/logger.h>
|
||||
#include <atalk/cnid_dbd_private.h>
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_dbd_resolve_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/cnid_dbd/dbd_resolve.c.orig Sat Feb 7 14:46:08 2004
|
||||
+++ etc/cnid_dbd/dbd_resolve.c Fri Dec 30 23:41:56 2005
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <string.h>
|
||||
#include <atalk/logger.h>
|
||||
#include <errno.h>
|
||||
+#include <sys/types.h>
|
||||
#include <netatalk/endian.h>
|
||||
#include <atalk/cnid_dbd_private.h>
|
||||
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_dbd_update_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/cnid_dbd/dbd_update.c.orig Fri Dec 30 23:46:17 2005
|
||||
+++ etc/cnid_dbd/dbd_update.c Fri Dec 30 23:44:48 2005
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <atalk/logger.h>
|
||||
+#include <sys/types.h>
|
||||
#include <netatalk/endian.h>
|
||||
#include <atalk/cnid_dbd_private.h>
|
||||
|
@ -1,15 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_dbif_c,v 1.1 2007/10/26 14:27:23 steven Exp $
|
||||
--- etc/cnid_dbd/dbif.c.orig Thu Oct 25 20:44:42 2007
|
||||
+++ etc/cnid_dbd/dbif.c Thu Oct 25 20:45:23 2007
|
||||
@@ -514,7 +514,11 @@ int dbif_count(const int dbi, u_int32_t *count)
|
||||
DB_BTREE_STAT *sp;
|
||||
DB *db = db_table[dbi].db;
|
||||
|
||||
+#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 2
|
||||
+ ret = db->stat(db, NULL, &sp, 0);
|
||||
+#else
|
||||
ret = db->stat(db, &sp, 0);
|
||||
+#endif
|
||||
|
||||
if (ret) {
|
||||
LOG(log_error, logtype_cnid, "error getting stat infotmation on database: %s", db_strerror(errno));
|
@ -1,21 +0,0 @@
|
||||
$OpenBSD: patch-etc_cnid_dbd_pack_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/cnid_dbd/pack.c.orig Sat Feb 7 14:46:08 2004
|
||||
+++ etc/cnid_dbd/pack.c Fri Dec 30 21:11:40 2005
|
||||
@@ -9,8 +9,6 @@
|
||||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
-#include <netatalk/endian.h>
|
||||
-
|
||||
#include <string.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
@@ -18,6 +16,8 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <db.h>
|
||||
+
|
||||
+#include <netatalk/endian.h>
|
||||
|
||||
#include <atalk/cnid_dbd_private.h>
|
||||
#include "pack.h"
|
@ -1,24 +0,0 @@
|
||||
$OpenBSD: patch-etc_papd_auth_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- etc/papd/auth.c.orig Fri Mar 11 16:36:59 2005
|
||||
+++ etc/papd/auth.c Thu Oct 25 20:30:06 2007
|
||||
@@ -96,7 +96,7 @@ int auth_register(const int type, struct uam_obj *uam)
|
||||
/* load all of the modules */
|
||||
int auth_load(const char *path, const char *list)
|
||||
{
|
||||
- char name[MAXPATHLEN + 1], buf[MAXPATHLEN + 1], *p;
|
||||
+ char name[MAXPATHLEN], buf[MAXPATHLEN], *p;
|
||||
struct uam_mod *mod;
|
||||
struct stat st;
|
||||
int len;
|
||||
@@ -108,9 +108,9 @@ int auth_load(const char *path, const char *list)
|
||||
if ((p = strtok(buf, ",")) == NULL)
|
||||
return -1;
|
||||
|
||||
- strcpy(name, path);
|
||||
+ strlcpy(name, path, sizeof(name));
|
||||
if (name[len - 1] != '/') {
|
||||
- strcat(name, "/");
|
||||
+ strlcat(name, "/", sizeof(name));
|
||||
len++;
|
||||
}
|
||||
|
@ -1,172 +0,0 @@
|
||||
$OpenBSD: patch-etc_papd_lp_c,v 1.2 2009/08/14 19:09:22 naddy Exp $
|
||||
|
||||
First 3 chunks resolve CVE-2008-5718
|
||||
|
||||
--- etc/papd/lp.c.orig Tue Jun 8 22:24:47 2004
|
||||
+++ etc/papd/lp.c Sat Jul 25 11:02:06 2009
|
||||
@@ -212,10 +212,37 @@ static void lp_setup_comments (charset_t dest)
|
||||
|
||||
#define is_var(a, b) (strncmp((a), (b), 2) == 0)
|
||||
|
||||
+static size_t quote(char *dest, char *src, const size_t bsize, size_t len)
|
||||
+{
|
||||
+size_t used = 0;
|
||||
+
|
||||
+ while (len && used < bsize ) {
|
||||
+ switch (*src) {
|
||||
+ case '$':
|
||||
+ case '\\':
|
||||
+ case '"':
|
||||
+ case '`':
|
||||
+ if (used + 2 > bsize )
|
||||
+ return used;
|
||||
+ *dest = '\\';
|
||||
+ dest++;
|
||||
+ used++;
|
||||
+ break;
|
||||
+ }
|
||||
+ *dest = *src;
|
||||
+ src++;
|
||||
+ dest++;
|
||||
+ len--;
|
||||
+ used++;
|
||||
+ }
|
||||
+ return used;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static char* pipexlate(char *src)
|
||||
{
|
||||
char *p, *q, *dest;
|
||||
- static char destbuf[MAXPATHLEN];
|
||||
+ static char destbuf[MAXPATHLEN +1];
|
||||
size_t destlen = MAXPATHLEN;
|
||||
int len = 0;
|
||||
|
||||
@@ -224,13 +251,15 @@ static char* pipexlate(char *src)
|
||||
if (!src)
|
||||
return NULL;
|
||||
|
||||
- strncpy(dest, src, MAXPATHLEN);
|
||||
- if ((p = strchr(src, '%')) == NULL) /* nothing to do */
|
||||
+ memset(dest, 0, MAXPATHLEN +1);
|
||||
+ if ((p = strchr(src, '%')) == NULL) { /* nothing to do */
|
||||
+ strncpy(dest, src, MAXPATHLEN);
|
||||
return destbuf;
|
||||
-
|
||||
- /* first part of the path. just forward to the next variable. */
|
||||
+ }
|
||||
+ /* first part of the path. copy and forward to the next variable. */
|
||||
len = MIN((size_t)(p - src), destlen);
|
||||
if (len > 0) {
|
||||
+ strncpy(dest, src, len);
|
||||
destlen -= len;
|
||||
dest += len;
|
||||
}
|
||||
@@ -246,17 +275,20 @@ static char* pipexlate(char *src)
|
||||
q = lp.lp_created_for;
|
||||
} else if (is_var(p, "%%")) {
|
||||
q = "%";
|
||||
- } else
|
||||
- q = p;
|
||||
+ }
|
||||
|
||||
/* copy the stuff over. if we don't understand something that we
|
||||
* should, just skip it over. */
|
||||
if (q) {
|
||||
- len = MIN(p == q ? 2 : strlen(q), destlen);
|
||||
+ len = MIN(strlen(q), destlen);
|
||||
+ len = quote(dest, q, destlen, len);
|
||||
+ }
|
||||
+ else {
|
||||
+ len = MIN(2, destlen);
|
||||
strncpy(dest, q, len);
|
||||
- dest += len;
|
||||
- destlen -= len;
|
||||
}
|
||||
+ dest += len;
|
||||
+ destlen -= len;
|
||||
|
||||
/* stuff up to next $ */
|
||||
src = p + 2;
|
||||
@@ -377,7 +409,7 @@ int lp_init( out, sat )
|
||||
FILE *cap_file;
|
||||
|
||||
memset( auth_string, 0, 256 );
|
||||
- sprintf(addr_filename, "%s/net%d.%dnode%d",
|
||||
+ snprintf(addr_filename, sizeof(addr_filename), "%s/net%d.%dnode%d",
|
||||
printer->p_authprintdir, addr_net/256, addr_net%256,
|
||||
addr_node);
|
||||
if (stat(addr_filename, &cap_st) == 0) {
|
||||
@@ -489,7 +521,7 @@ int lp_init( out, sat )
|
||||
lp.lp_seq = n;
|
||||
|
||||
n = ( n + 1 ) % 1000;
|
||||
- sprintf( buf, "%03d\n", n );
|
||||
+ snprintf( buf, sizeof(buf), "%03d\n", n );
|
||||
lseek( fd, 0L, 0 );
|
||||
write( fd, buf, strlen( buf ));
|
||||
close( fd );
|
||||
@@ -558,7 +590,7 @@ int lp_open( out, sat )
|
||||
}
|
||||
LOG(log_debug, logtype_papd, "lp_open: opened %s", pipexlate(printer->p_printer) );
|
||||
} else {
|
||||
- sprintf( name, "df%c%03d%s", lp.lp_letter++, lp.lp_seq, hostname );
|
||||
+ snprintf( name, sizeof(name), "df%c%03d%s", lp.lp_letter++, lp.lp_seq, hostname );
|
||||
|
||||
if (( fd = open( name, O_WRONLY|O_CREAT|O_EXCL, 0660 )) < 0 ) {
|
||||
LOG(log_error, logtype_papd, "lp_open %s: %m", name );
|
||||
@@ -719,7 +751,7 @@ int lp_cancel()
|
||||
}
|
||||
|
||||
for ( letter = 'A'; letter < lp.lp_letter; letter++ ) {
|
||||
- sprintf( name, "df%c%03d%s", letter, lp.lp_seq, hostname );
|
||||
+ snprintf( name, sizeof(name), "df%c%03d%s", letter, lp.lp_seq, hostname );
|
||||
if ( unlink( name ) < 0 ) {
|
||||
LOG(log_error, logtype_papd, "lp_cancel unlink %s: %m", name );
|
||||
}
|
||||
@@ -753,7 +785,7 @@ int lp_print()
|
||||
|
||||
if ( printer->p_flags & P_SPOOLED ) {
|
||||
#ifndef HAVE_CUPS
|
||||
- sprintf( tfname, "tfA%03d%s", lp.lp_seq, hostname );
|
||||
+ snprintf( tfname, sizeof(tfname), "tfA%03d%s", lp.lp_seq, hostname );
|
||||
if (( fd = open( tfname, O_WRONLY|O_EXCL|O_CREAT, 0660 )) < 0 ) {
|
||||
LOG(log_error, logtype_papd, "lp_print %s: %m", tfname );
|
||||
return 0;
|
||||
@@ -798,7 +830,7 @@ int lp_print()
|
||||
}
|
||||
fclose( cfile );
|
||||
|
||||
- sprintf( cfname, "cfA%03d%s", lp.lp_seq, hostname );
|
||||
+ snprintf( cfname, sizeof(cfname), "cfA%03d%s", lp.lp_seq, hostname );
|
||||
if ( link( tfname, cfname ) < 0 ) {
|
||||
LOG(log_error, logtype_papd, "lp_print can't link %s to %s: %m", cfname,
|
||||
tfname );
|
||||
@@ -811,7 +843,7 @@ int lp_print()
|
||||
return 0;
|
||||
}
|
||||
|
||||
- sprintf( buf, "\1%s\n", printer->p_printer );
|
||||
+ snprintf( buf, sizeof(buf), "\1%s\n", printer->p_printer );
|
||||
n = strlen( buf );
|
||||
if ( write( s, buf, n ) != n ) {
|
||||
LOG(log_error, logtype_papd, "lp_print write: %m" );
|
||||
@@ -944,7 +976,7 @@ int lp_rmjob( job )
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
- sprintf( buf, "\5%s %s %d\n", printer->p_printer, lp.lp_person, job );
|
||||
+ snprintf( buf, sizeof(buf), "\5%s %s %d\n", printer->p_printer, lp.lp_person, job );
|
||||
n = strlen( buf );
|
||||
if ( write( s, buf, n ) != n ) {
|
||||
LOG(log_error, logtype_papd, "lp_rmjob write: %m" );
|
||||
@@ -982,7 +1014,7 @@ int lp_queue( out )
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
- sprintf( buf, "\3%s\n", printer->p_printer );
|
||||
+ snprintf( buf, sizeof(buf), "\3%s\n", printer->p_printer );
|
||||
n = strlen( buf );
|
||||
if ( write( s, buf, n ) != n ) {
|
||||
LOG(log_error, logtype_papd, "lp_queue write: %m" );
|
@ -1,195 +0,0 @@
|
||||
$OpenBSD: patch-etc_papd_main_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/papd/main.c.orig Tue Jun 8 21:25:53 2004
|
||||
+++ etc/papd/main.c Sat Dec 31 02:51:53 2005
|
||||
@@ -196,12 +196,10 @@ int main( ac, av )
|
||||
if (( p = strchr( hostname, '.' )) != 0 ) {
|
||||
*p = '\0';
|
||||
}
|
||||
- if (( defprinter.p_name = (char *)malloc( strlen( hostname ) + 1 ))
|
||||
- == NULL ) {
|
||||
+ if (( defprinter.p_name = strdup(hostname)) == NULL ) {
|
||||
perror( "malloc" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( defprinter.p_name, hostname );
|
||||
defprinter.p_type = "LaserWriter";
|
||||
defprinter.p_zone = "*";
|
||||
memset(&defprinter.p_addr, 0, sizeof(defprinter.p_addr));
|
||||
@@ -583,8 +581,8 @@ int getstatus( pr, buf )
|
||||
int fd = -1, rc;
|
||||
|
||||
if ( pr->p_flags & P_SPOOLED && ( pr->p_spool != NULL )) {
|
||||
- strcpy( path, pr->p_spool );
|
||||
- strcat( path, "/status" );
|
||||
+ strlcpy( path, pr->p_spool, sizeof(path));
|
||||
+ strlcat( path, "/status", sizeof(path));
|
||||
fd = open( path, O_RDONLY);
|
||||
}
|
||||
|
||||
@@ -643,29 +641,26 @@ static void getprinters( cf )
|
||||
exit( 1 );
|
||||
}
|
||||
if ( name != defprinter.p_name ) {
|
||||
- if (( pr->p_name = (char *)malloc( strlen( name ) + 1 )) == NULL ) {
|
||||
+ if (( pr->p_name = strdup(name)) == NULL ) {
|
||||
perror( "malloc" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_name, name );
|
||||
} else {
|
||||
pr->p_name = name;
|
||||
}
|
||||
if ( type != defprinter.p_type ) {
|
||||
- if (( pr->p_type = (char *)malloc( strlen( type ) + 1 )) == NULL ) {
|
||||
+ if (( pr->p_type = strdup( type )) == NULL ) {
|
||||
perror( "malloc" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_type, type );
|
||||
} else {
|
||||
pr->p_type = type;
|
||||
}
|
||||
if ( zone != defprinter.p_zone ) {
|
||||
- if (( pr->p_zone = (char *)malloc( strlen( zone ) + 1 )) == NULL ) {
|
||||
+ if (( pr->p_zone = strdup( zone )) == NULL ) {
|
||||
perror( "malloc" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_zone, zone );
|
||||
} else {
|
||||
pr->p_zone = zone;
|
||||
}
|
||||
@@ -681,11 +676,10 @@ static void getprinters( cf )
|
||||
if (( p = pgetstr( "pd", &a )) == NULL ) {
|
||||
pr->p_ppdfile = defprinter.p_ppdfile;
|
||||
} else {
|
||||
- if (( pr->p_ppdfile = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
|
||||
+ if (( pr->p_ppdfile = strdup( p )) == NULL ) {
|
||||
perror( "malloc" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_ppdfile, p );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -701,22 +695,20 @@ static void getprinters( cf )
|
||||
} else {
|
||||
pr->p_flags = P_SPOOLED;
|
||||
}
|
||||
- if (( pr->p_printer = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
|
||||
+ if (( pr->p_printer = strdup( p )) == NULL ) {
|
||||
perror( "malloc" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_printer, p );
|
||||
}
|
||||
|
||||
/*
|
||||
* Do we want authenticated printing?
|
||||
*/
|
||||
if ((p = pgetstr( "ca", &a )) != NULL ) {
|
||||
- if ((pr->p_authprintdir = (char *)malloc(strlen(p)+1)) == NULL) {
|
||||
+ if ((pr->p_authprintdir = strdup(p)) == NULL) {
|
||||
perror( "malloc" );
|
||||
exit(1);
|
||||
}
|
||||
- strcpy( pr->p_authprintdir, p );
|
||||
pr->p_flags |= P_AUTH;
|
||||
pr->p_flags |= P_AUTH_CAP;
|
||||
} else { pr->p_authprintdir = NULL; }
|
||||
@@ -727,11 +719,10 @@ static void getprinters( cf )
|
||||
}
|
||||
|
||||
if ((p = pgetstr("am", &a)) != NULL ) {
|
||||
- if ((uamlist = (char *)malloc(strlen(p)+1)) == NULL ) {
|
||||
+ if ((uamlist = strdup(p)) == NULL ) {
|
||||
perror("malloc");
|
||||
exit(1);
|
||||
}
|
||||
- strcpy(uamlist, p);
|
||||
}
|
||||
|
||||
if ( pr->p_flags & P_SPOOLED ) {
|
||||
@@ -741,12 +732,10 @@ static void getprinters( cf )
|
||||
if (( p = pgetstr( "op", &a )) == NULL ) {
|
||||
pr->p_operator = defprinter.p_operator;
|
||||
} else {
|
||||
- if (( pr->p_operator = (char *)malloc( strlen( p ) + 1 ))
|
||||
- == NULL ) {
|
||||
+ if (( pr->p_operator = strdup( p )) == NULL ) {
|
||||
perror( "malloc" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_operator, p );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -821,11 +810,10 @@ int rprintcap( pr )
|
||||
|
||||
if ( pr->p_ppdfile == defprinter.p_ppdfile ) {
|
||||
if ( (p = (char *) cups_get_printer_ppd ( pr->p_printer )) != NULL ) {
|
||||
- if (( pr->p_ppdfile = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
|
||||
- LOG(log_error, logtype_papd, "malloc: %m" );
|
||||
- exit( 1 );
|
||||
+ if (( pr->p_ppdfile = strdup( p )) == NULL ) {
|
||||
+ LOG(log_error, logtype_papd, "malloc: %m" );
|
||||
+ exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_ppdfile, p );
|
||||
pr->p_flags |= P_CUPS_PPD;
|
||||
/*LOG(log_info, logtype_papd, "PPD File for %s set to %s", pr->p_printer, pr->p_ppdfile );*/
|
||||
}
|
||||
@@ -856,11 +844,10 @@ int rprintcap( pr )
|
||||
if (( p = pgetstr( "sd", &a )) == NULL ) {
|
||||
pr->p_spool = defprinter.p_spool;
|
||||
} else {
|
||||
- if (( pr->p_spool = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
|
||||
+ if (( pr->p_spool = strdup( p )) == NULL ) {
|
||||
LOG(log_error, logtype_papd, "malloc: %m" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_spool, p );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -879,12 +866,10 @@ int rprintcap( pr )
|
||||
if (( p = pgetstr( "ro", &a )) == NULL ) {
|
||||
pr->p_role = defprinter.p_role;
|
||||
} else {
|
||||
- if (( pr->p_role =
|
||||
- (char *)malloc( strlen( p ) + 1 )) == NULL ) {
|
||||
+ if (( pr->p_role = strdup( p )) == NULL ) {
|
||||
LOG(log_error, logtype_papd, "malloc: %m" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_role, p );
|
||||
}
|
||||
|
||||
if (( c = pgetnum( "si" )) < 0 ) {
|
||||
@@ -905,12 +890,10 @@ int rprintcap( pr )
|
||||
}
|
||||
a = area;
|
||||
if (( p = pgetstr( "pc", &a )) != NULL ) {
|
||||
- if (( pr->p_pagecost_msg =
|
||||
- (char *)malloc( strlen( p ) + 1 )) == NULL ) {
|
||||
+ if (( pr->p_pagecost_msg = strdup( p )) == NULL ) {
|
||||
LOG(log_error, logtype_papd, "malloc: %m" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_pagecost_msg, p );
|
||||
pr->p_pagecost = 0;
|
||||
} else if ( pr->p_flags & P_ACCOUNT ) {
|
||||
if (( c = pgetnum( "pc" )) < 0 ) {
|
||||
@@ -931,11 +914,10 @@ int rprintcap( pr )
|
||||
if (( p = pgetstr( "lo", &a )) == NULL ) {
|
||||
pr->p_lock = defprinter.p_lock;
|
||||
} else {
|
||||
- if (( pr->p_lock = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
|
||||
+ if (( pr->p_lock = strdup( p )) == NULL ) {
|
||||
LOG(log_error, logtype_papd, "malloc: %m" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pr->p_lock, p );
|
||||
}
|
||||
|
||||
#ifdef KRB
|
@ -1,32 +0,0 @@
|
||||
$OpenBSD: patch-etc_papd_ppd_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/papd/ppd.c.orig Sun Feb 6 05:16:02 2005
|
||||
+++ etc/papd/ppd.c Sat Dec 31 13:36:19 2005
|
||||
@@ -219,12 +219,10 @@ int read_ppd( file, fcnt )
|
||||
LOG(log_error, logtype_papd, "malloc: %m" );
|
||||
exit( 1 );
|
||||
}
|
||||
- if (( pfo->pd_font =
|
||||
- (char *)malloc( strlen( pe->pe_option ) + 1 )) == NULL ) {
|
||||
+ if (( pfo->pd_font = strdup( pe->pe_option )) == NULL ) {
|
||||
LOG(log_error, logtype_papd, "malloc: %m" );
|
||||
exit( 1 );
|
||||
}
|
||||
- strcpy( pfo->pd_font, pe->pe_option );
|
||||
pfo->pd_next = ppd_fonts;
|
||||
ppd_fonts = pfo;
|
||||
continue;
|
||||
@@ -238,13 +236,10 @@ int read_ppd( file, fcnt )
|
||||
}
|
||||
}
|
||||
if ( pfe->pd_name ) { /*&& (pfe->pd_value == NULL) ) { */
|
||||
- if (( pfe->pd_value =
|
||||
- (char *)malloc( strlen( pe->pe_value ) + 1 )) == NULL ) {
|
||||
+ if (( pfe->pd_value = strdup( pe->pe_value )) == NULL ) {
|
||||
LOG(log_error, logtype_papd, "malloc: %m" );
|
||||
exit( 1 );
|
||||
}
|
||||
-
|
||||
- strcpy( pfe->pd_value, pe->pe_value );
|
||||
continue;
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
$OpenBSD: patch-etc_papd_printcap_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/papd/printcap.c.orig Fri Jun 18 03:56:04 2004
|
||||
+++ etc/papd/printcap.c Sat Dec 31 13:04:13 2005
|
||||
@@ -289,7 +289,7 @@ int tnchktc( cap )
|
||||
/* p now points to beginning of last field */
|
||||
if (p[0] != 't' || p[1] != 'c')
|
||||
return(1);
|
||||
- strcpy(tcname,p+3);
|
||||
+ strlcpy(tcname,p+3,sizeof(tcname));
|
||||
q = tcname;
|
||||
while (q && *q != ':')
|
||||
q++;
|
@ -1,21 +0,0 @@
|
||||
$OpenBSD: patch-etc_papd_queries_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- etc/papd/queries.c.orig Sun Feb 6 05:16:02 2005
|
||||
+++ etc/papd/queries.c Sat Dec 31 13:06:26 2005
|
||||
@@ -228,7 +228,7 @@ int gq_pagecost( out )
|
||||
#ifdef ABS_PRINT
|
||||
lp_pagecost();
|
||||
#endif /* ABS_PRINT */
|
||||
- sprintf( cost, "%d", printer->p_pagecost );
|
||||
+ snprintf( cost, sizeof(cost), "%d", printer->p_pagecost );
|
||||
append( out, cost, strlen( cost ));
|
||||
} else {
|
||||
return( -1 );
|
||||
@@ -246,7 +246,7 @@ int gq_balance( out )
|
||||
if ( lp_pagecost() != 0 ) {
|
||||
return( -1 );
|
||||
}
|
||||
- sprintf( balance, "$%1.2f\n", printer->p_balance );
|
||||
+ snprintf( balance, sizeof(balance), "$%1.2f\n", printer->p_balance );
|
||||
append( out, balance, strlen( balance ));
|
||||
return( 0 );
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
$OpenBSD: patch-libatalk_adouble_ad_open_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- libatalk/adouble/ad_open.c.orig Sat Feb 12 06:22:05 2005
|
||||
+++ libatalk/adouble/ad_open.c Fri Dec 30 21:36:40 2005
|
||||
@@ -677,31 +677,30 @@ ad_path( path, adflags )
|
||||
const char *path;
|
||||
int adflags;
|
||||
{
|
||||
- static char pathbuf[ MAXPATHLEN + 1];
|
||||
- char c, *slash, buf[MAXPATHLEN + 1];
|
||||
+ static char pathbuf[MAXPATHLEN];
|
||||
+ char c, *slash, buf[MAXPATHLEN];
|
||||
size_t l;
|
||||
|
||||
- l = strlcpy(buf, path, MAXPATHLEN +1);
|
||||
+ l = strlcpy(buf, path, MAXPATHLEN);
|
||||
if ( adflags & ADFLAGS_DIR ) {
|
||||
- strcpy( pathbuf, buf);
|
||||
- if ( *buf != '\0' && l < MAXPATHLEN) {
|
||||
- pathbuf[l++] = '/';
|
||||
- pathbuf[l] = 0;
|
||||
+ strlcpy(pathbuf, buf, sizeof(pathbuf));
|
||||
+ if ( *buf != '\0' ) {
|
||||
+ strlcat(pathbuf, "/", sizeof(pathbuf));
|
||||
}
|
||||
slash = ".Parent";
|
||||
} else {
|
||||
if (NULL != ( slash = strrchr( buf, '/' )) ) {
|
||||
c = *++slash;
|
||||
*slash = '\0';
|
||||
- strcpy( pathbuf, buf);
|
||||
+ strlcpy(pathbuf, buf, sizeof(pathbuf));
|
||||
*slash = c;
|
||||
} else {
|
||||
pathbuf[ 0 ] = '\0';
|
||||
slash = buf;
|
||||
}
|
||||
}
|
||||
- strlcat( pathbuf, ".AppleDouble/", MAXPATHLEN +1);
|
||||
- strlcat( pathbuf, slash, MAXPATHLEN +1);
|
||||
+ strlcat( pathbuf, ".AppleDouble/", MAXPATHLEN);
|
||||
+ strlcat( pathbuf, slash, MAXPATHLEN);
|
||||
|
||||
return( pathbuf );
|
||||
}
|
||||
@@ -715,27 +714,27 @@ ad_path_osx( path, adflags )
|
||||
const char *path;
|
||||
int adflags;
|
||||
{
|
||||
- static char pathbuf[ MAXPATHLEN + 1];
|
||||
- char c, *slash, buf[MAXPATHLEN + 1];
|
||||
+ static char pathbuf[MAXPATHLEN];
|
||||
+ char c, *slash, buf[MAXPATHLEN];
|
||||
|
||||
if (!strcmp(path,".")) {
|
||||
/* fixme */
|
||||
getcwd(buf, MAXPATHLEN);
|
||||
}
|
||||
else {
|
||||
- strlcpy(buf, path, MAXPATHLEN +1);
|
||||
+ strlcpy(buf, path, MAXPATHLEN);
|
||||
}
|
||||
if (NULL != ( slash = strrchr( buf, '/' )) ) {
|
||||
c = *++slash;
|
||||
*slash = '\0';
|
||||
- strlcpy( pathbuf, buf, MAXPATHLEN +1);
|
||||
+ strlcpy( pathbuf, buf, MAXPATHLEN);
|
||||
*slash = c;
|
||||
} else {
|
||||
pathbuf[ 0 ] = '\0';
|
||||
slash = buf;
|
||||
}
|
||||
- strlcat( pathbuf, "._", MAXPATHLEN +1);
|
||||
- strlcat( pathbuf, slash, MAXPATHLEN +1);
|
||||
+ strlcat( pathbuf, "._", MAXPATHLEN);
|
||||
+ strlcat( pathbuf, slash, MAXPATHLEN);
|
||||
return pathbuf;
|
||||
}
|
||||
|
||||
@@ -751,11 +750,11 @@ char
|
||||
*ad_dir(path)
|
||||
const char *path;
|
||||
{
|
||||
- static char modebuf[ MAXPATHLEN + 1];
|
||||
+ static char modebuf[ MAXPATHLEN];
|
||||
char *slash;
|
||||
size_t len;
|
||||
|
||||
- if ( (len = strlen( path )) >= MAXPATHLEN ) {
|
||||
+ if ( (len = strlen( path )) >= MAXPATHLEN - 1) {
|
||||
errno = ENAMETOOLONG;
|
||||
return NULL; /* can't do it */
|
||||
}
|
||||
@@ -765,7 +764,7 @@ char
|
||||
* (path or subdirectory name) to get the name we want to stat.
|
||||
* For a path which is just a filename, use "." instead.
|
||||
*/
|
||||
- strcpy( modebuf, path );
|
||||
+ strlcpy( modebuf, path, sizeof(modebuf) );
|
||||
slash = strrchr( modebuf, '/' );
|
||||
/* is last char a '/' */
|
||||
if (slash && slash[1] == 0) {
|
@ -1,69 +0,0 @@
|
||||
$OpenBSD: patch-libatalk_cnid_cdb_cnid_cdb_open_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- libatalk/cnid/cdb/cnid_cdb_open.c.orig Mon Mar 22 05:38:51 2004
|
||||
+++ libatalk/cnid/cdb/cnid_cdb_open.c Thu Oct 25 20:30:06 2007
|
||||
@@ -179,21 +179,22 @@ static struct _cnid_db *cnid_cdb_new(const char *volpa
|
||||
/* --------------- */
|
||||
static int upgrade_required(char *dbdir)
|
||||
{
|
||||
- char path[MAXPATHLEN + 1];
|
||||
- int len, i;
|
||||
+ char path[MAXPATHLEN];
|
||||
+ char *p;
|
||||
+ int i;
|
||||
int found = 0;
|
||||
struct stat st;
|
||||
|
||||
- strcpy(path, dbdir);
|
||||
+ strlcpy(path, dbdir, sizeof(path));
|
||||
|
||||
- len = strlen(path);
|
||||
- if (path[len - 1] != '/') {
|
||||
- strcat(path, "/");
|
||||
- len++;
|
||||
+ p = strchr(path, '\0');
|
||||
+ if (path[strlen(path) - 1] != '/') {
|
||||
+ strlcat(path, "/", sizeof(path));
|
||||
}
|
||||
|
||||
for (i = 0; old_dbfiles[i] != NULL; i++) {
|
||||
- strcpy(path + len, old_dbfiles[i]);
|
||||
+ *p = '\0';
|
||||
+ strlcat(path, old_dbfiles[i], sizeof(path));
|
||||
if ( !(stat(path, &st) < 0) ) {
|
||||
found++;
|
||||
continue;
|
||||
@@ -210,7 +211,7 @@ static int upgrade_required(char *dbdir)
|
||||
struct _cnid_db *cnid_cdb_open(const char *dir, mode_t mask)
|
||||
{
|
||||
struct stat st;
|
||||
- char path[MAXPATHLEN + 1];
|
||||
+ char path[MAXPATHLEN];
|
||||
CNID_private *db;
|
||||
struct _cnid_db *cdb;
|
||||
int open_flag, len;
|
||||
@@ -223,7 +224,7 @@ struct _cnid_db *cnid_cdb_open(const char *dir, mode_t
|
||||
|
||||
/* this checks .AppleDB.
|
||||
We need space for dir + '/' + DBHOMELEN + '/' + DBLEN */
|
||||
- if ((len = strlen(dir)) > (MAXPATHLEN - DBHOMELEN - DBLEN - 2)) {
|
||||
+ if ((len = strlen(dir)) > (MAXPATHLEN - DBHOMELEN - DBLEN - 2 - 1)) {
|
||||
LOG(log_error, logtype_default, "cnid_open: Pathname too large: %s", dir);
|
||||
return NULL;
|
||||
}
|
||||
@@ -241,13 +242,12 @@ struct _cnid_db *cnid_cdb_open(const char *dir, mode_t
|
||||
cdb->_private = (void *) db;
|
||||
db->magic = CNID_DB_MAGIC;
|
||||
|
||||
- strcpy(path, dir);
|
||||
+ strlcpy(path, dir, sizeof(path));
|
||||
if (path[len - 1] != '/') {
|
||||
- strcat(path, "/");
|
||||
- len++;
|
||||
+ strlcat(path, "/", sizeof(path));
|
||||
}
|
||||
|
||||
- strcpy(path + len, DBHOME);
|
||||
+ strlcat(path, DBHOME, sizeof(path));
|
||||
if ((stat(path, &st) < 0) && (ad_mkdir(path, 0777 & ~mask) < 0)) {
|
||||
LOG(log_error, logtype_default, "cnid_open: DBHOME mkdir failed for %s", path);
|
||||
goto fail_adouble;
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-libatalk_cnid_cdb_cnid_cdb_private_h,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- libatalk/cnid/cdb/cnid_cdb_private.h.orig Sun Mar 21 23:38:51 2004
|
||||
+++ libatalk/cnid/cdb/cnid_cdb_private.h Fri Dec 30 19:05:17 2005
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
+#include <sys/types.h>
|
||||
#include <netatalk/endian.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
@ -1,21 +0,0 @@
|
||||
$OpenBSD: patch-libatalk_cnid_dbd_cnid_dbd_c,v 1.2 2007/10/25 18:57:32 steven Exp $
|
||||
--- libatalk/cnid/dbd/cnid_dbd.c.orig Sun Feb 6 11:16:03 2005
|
||||
+++ libatalk/cnid/dbd/cnid_dbd.c Thu Oct 25 20:30:06 2007
|
||||
@@ -52,7 +52,7 @@ static void RQST_RESET(struct cnid_dbd_rqst *r)
|
||||
}
|
||||
|
||||
/* ----------- */
|
||||
-extern char Cnid_srv[MAXHOSTNAMELEN + 1];
|
||||
+extern char Cnid_srv[MAXHOSTNAMELEN];
|
||||
extern int Cnid_port;
|
||||
|
||||
static int tsock_getfd(char *host, int port)
|
||||
@@ -398,7 +398,7 @@ struct _cnid_db *cnid_dbd_open(const char *dir, mode_t
|
||||
|
||||
/* We keep a copy of the directory in the db structure so that we can
|
||||
transparently reconnect later. */
|
||||
- strcpy(db->db_dir, dir);
|
||||
+ strlcpy(db->db_dir, dir, sizeof(db->db_dir));
|
||||
db->magic = CNID_DB_MAGIC;
|
||||
db->fd = -1;
|
||||
#ifdef DEBUG
|
@ -1,12 +0,0 @@
|
||||
$OpenBSD: patch-libatalk_nbp_nbp_util_c,v 1.1 2006/09/22 05:56:25 pvalchev Exp $
|
||||
--- libatalk/nbp/nbp_util.c.orig Thu Jan 17 01:12:02 2002
|
||||
+++ libatalk/nbp/nbp_util.c Fri Dec 30 21:49:37 2005
|
||||
@@ -148,7 +148,7 @@ int nbp_name( name, objp, typep, zonep )
|
||||
if ( strlen( name ) + 1 > sizeof( buf )) {
|
||||
return( -1 );
|
||||
}
|
||||
- strcpy( buf, name );
|
||||
+ strlcpy( buf, name, sizeof(buf) );
|
||||
|
||||
if (( p = strrchr( buf, '@' )) != NULL ) {
|
||||
*p++ = '\0';
|
@ -1,11 +1,7 @@
|
||||
Netatalk is an open-source software package to deal with the AppleTalk
|
||||
protocol suite and its relative. It can do file- and print- sharing for
|
||||
macintosh and contains an equivalent of "routed" for the DDP protocol.
|
||||
Netatalk is a freely-available Open Source AFP fileserver.
|
||||
|
||||
It also comes with a load of small utilities to ease dealing with
|
||||
Macintosh file from the unix side.
|
||||
It also comes with a load of small utilities to ease dealing with
|
||||
Macintosh files from the Unix side.
|
||||
|
||||
New in 2.0:
|
||||
- AFP 3.1
|
||||
- large files (>2G) support
|
||||
- long file names (up to 255 bytes)
|
||||
Flavors:
|
||||
avahi - Build with ZeroConf support
|
||||
|
@ -1,6 +0,0 @@
|
||||
To start netatalk automatically at boot time, add these lines to
|
||||
/etc/rc.local:
|
||||
|
||||
if [ -f ${SYSCONFDIR}/netatalk/rc.atalk ]; then
|
||||
. ${SYSCONFDIR}/netatalk/rc.atalk
|
||||
fi
|
@ -1,67 +1,61 @@
|
||||
@comment $OpenBSD: PLIST,v 1.7 2010/03/01 13:41:31 espie Exp $
|
||||
@bin bin/achfile
|
||||
bin/acleandir.rc
|
||||
@comment $OpenBSD: PLIST,v 1.8 2012/04/11 18:39:13 sthen Exp $
|
||||
@bin bin/ad
|
||||
@bin bin/adv1tov2
|
||||
@bin bin/aecho
|
||||
@bin bin/afile
|
||||
bin/afpd-mtab.pl
|
||||
@bin bin/afpldaptest
|
||||
@mode 4755
|
||||
@bin bin/afppasswd
|
||||
@mode
|
||||
bin/apple_cp
|
||||
bin/apple_mv
|
||||
bin/apple_rm
|
||||
bin/apple_dump
|
||||
bin/asip-status.pl
|
||||
bin/binheader
|
||||
bin/cleanappledouble.pl
|
||||
bin/cnid2_create
|
||||
@bin bin/cnid_index
|
||||
bin/cnid_maint
|
||||
@bin bin/getzones
|
||||
@bin bin/dbd
|
||||
bin/hqx2bin
|
||||
bin/lp2pap.sh
|
||||
bin/macbinary
|
||||
bin/macusers
|
||||
@bin bin/megatron
|
||||
bin/nadheader
|
||||
@bin bin/nbplkup
|
||||
@bin bin/nbprgstr
|
||||
@bin bin/nbpunrgstr
|
||||
bin/netatalk-config
|
||||
bin/nu
|
||||
@bin bin/pap
|
||||
@bin bin/papstatus
|
||||
@bin bin/psorder
|
||||
@bin bin/showppd
|
||||
bin/single2bin
|
||||
@bin bin/timeout
|
||||
bin/unbin
|
||||
bin/unhex
|
||||
@bin bin/uniconv
|
||||
bin/unsingle
|
||||
include/atalk/
|
||||
include/atalk/acl.h
|
||||
include/atalk/adouble.h
|
||||
include/atalk/aep.h
|
||||
include/atalk/afp.h
|
||||
include/atalk/asp.h
|
||||
include/atalk/atp.h
|
||||
include/atalk/boolean.h
|
||||
include/atalk/cnid.h
|
||||
include/atalk/compat.h
|
||||
include/atalk/ddp.h
|
||||
include/atalk/directory.h
|
||||
include/atalk/dsi.h
|
||||
include/atalk/ea.h
|
||||
include/atalk/hash.h
|
||||
include/atalk/ldapconfig.h
|
||||
include/atalk/list.h
|
||||
include/atalk/logger.h
|
||||
include/atalk/nbp.h
|
||||
include/atalk/netddp.h
|
||||
include/atalk/pap.h
|
||||
include/atalk/paths.h
|
||||
include/atalk/queue.h
|
||||
include/atalk/rtmp.h
|
||||
include/atalk/server_child.h
|
||||
include/atalk/server_ipc.h
|
||||
include/atalk/tdb.h
|
||||
include/atalk/uam.h
|
||||
include/atalk/unicode.h
|
||||
include/atalk/unix.h
|
||||
include/atalk/util.h
|
||||
include/atalk/uuid.h
|
||||
include/atalk/vfs.h
|
||||
include/atalk/volinfo.h
|
||||
include/atalk/volume.h
|
||||
include/atalk/zip.h
|
||||
include/netatalk/
|
||||
include/netatalk/aarp.h
|
||||
@ -77,102 +71,47 @@ lib/netatalk/
|
||||
lib/netatalk/uams/
|
||||
lib/netatalk/uams/uams_clrtxt.so
|
||||
lib/netatalk/uams/uams_dhx.so
|
||||
lib/netatalk/uams/uams_dhx_passwd.a
|
||||
lib/netatalk/uams/uams_dhx_passwd.la
|
||||
lib/netatalk/uams/uams_dhx2.so
|
||||
lib/netatalk/uams/uams_dhx2_passwd.so
|
||||
lib/netatalk/uams/uams_dhx_passwd.so
|
||||
lib/netatalk/uams/uams_guest.a
|
||||
lib/netatalk/uams/uams_guest.la
|
||||
lib/netatalk/uams/uams_gss.so
|
||||
lib/netatalk/uams/uams_guest.so
|
||||
lib/netatalk/uams/uams_passwd.a
|
||||
lib/netatalk/uams/uams_passwd.la
|
||||
lib/netatalk/uams/uams_passwd.so
|
||||
lib/netatalk/uams/uams_randnum.a
|
||||
lib/netatalk/uams/uams_randnum.la
|
||||
lib/netatalk/uams/uams_randnum.so
|
||||
libexec/etc2ps.sh
|
||||
libexec/ifmpap
|
||||
libexec/ifmpaprev
|
||||
libexec/ifpap
|
||||
libexec/ifpaprev
|
||||
libexec/ifwmpap
|
||||
libexec/ifwmpaprev
|
||||
libexec/ifwpap
|
||||
libexec/ifwpaprev
|
||||
libexec/ofmpap
|
||||
libexec/ofpap
|
||||
libexec/ofwmpap
|
||||
libexec/ofwpap
|
||||
@bin libexec/psa
|
||||
@bin libexec/psf
|
||||
libexec/tfmpap
|
||||
libexec/tfmpaprev
|
||||
libexec/tfpap
|
||||
libexec/tfpaprev
|
||||
libexec/tfwmpap
|
||||
libexec/tfwmpaprev
|
||||
libexec/tfwpap
|
||||
libexec/tfwpaprev
|
||||
@man man/man1/achfile.1
|
||||
@man man/man1/acleandir.1
|
||||
@man man/man1/aecho.1
|
||||
@man man/man1/afile.1
|
||||
@man man/man1/ad.1
|
||||
@man man/man1/afpldaptest.1
|
||||
@man man/man1/afppasswd.1
|
||||
@man man/man1/apple_cp.1
|
||||
@man man/man1/apple_mv.1
|
||||
@man man/man1/apple_rm.1
|
||||
@man man/man1/apple_dump.1
|
||||
@man man/man1/asip-status.pl.1
|
||||
@man man/man1/cnid_index.1
|
||||
@man man/man1/getzones.1
|
||||
@man man/man1/dbd.1
|
||||
@man man/man1/hqx2bin.1
|
||||
@man man/man1/macbinary.1
|
||||
@man man/man1/macusers.1
|
||||
@man man/man1/megatron.1
|
||||
@man man/man1/nbp.1
|
||||
@man man/man1/nbplkup.1
|
||||
@man man/man1/nbprgstr.1
|
||||
@man man/man1/nbpunrgstr.1
|
||||
@man man/man1/netatalk-config.1
|
||||
@man man/man1/pap.1
|
||||
@man man/man1/papstatus.1
|
||||
@man man/man1/psorder.1
|
||||
@man man/man1/single2bin.1
|
||||
@man man/man1/timeout.1
|
||||
@man man/man1/unbin.1
|
||||
@man man/man1/unhex.1
|
||||
@man man/man1/uniconv.1
|
||||
@man man/man1/unsingle.1
|
||||
@man man/man3/atalk_aton.3
|
||||
@man man/man3/nbp_name.3
|
||||
@man man/man4/atalk.4
|
||||
@man man/man5/AppleVolumes.5
|
||||
@man man/man5/AppleVolumes.default.5
|
||||
@man man/man5/AppleVolumes.system.5
|
||||
@man man/man5/afp_ldap.conf.5
|
||||
@man man/man5/afp_signature.conf.5
|
||||
@man man/man5/afp_voluuid.conf.5
|
||||
@man man/man5/afpd.conf.5
|
||||
@man man/man5/atalkd.conf.5
|
||||
@man man/man5/netatalk.conf.5
|
||||
@man man/man5/papd.conf.5
|
||||
@man man/man8/afpd.8
|
||||
@man man/man8/atalkd.8
|
||||
@man man/man8/cnid_dbd.8
|
||||
@man man/man8/cnid_metad.8
|
||||
@man man/man8/papd.8
|
||||
@man man/man8/papstatus.8
|
||||
@man man/man8/psf.8
|
||||
@man man/man8/timelord.8
|
||||
@bin sbin/afpd
|
||||
@bin sbin/atalkd
|
||||
@bin sbin/cnid_dbd
|
||||
@bin sbin/cnid_metad
|
||||
@bin sbin/papd
|
||||
share/aclocal/
|
||||
share/aclocal/netatalk.m4
|
||||
share/doc/netatalk/
|
||||
share/doc/netatalk/COPYING
|
||||
share/doc/netatalk/COPYRIGHT
|
||||
share/doc/netatalk/FAQ
|
||||
share/doc/netatalk/Netatalk-Manual.pdf
|
||||
share/doc/netatalk/Netatalk-Manual.txt
|
||||
share/doc/netatalk/README.hidden-items
|
||||
share/doc/netatalk/README.ids
|
||||
share/doc/netatalk/README.logger
|
||||
share/doc/netatalk/README.platforms
|
||||
share/doc/netatalk/README.AppleTalk
|
||||
share/examples/netatalk/
|
||||
@mode 750
|
||||
@sample ${SYSCONFDIR}/netatalk/
|
||||
@ -183,13 +122,9 @@ share/examples/netatalk/AppleVolumes.system
|
||||
@sample ${SYSCONFDIR}/netatalk/AppleVolumes.system
|
||||
share/examples/netatalk/afpd.conf
|
||||
@sample ${SYSCONFDIR}/netatalk/afpd.conf
|
||||
share/examples/netatalk/atalkd.conf
|
||||
@sample ${SYSCONFDIR}/netatalk/atalkd.conf
|
||||
share/examples/netatalk/netatalk.conf
|
||||
@sample ${SYSCONFDIR}/netatalk/netatalk.conf
|
||||
share/examples/netatalk/papd.conf
|
||||
@sample ${SYSCONFDIR}/netatalk/papd.conf
|
||||
share/examples/netatalk/rc.atalk.bsd
|
||||
@sample ${SYSCONFDIR}/netatalk/rc.atalk
|
||||
share/netatalk/
|
||||
share/netatalk/pagecount.ps
|
||||
@mode
|
||||
@rcscript ${RCDIR}/afpd
|
||||
@rcscript ${RCDIR}/cnid_metad
|
||||
@rcscript ${RCDIR}/netatalk
|
||||
|
11
net/netatalk/pkg/afpd.rc
Normal file
11
net/netatalk/pkg/afpd.rc
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $OpenBSD: afpd.rc,v 1.1 2012/04/11 18:39:13 sthen Exp $
|
||||
|
||||
daemon="${TRUEPREFIX}/sbin/afpd"
|
||||
|
||||
. /etc/rc.d/rc.subr
|
||||
|
||||
rc_reload=NO
|
||||
|
||||
rc_cmd $1
|
11
net/netatalk/pkg/cnid_metad.rc
Normal file
11
net/netatalk/pkg/cnid_metad.rc
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $OpenBSD: cnid_metad.rc,v 1.1 2012/04/11 18:39:13 sthen Exp $
|
||||
|
||||
daemon="${TRUEPREFIX}/sbin/cnid_metad"
|
||||
|
||||
. /etc/rc.d/rc.subr
|
||||
|
||||
rc_reload=NO
|
||||
|
||||
rc_cmd $1
|
18
net/netatalk/pkg/netatalk.rc
Normal file
18
net/netatalk/pkg/netatalk.rc
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $OpenBSD: netatalk.rc,v 1.1 2012/04/11 18:39:13 sthen Exp $
|
||||
|
||||
# "meta" script running the following rc.d(8) scripts with the given argument
|
||||
_pkg_scripts="cnid_metad afpd"
|
||||
|
||||
set -A _s -- ${_pkg_scripts}
|
||||
|
||||
if [ "$1" = stop ]; then
|
||||
i=$(echo ${_pkg_scripts} | wc -w)
|
||||
while [ $i -ne 0 ]; do
|
||||
i=$((i-1))
|
||||
/etc/rc.d/${_s[$i]} $1
|
||||
done
|
||||
else
|
||||
for i in ${_pkg_scripts}; do /etc/rc.d/$i $1; done
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user