patch-etcafpd-authc
more syslogging of login failures so we have have more info on why. patch-etcafpd-volumec Update to partially resolve the current problem with afpd not behaving correctly with permisions on /etc/netatalk. Log correctly to /var/log/daemon when we can't access configuration files. Put in place proper error checking when reading them. Would be nice if the origional programmers actually checked for failure for anything. People can now see just why things are not working as they like. Mar 29 18:08:38 kashmir afpd[6210]: session from 39148.187:250 on 39148.169:129 Mar 29 18:08:38 kashmir afpd[6210]: login dingo (uid 1002, gid 10) Mar 29 18:08:38 kashmir afpd[6210]: unable to access /etc/netatalk/AppleVolumes.system: Permission denied Mar 29 18:08:40 kashmir afpd[6210]: done Mar 29 18:08:40 kashmir afpd[21593]: asp_chld 6210 done Pass the CORRECT arguments to creatvol. from "Benninghoff, John" <JABenninghoff@dainrauscher.com> Return AFPERR_PARAM when we can't access configuration files to the appleshare client requesting access. This stops possible DOS under MacOS. In it's current form the Appleshare client has to be killed on the MAC side by killing the "CHOOSER" Application. By returning proper errors the appleshare client exits gracefully with error: "An Appleshare system error occured." patch-etcpapd-lpc cosmetic change: remove an unused variable. patch-version changes made bump version. -- From: maintainer
This commit is contained in:
parent
c92b3b5132
commit
31355b4571
net/netatalk/patches
@ -1,5 +1,6 @@
|
||||
$OpenBSD: patch-etcafpd-authc,v 1.2 2001/04/18 13:17:43 brad Exp $
|
||||
--- etc/afpd/auth.c.orig Sat Mar 15 07:03:18 1997
|
||||
+++ etc/afpd/auth.c Thu Nov 11 16:35:34 1999
|
||||
+++ etc/afpd/auth.c Wed Apr 18 14:19:12 2001
|
||||
@@ -4,18 +4,22 @@
|
||||
*/
|
||||
|
||||
@ -35,7 +36,7 @@
|
||||
static char realm[ REALM_SZ ];
|
||||
#endif KRB UAM_AFSKRB
|
||||
|
||||
@@ -93,6 +97,7 @@
|
||||
@@ -93,6 +97,7 @@ gid_t groups[ NGROUPS ];
|
||||
int ngroups;
|
||||
char *username = NULL;
|
||||
char *mktemp();
|
||||
@ -43,7 +44,7 @@
|
||||
|
||||
/*
|
||||
* These numbers are scattered throughout the code.
|
||||
@@ -100,6 +105,8 @@
|
||||
@@ -100,6 +105,8 @@ char *mktemp();
|
||||
struct afp_versions afp_versions[] = {
|
||||
{ "AFPVersion 1.1", 11 },
|
||||
{ "AFPVersion 2.0", 20 },
|
||||
@ -52,7 +53,7 @@
|
||||
};
|
||||
|
||||
/* Note that these names must match those in main() */
|
||||
@@ -120,6 +127,7 @@
|
||||
@@ -120,6 +127,7 @@ struct afp_uams *afp_uam = NULL;
|
||||
/*
|
||||
* Mark a UAM as off.
|
||||
*/
|
||||
@ -60,7 +61,7 @@
|
||||
uam_off( uam )
|
||||
char *uam;
|
||||
{
|
||||
@@ -134,6 +142,7 @@
|
||||
@@ -134,6 +142,7 @@ uam_off( uam )
|
||||
return;
|
||||
}
|
||||
|
||||
@ -68,7 +69,7 @@
|
||||
status_versions( data )
|
||||
char *data;
|
||||
{
|
||||
@@ -147,12 +156,13 @@
|
||||
@@ -147,12 +156,13 @@ status_versions( data )
|
||||
for ( i = 0; i < num; i++ ) {
|
||||
len = strlen( afp_versions[ i ].av_name );
|
||||
*data++ = len;
|
||||
@ -83,7 +84,7 @@
|
||||
status_uams( data )
|
||||
char *data;
|
||||
{
|
||||
@@ -171,13 +181,14 @@
|
||||
@@ -171,13 +181,14 @@ status_uams( data )
|
||||
if (( afp_uams[ i ].au_flags & AU_OFF ) == 0 ) {
|
||||
len = strlen( afp_uams[ i ].au_name );
|
||||
*data++ = len;
|
||||
@ -99,7 +100,7 @@
|
||||
afp_login( ibuf, ibuflen, rbuf, rbuflen )
|
||||
char *ibuf, *rbuf;
|
||||
int ibuflen, *rbuflen;
|
||||
@@ -230,6 +241,7 @@
|
||||
@@ -230,6 +241,7 @@ afp_login( ibuf, ibuflen, rbuf, rbuflen
|
||||
return( afp_uam->au_login( ibuf, ibuflen, rbuf, rbuflen ));
|
||||
}
|
||||
|
||||
@ -107,7 +108,7 @@
|
||||
afp_logincont( ibuf, ibuflen, rbuf, rbuflen, asp )
|
||||
char *ibuf, *rbuf;
|
||||
int ibuflen, *rbuflen;
|
||||
@@ -242,6 +254,7 @@
|
||||
@@ -242,6 +254,7 @@ afp_logincont( ibuf, ibuflen, rbuf, rbuf
|
||||
return( afp_uam->au_logincont( ibuf, ibuflen, rbuf, rbuflen, asp ));
|
||||
}
|
||||
|
||||
@ -115,7 +116,7 @@
|
||||
noauth_login( ibuf, ibuflen, rbuf, rbuflen )
|
||||
char *ibuf, *rbuf;
|
||||
int ibuflen, *rbuflen;
|
||||
@@ -275,6 +288,7 @@
|
||||
@@ -275,6 +288,7 @@ noauth_login( ibuf, ibuflen, rbuf, rbufl
|
||||
return( AFP_OK );
|
||||
}
|
||||
|
||||
@ -123,7 +124,7 @@
|
||||
login( name, uid, gid )
|
||||
char *name;
|
||||
uid_t uid;
|
||||
@@ -302,6 +316,7 @@
|
||||
@@ -302,6 +316,7 @@ login( name, uid, gid )
|
||||
return( AFP_OK );
|
||||
}
|
||||
|
||||
@ -131,7 +132,7 @@
|
||||
lcase( p )
|
||||
char *p;
|
||||
{
|
||||
@@ -313,6 +328,7 @@
|
||||
@@ -313,6 +328,7 @@ lcase( p )
|
||||
return;
|
||||
}
|
||||
|
||||
@ -139,7 +140,7 @@
|
||||
ucase( p )
|
||||
char *p;
|
||||
{
|
||||
@@ -335,7 +351,7 @@
|
||||
@@ -335,7 +351,7 @@ ucase( p )
|
||||
#define KRB4WRT_SKIP 7
|
||||
#define KRB4RPL_DONEMUT 8
|
||||
|
||||
@ -148,7 +149,7 @@
|
||||
krb4_login( ibuf, ibuflen, rbuf, rbuflen )
|
||||
char *ibuf, *rbuf;
|
||||
int ibuflen, *rbuflen;
|
||||
@@ -360,7 +376,7 @@
|
||||
@@ -360,7 +376,7 @@ krb4_login( ibuf, ibuflen, rbuf, rbuflen
|
||||
*p++ = 1;
|
||||
len = strlen( realm );
|
||||
*p++ = len;
|
||||
@ -157,7 +158,7 @@
|
||||
p += len + 1;
|
||||
|
||||
#ifdef AFS
|
||||
@@ -375,6 +391,7 @@
|
||||
@@ -375,6 +391,7 @@ krb4_login( ibuf, ibuflen, rbuf, rbuflen
|
||||
return( AFPERR_AUTHCONT );
|
||||
}
|
||||
|
||||
@ -165,7 +166,7 @@
|
||||
krb4_logincont( ibuf, ibuflen, rbuf, rbuflen, asp )
|
||||
char *ibuf, *rbuf;
|
||||
int ibuflen, *rbuflen;
|
||||
@@ -384,15 +401,15 @@
|
||||
@@ -384,15 +401,15 @@ krb4_logincont( ibuf, ibuflen, rbuf, rbu
|
||||
KTEXT_ST tkt;
|
||||
static AUTH_DAT ad;
|
||||
int rc;
|
||||
@ -184,7 +185,7 @@
|
||||
|
||||
if ( asp_wrtcont( asp, rbuf, rbuflen ) < 0 ) {
|
||||
*rbuflen = 0;
|
||||
@@ -403,15 +420,15 @@
|
||||
@@ -403,15 +420,15 @@ krb4_logincont( ibuf, ibuflen, rbuf, rbu
|
||||
|
||||
switch ( rc = *p++ ) {
|
||||
case KRB4WRT_SESS :
|
||||
@ -203,7 +204,7 @@
|
||||
p += tkt.length;
|
||||
|
||||
if (( rc = krb_rd_req( &tkt, "afpserver", Obj, 0, &ad, "" ))
|
||||
@@ -424,7 +441,7 @@
|
||||
@@ -424,7 +441,7 @@ krb4_logincont( ibuf, ibuflen, rbuf, rbu
|
||||
|
||||
syslog( LOG_INFO, "krb4_login: %s.%s@%s", ad.pname, ad.pinst,
|
||||
ad.prealm );
|
||||
@ -212,7 +213,7 @@
|
||||
key_sched( seskey, seskeysched );
|
||||
|
||||
username = ad.pname;
|
||||
@@ -444,46 +461,46 @@
|
||||
@@ -444,46 +461,46 @@ krb4_logincont( ibuf, ibuflen, rbuf, rbu
|
||||
len = strlen( realm );
|
||||
*p++ = len + 1;
|
||||
*p++ = '@';
|
||||
@ -273,16 +274,24 @@
|
||||
p += strlen( realm ) + 1;
|
||||
|
||||
vi.in = buf;
|
||||
@@ -522,6 +539,7 @@
|
||||
@@ -520,8 +537,9 @@ krb4_logincont( ibuf, ibuflen, rbuf, rbu
|
||||
|
||||
static char clrtxtname[ 32 ];
|
||||
extern char *crypt();
|
||||
|
||||
-static char clrtxtname[ 32 ];
|
||||
+static char clrtxtname[MAXLOGNAME];
|
||||
|
||||
+int
|
||||
clrtxt_login( ibuf, ibuflen, rbuf, rbuflen )
|
||||
char *ibuf, *rbuf;
|
||||
int ibuflen, *rbuflen;
|
||||
@@ -539,7 +557,7 @@
|
||||
if ( len > 31 ) {
|
||||
@@ -536,17 +554,20 @@ clrtxt_login( ibuf, ibuflen, rbuf, rbufl
|
||||
*rbuflen = 0;
|
||||
|
||||
len = *(unsigned char *)ibuf++;
|
||||
- if ( len > 31 ) {
|
||||
+ if ( len > (MAXLOGNAME-1)) {
|
||||
+ syslog( LOG_INFO, "Username > %d characters. OpenBSD only supports max. %d character usernames.", MAXLOGNAME-1, MAXLOGNAME-1);
|
||||
return( AFPERR_PARAM );
|
||||
}
|
||||
- bcopy( ibuf, clrtxtname, len );
|
||||
@ -290,7 +299,17 @@
|
||||
ibuf += len;
|
||||
clrtxtname[ len ] = '\0';
|
||||
while ( len-- ) {
|
||||
@@ -594,13 +612,13 @@
|
||||
clrtxtname[ len ] = tolower( clrtxtname[ len ] );
|
||||
}
|
||||
username = clrtxtname;
|
||||
- if (( pwd = getpwnam( clrtxtname )) == NULL ) {
|
||||
+ if (( pwd = getpwnam(clrtxtname)) == NULL ) {
|
||||
+ syslog(LOG_INFO,
|
||||
+ "Username: %s not in password database: No login.", clrtxtname);
|
||||
return( AFPERR_NOTAUTH );
|
||||
}
|
||||
|
||||
@@ -594,13 +615,13 @@ afskrb_login( ibuf, ibuflen, rbuf, rbufl
|
||||
CREDENTIALS cr;
|
||||
char *p, *q;
|
||||
int len, rc, whoserealm;
|
||||
@ -307,7 +326,7 @@
|
||||
ucase( realm );
|
||||
whoserealm = 0;
|
||||
} else {
|
||||
@@ -610,13 +628,13 @@
|
||||
@@ -610,13 +631,13 @@ afskrb_login( ibuf, ibuflen, rbuf, rbufl
|
||||
}
|
||||
whoserealm = 1;
|
||||
}
|
||||
@ -324,7 +343,7 @@
|
||||
/*
|
||||
* We don't have the session key, yet. Get one.
|
||||
*/
|
||||
@@ -649,12 +667,12 @@
|
||||
@@ -649,12 +670,12 @@ afskrb_login( ibuf, ibuflen, rbuf, rbufl
|
||||
return( AFPERR_BADUAM );
|
||||
}
|
||||
|
||||
@ -339,7 +358,7 @@
|
||||
p += authent.length;
|
||||
}
|
||||
|
||||
@@ -677,13 +695,13 @@
|
||||
@@ -677,13 +698,13 @@ afskrb_login( ibuf, ibuflen, rbuf, rbufl
|
||||
q += 10;
|
||||
|
||||
len = strlen( realm );
|
||||
@ -359,7 +378,7 @@
|
||||
p += slen;
|
||||
|
||||
*rbuflen = p - rbuf;
|
||||
@@ -700,13 +718,13 @@
|
||||
@@ -700,13 +721,13 @@ afskrb_logincont( ibuf, ibuflen, rbuf, r
|
||||
struct passwd *pwd;
|
||||
char buf[ 1024 ], *p;
|
||||
int aint;
|
||||
@ -376,7 +395,7 @@
|
||||
|
||||
pcbc_encrypt((C_Block *)ibuf, (C_Block *)ibuf,
|
||||
clen, seskeysched, seskey, DECRYPT );
|
||||
@@ -723,30 +741,30 @@
|
||||
@@ -723,30 +744,30 @@ afskrb_logincont( ibuf, ibuflen, rbuf, r
|
||||
}
|
||||
|
||||
p = buf;
|
||||
|
@ -1,6 +1,7 @@
|
||||
$OpenBSD: patch-etcafpd-volumec,v 1.3 2001/04/18 13:17:44 brad Exp $
|
||||
--- etc/afpd/volume.c.orig Tue Mar 31 02:57:11 1998
|
||||
+++ etc/afpd/volume.c Tue Nov 14 19:17:39 2000
|
||||
@@ -16,20 +16,32 @@
|
||||
+++ etc/afpd/volume.c Thu Apr 5 12:20:22 2001
|
||||
@@ -16,29 +16,47 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -30,19 +31,64 @@
|
||||
+
|
||||
+int strdiacasecmp();
|
||||
+
|
||||
+void
|
||||
+int
|
||||
initvolumes()
|
||||
{
|
||||
struct passwd *pwent;
|
||||
@@ -69,6 +81,7 @@ initvolumes()
|
||||
return;
|
||||
|
||||
if ( !uservolfirst ) {
|
||||
- readvolfile( systemvol, NULL, 0 );
|
||||
+ if (readvolfile( systemvol, NULL, 0 ) < 0) {
|
||||
+ syslog(LOG_INFO, "unable to access %s: %m ", systemvol);
|
||||
+ return(-1);
|
||||
+ }
|
||||
}
|
||||
if ( username == NULL ) {
|
||||
- readvolfile( defaultvol, NULL, 1 );
|
||||
+ if (readvolfile( defaultvol, NULL, 1 ) < 0) {
|
||||
+ syslog(LOG_INFO, "unable to access %s: %m ", defaultvol);
|
||||
+ return(-1);
|
||||
+ }
|
||||
} else if (( pwent = getpwnam( username )) != NULL ) {
|
||||
/*
|
||||
* Read user's AppleVolumes or .AppleVolumes file
|
||||
@@ -49,7 +67,7 @@ initvolumes()
|
||||
readvolfile( pwent->pw_dir, ".applevolumes", 1 ) < 0 &&
|
||||
defaultvol != NULL ) {
|
||||
if ( readvolfile( defaultvol, NULL, 1 ) < 0 ) {
|
||||
- creatvol( pwent->pw_dir, NULL );
|
||||
+ creatvol( pwent->pw_dir, NULL, 0 );
|
||||
}
|
||||
}
|
||||
#else !DOWNCASE
|
||||
@@ -57,18 +75,22 @@ initvolumes()
|
||||
readvolfile( pwent->pw_dir, ".AppleVolumes", 1 ) < 0 &&
|
||||
defaultvol != NULL ) {
|
||||
if ( readvolfile( defaultvol, NULL, 1 ) < 0 ) {
|
||||
- creatvol( pwent->pw_dir, NULL );
|
||||
+ creatvol( pwent->pw_dir, NULL, 0 );
|
||||
}
|
||||
}
|
||||
#endif DOWNCASE
|
||||
}
|
||||
- if ( uservolfirst ) {
|
||||
- readvolfile( systemvol, NULL, 0 );
|
||||
+ if ( uservolfirst && systemvol !=NULL) {
|
||||
+ if (readvolfile( systemvol, NULL, 0 ) < 0) {
|
||||
+ syslog(LOG_INFO, "unable to access %s: %m ", defaultvol);
|
||||
+ return(-1);
|
||||
+ }
|
||||
}
|
||||
|
||||
- return;
|
||||
+ return(0);
|
||||
}
|
||||
|
||||
+int
|
||||
afp_getsrvrparms( ibuf, ibuflen, rbuf, rbuflen )
|
||||
char *ibuf, *rbuf;
|
||||
int ibuflen, *rbuflen;
|
||||
@@ -76,9 +89,11 @@ afp_getsrvrparms( ibuf, ibuflen, rbuf, r
|
||||
@@ -76,11 +98,14 @@ afp_getsrvrparms( ibuf, ibuflen, rbuf, r
|
||||
struct timeval tv;
|
||||
struct stat st;
|
||||
struct vol *volume;
|
||||
@ -54,9 +100,13 @@
|
||||
+ int vcnt, len, iconfd;
|
||||
+ u_int32_t secs;
|
||||
|
||||
initvolumes();
|
||||
- initvolumes();
|
||||
+ if (initvolumes() < 0)
|
||||
+ return(AFPERR_PARAM);
|
||||
|
||||
@@ -91,13 +106,71 @@ afp_getsrvrparms( ibuf, ibuflen, rbuf, r
|
||||
data = rbuf + 5;
|
||||
for ( vcnt = 0, volume = volumes; volume; volume = volume->v_next ) {
|
||||
@@ -91,13 +116,71 @@ afp_getsrvrparms( ibuf, ibuflen, rbuf, r
|
||||
if (( st.st_mode & S_IFDIR ) == 0 ) {
|
||||
continue; /* not a dir */
|
||||
}
|
||||
@ -101,11 +151,11 @@
|
||||
+ /* create an empty data fork and populate the resource fork
|
||||
+ with the new icon data. */
|
||||
+ if (( iconfd = open( iconpath, O_CREAT | O_WRONLY, 0664 )) < 0 ) {
|
||||
+ syslog( LOG_ERR, "can't open iconpath!");
|
||||
+ syslog( LOG_INFO, "can't open iconpath!: %m");
|
||||
+ } else { close(iconfd); }
|
||||
+
|
||||
+ if (( iconfd = open( iconpathres, O_CREAT | O_WRONLY, 0664 )) < 0 ) {
|
||||
+ syslog( LOG_ERR, "can't open iconpathres!");
|
||||
+ syslog( LOG_INFO, "can't open iconpathres!: %m");
|
||||
+ } else {
|
||||
+ /* copy our resource data into the file. */
|
||||
+
|
||||
@ -130,7 +180,7 @@
|
||||
}
|
||||
|
||||
*rbuflen = data - rbuf;
|
||||
@@ -106,21 +179,27 @@ afp_getsrvrparms( ibuf, ibuflen, rbuf, r
|
||||
@@ -106,21 +189,27 @@ afp_getsrvrparms( ibuf, ibuflen, rbuf, r
|
||||
syslog( LOG_ERR, "afp_getsrvrparms: gettimeofday: %m" );
|
||||
exit( 1 );
|
||||
}
|
||||
@ -164,7 +214,7 @@
|
||||
return; /* Obviously not a fully qualified path */
|
||||
}
|
||||
name++;
|
||||
@@ -147,18 +226,21 @@ creatvol( path, name )
|
||||
@@ -147,18 +236,21 @@ creatvol( path, name )
|
||||
syslog( LOG_ERR, "creatvol: malloc: %m" );
|
||||
exit( 1 );
|
||||
}
|
||||
@ -190,7 +240,7 @@
|
||||
#ifdef __svr4__
|
||||
volume->v_qfd = -1;
|
||||
#else __svr4__
|
||||
@@ -209,6 +291,7 @@ char *myfgets( buf, size, fp )
|
||||
@@ -209,6 +301,7 @@ char *myfgets( buf, size, fp )
|
||||
* <unix path> [<volume name> [<flags>,...]]
|
||||
* <extension> TYPE [CREATOR]
|
||||
*/
|
||||
@ -198,7 +248,7 @@
|
||||
readvolfile( p1, p2, user )
|
||||
char *p1, *p2;
|
||||
int user;
|
||||
@@ -218,13 +301,13 @@ readvolfile( p1, p2, user )
|
||||
@@ -218,13 +311,13 @@ readvolfile( p1, p2, user )
|
||||
volname[ 28 ], buf[ BUFSIZ ],
|
||||
type[ 5 ], creator[ 5 ];
|
||||
char *u, *p;
|
||||
@ -216,7 +266,7 @@
|
||||
}
|
||||
|
||||
if (( fp = fopen( path, "r" )) == NULL ) {
|
||||
@@ -240,7 +323,7 @@ readvolfile( p1, p2, user )
|
||||
@@ -240,7 +333,7 @@ readvolfile( p1, p2, user )
|
||||
continue;
|
||||
|
||||
case '~' :
|
||||
@ -225,7 +275,7 @@
|
||||
*p++ = '\0';
|
||||
}
|
||||
u = path;
|
||||
@@ -251,17 +334,24 @@ readvolfile( p1, p2, user )
|
||||
@@ -251,17 +344,24 @@ readvolfile( p1, p2, user )
|
||||
if ( u == NULL || ( pw = getpwnam( u )) == NULL ) {
|
||||
continue;
|
||||
}
|
||||
@ -255,7 +305,7 @@
|
||||
break;
|
||||
|
||||
case '.' :
|
||||
@@ -280,6 +370,7 @@ readvolfile( p1, p2, user )
|
||||
@@ -280,6 +380,7 @@ readvolfile( p1, p2, user )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@ -263,7 +313,7 @@
|
||||
setextmap( ext, type, creator, user )
|
||||
char *ext, *type, *creator;
|
||||
int user;
|
||||
@@ -304,17 +395,17 @@ setextmap( ext, type, creator, user )
|
||||
@@ -304,17 +405,17 @@ setextmap( ext, type, creator, user )
|
||||
return;
|
||||
}
|
||||
|
||||
@ -286,7 +336,7 @@
|
||||
}
|
||||
|
||||
if ( strcmp( ext, "." ) == 0 ) {
|
||||
@@ -329,7 +420,7 @@ getextmap( path )
|
||||
@@ -329,7 +430,7 @@ getextmap( path )
|
||||
char *p;
|
||||
struct extmap *em;
|
||||
|
||||
@ -295,7 +345,7 @@
|
||||
return( defextmap );
|
||||
}
|
||||
|
||||
@@ -345,6 +436,7 @@ getextmap( path )
|
||||
@@ -345,6 +446,7 @@ getextmap( path )
|
||||
}
|
||||
}
|
||||
|
||||
@ -303,7 +353,7 @@
|
||||
afp_openvol( ibuf, ibuflen, rbuf, rbuflen )
|
||||
char *ibuf, *rbuf;
|
||||
int ibuflen, *rbuflen;
|
||||
@@ -354,19 +446,20 @@ afp_openvol( ibuf, ibuflen, rbuf, rbufle
|
||||
@@ -354,22 +456,24 @@ afp_openvol( ibuf, ibuflen, rbuf, rbufle
|
||||
struct vol *volume;
|
||||
struct dir *dir;
|
||||
int len, ret, buflen;
|
||||
@ -327,8 +377,13 @@
|
||||
+ memcpy( volname, ibuf, len );
|
||||
volname[ len ] = '\0';
|
||||
|
||||
initvolumes();
|
||||
@@ -394,12 +487,13 @@ afp_openvol( ibuf, ibuflen, rbuf, rbufle
|
||||
- initvolumes();
|
||||
+ if (initvolumes() < 0 )
|
||||
+ return(AFPERR_PARAM);
|
||||
|
||||
for ( volume = volumes; volume; volume = volume->v_next ) {
|
||||
if ( strcasecmp( volname, volume->v_name ) == 0 ) {
|
||||
@@ -394,12 +498,13 @@ afp_openvol( ibuf, ibuflen, rbuf, rbufle
|
||||
dir->d_balance = 0;
|
||||
dir->d_did = htonl( 2 );
|
||||
dir->d_flags = 0;
|
||||
@ -344,7 +399,7 @@
|
||||
volume->v_dir = dir;
|
||||
volume->v_did = dir;
|
||||
volume->v_flags |= AFPVOL_OPEN;
|
||||
@@ -410,15 +504,15 @@ afp_openvol( ibuf, ibuflen, rbuf, rbufle
|
||||
@@ -410,15 +515,15 @@ afp_openvol( ibuf, ibuflen, rbuf, rbufle
|
||||
return( AFPERR_PARAM );
|
||||
}
|
||||
|
||||
@ -364,7 +419,7 @@
|
||||
|
||||
/*
|
||||
* If you mount a volume twice, the second time the trash appears on
|
||||
@@ -438,16 +532,17 @@ afp_openvol( ibuf, ibuflen, rbuf, rbufle
|
||||
@@ -438,16 +543,17 @@ afp_openvol( ibuf, ibuflen, rbuf, rbufle
|
||||
return( AFP_OK );
|
||||
}
|
||||
|
||||
@ -384,7 +439,7 @@
|
||||
if (( vol = getvolbyvid( vid )) == NULL ) {
|
||||
return( AFPERR_PARAM );
|
||||
}
|
||||
@@ -471,6 +566,7 @@ afp_closevol( ibuf, ibuflen, rbuf, rbufl
|
||||
@@ -471,6 +577,7 @@ afp_closevol( ibuf, ibuflen, rbuf, rbufl
|
||||
return( AFP_OK );
|
||||
}
|
||||
|
||||
@ -392,7 +447,7 @@
|
||||
freedir( dir )
|
||||
struct dir *dir;
|
||||
{
|
||||
@@ -484,6 +580,7 @@ freedir( dir )
|
||||
@@ -484,6 +591,7 @@ freedir( dir )
|
||||
free( dir );
|
||||
}
|
||||
|
||||
@ -400,7 +455,7 @@
|
||||
afp_getvolparams( ibuf, ibuflen, rbuf, rbuflen )
|
||||
char *ibuf, *rbuf;
|
||||
int ibuflen, *rbuflen;
|
||||
@@ -491,12 +588,12 @@ afp_getvolparams( ibuf, ibuflen, rbuf, r
|
||||
@@ -491,12 +599,12 @@ afp_getvolparams( ibuf, ibuflen, rbuf, r
|
||||
struct stat st;
|
||||
struct vol *vol;
|
||||
int buflen, ret;
|
||||
@ -417,7 +472,7 @@
|
||||
bitmap = ntohs( bitmap );
|
||||
|
||||
if (( vol = getvolbyvid( vid )) == NULL ) {
|
||||
@@ -509,24 +606,25 @@ afp_getvolparams( ibuf, ibuflen, rbuf, r
|
||||
@@ -509,24 +617,25 @@ afp_getvolparams( ibuf, ibuflen, rbuf, r
|
||||
return( AFPERR_PARAM );
|
||||
}
|
||||
|
||||
@ -449,7 +504,7 @@
|
||||
|
||||
spaceflag = AFPVOL_GVSMASK & vol->v_flags;
|
||||
|
||||
@@ -555,14 +653,26 @@ getvolspace( vol, bfree, btotal )
|
||||
@@ -555,14 +664,26 @@ getvolspace( vol, bfree, btotal )
|
||||
}
|
||||
#endif linux
|
||||
|
||||
@ -479,7 +534,7 @@
|
||||
struct vol *vol;
|
||||
struct stat *st;
|
||||
char *buf;
|
||||
@@ -570,15 +680,44 @@ getvolparams( bitmap, vol, st, buf, bufl
|
||||
@@ -570,15 +691,44 @@ getvolparams( bitmap, vol, st, buf, bufl
|
||||
{
|
||||
struct adouble ad;
|
||||
int bit = 0, aint, isad = 1;
|
||||
@ -527,7 +582,7 @@
|
||||
if (( bitmap & ( (1<<VOLPBIT_BFREE)|(1<<VOLPBIT_BTOTAL) )) != 0 ) {
|
||||
if ( getvolspace( vol, &bfree, &btotal ) < 0 ) {
|
||||
if ( isad ) {
|
||||
@@ -598,28 +737,28 @@ getvolparams( bitmap, vol, st, buf, bufl
|
||||
@@ -598,28 +748,28 @@ getvolparams( bitmap, vol, st, buf, bufl
|
||||
switch ( bit ) {
|
||||
case VOLPBIT_ATTR :
|
||||
ashort = 0;
|
||||
@ -564,7 +619,7 @@
|
||||
break;
|
||||
|
||||
case VOLPBIT_MDATE :
|
||||
@@ -629,41 +768,41 @@ getvolparams( bitmap, vol, st, buf, bufl
|
||||
@@ -629,41 +779,41 @@ getvolparams( bitmap, vol, st, buf, bufl
|
||||
} else {
|
||||
aint = htonl( vol->v_time );
|
||||
}
|
||||
@ -616,7 +671,7 @@
|
||||
break;
|
||||
|
||||
default :
|
||||
@@ -677,13 +816,14 @@ getvolparams( bitmap, vol, st, buf, bufl
|
||||
@@ -677,13 +827,14 @@ getvolparams( bitmap, vol, st, buf, bufl
|
||||
}
|
||||
if ( nameoff != 0 ) {
|
||||
ashort = htons( data - buf );
|
||||
@ -633,7 +688,7 @@
|
||||
ad_close( &ad, ADFLAGS_HF );
|
||||
}
|
||||
*buflen = data - buf;
|
||||
@@ -708,6 +848,7 @@ getvolbyvid( vid )
|
||||
@@ -708,6 +859,7 @@ getvolbyvid( vid )
|
||||
return( vol );
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
$OpenBSD: patch-etcpapd-lpc,v 1.3 2001/04/18 13:17:44 brad Exp $
|
||||
--- etc/papd/lp.c.orig Sun Aug 17 09:20:25 1997
|
||||
+++ etc/papd/lp.c Fri May 19 11:09:43 2000
|
||||
+++ etc/papd/lp.c Thu Mar 29 16:31:06 2001
|
||||
@@ -44,6 +44,8 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
@ -25,7 +25,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
|
||||
#include "printer.h"
|
||||
#include "file.h"
|
||||
@@ -100,20 +104,26 @@
|
||||
@@ -100,20 +104,26 @@ struct lp {
|
||||
#define LP_CONNECT (1<<3)
|
||||
#define LP_QUEUE (1<<4)
|
||||
|
||||
@ -54,7 +54,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
lp_pagecost()
|
||||
{
|
||||
char cost[ 22 ];
|
||||
@@ -131,19 +141,25 @@
|
||||
@@ -131,19 +141,25 @@ lp_pagecost()
|
||||
}
|
||||
#endif ABS_PRINT
|
||||
|
||||
@ -82,7 +82,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
lp_job( job )
|
||||
char *job;
|
||||
{
|
||||
@@ -164,12 +180,14 @@
|
||||
@@ -164,12 +180,14 @@ lp_job( job )
|
||||
}
|
||||
}
|
||||
*q = '\0';
|
||||
@ -98,7 +98,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
char *cp, buf[ BUFSIZ ];
|
||||
struct stat st;
|
||||
#ifdef ABS_PRINT
|
||||
@@ -209,12 +227,27 @@
|
||||
@@ -209,12 +227,27 @@ lp_init( out )
|
||||
lp.lp_letter = 'A';
|
||||
|
||||
if ( printer->p_flags & P_SPOOLED ) {
|
||||
@ -130,7 +130,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
if ( st.st_mode & 010 ) {
|
||||
syslog( LOG_INFO, "lp_init: queuing is disabled" );
|
||||
spoolerror( out, "Queuing is disabled." );
|
||||
@@ -250,7 +283,7 @@
|
||||
@@ -250,7 +283,7 @@ lp_init( out )
|
||||
lp.lp_seq = n;
|
||||
|
||||
n = ( n + 1 ) % 1000;
|
||||
@ -139,7 +139,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
lseek( fd, 0L, 0 );
|
||||
write( fd, buf, strlen( buf ));
|
||||
close( fd );
|
||||
@@ -263,6 +296,7 @@
|
||||
@@ -263,6 +296,7 @@ lp_init( out )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
lp_open( out )
|
||||
struct papfile *out;
|
||||
{
|
||||
@@ -285,7 +319,7 @@
|
||||
@@ -285,7 +319,7 @@ lp_open( out )
|
||||
return( -1 );
|
||||
}
|
||||
} else {
|
||||
@ -156,7 +156,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
|
||||
if (( fd = open( name, O_WRONLY|O_CREAT|O_EXCL, 0660 )) < 0 ) {
|
||||
syslog( LOG_ERR, "lp_open %s: %m", name );
|
||||
@@ -303,17 +337,19 @@
|
||||
@@ -303,17 +337,19 @@ lp_open( out )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
lp_write( buf, len )
|
||||
char *buf;
|
||||
int len;
|
||||
@@ -329,13 +365,14 @@
|
||||
@@ -329,13 +365,14 @@ lp_write( buf, len )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
}
|
||||
|
||||
if ( lp.lp_flags & LP_OPEN ) {
|
||||
@@ -343,13 +380,13 @@
|
||||
@@ -343,13 +380,13 @@ lp_cancel()
|
||||
}
|
||||
|
||||
for ( letter = 'A'; letter < lp.lp_letter; letter++ ) {
|
||||
@ -210,7 +210,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -358,6 +395,7 @@
|
||||
@@ -358,6 +395,7 @@ lp_cancel()
|
||||
*
|
||||
* XXX piped?
|
||||
*/
|
||||
@ -218,7 +218,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
lp_print()
|
||||
{
|
||||
char buf[ MAXPATHLEN ];
|
||||
@@ -368,19 +406,19 @@
|
||||
@@ -368,19 +406,19 @@ lp_print()
|
||||
FILE *cfile;
|
||||
|
||||
if (( lp.lp_flags & LP_INIT ) == 0 || lp.lp_letter == 'A' ) {
|
||||
@ -242,7 +242,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
}
|
||||
fprintf( cfile, "H%s\n", hostname ); /* XXX lp_host? */
|
||||
|
||||
@@ -418,60 +456,63 @@
|
||||
@@ -418,46 +456,48 @@ lp_print()
|
||||
}
|
||||
fclose( cfile );
|
||||
|
||||
@ -299,10 +299,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
lp_conn_unix()
|
||||
{
|
||||
int s;
|
||||
struct sockaddr_un saun;
|
||||
+ size_t len;
|
||||
|
||||
if (( s = socket( AF_UNIX, SOCK_STREAM, 0 )) < 0 ) {
|
||||
@@ -467,11 +507,11 @@ lp_conn_unix()
|
||||
syslog( LOG_ERR, "lp_conn_unix socket: %m" );
|
||||
return( -1 );
|
||||
}
|
||||
@ -317,7 +314,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
syslog( LOG_ERR, "lp_conn_unix connect %s: %m", saun.sun_path );
|
||||
close( s );
|
||||
return( -1 );
|
||||
@@ -480,11 +521,13 @@
|
||||
@@ -480,11 +520,13 @@ lp_conn_unix()
|
||||
return( s );
|
||||
}
|
||||
|
||||
@ -331,7 +328,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
lp_conn_inet()
|
||||
{
|
||||
int privfd, port = IPPORT_RESERVED - 1;
|
||||
@@ -513,10 +556,10 @@
|
||||
@@ -513,10 +555,10 @@ lp_conn_inet()
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -344,7 +341,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
sin.sin_port = sp->s_port;
|
||||
|
||||
if ( connect( privfd, (struct sockaddr *)&sin,
|
||||
@@ -529,6 +572,7 @@
|
||||
@@ -529,6 +571,7 @@ lp_conn_inet()
|
||||
return( privfd );
|
||||
}
|
||||
|
||||
@ -352,7 +349,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
lp_rmjob( job )
|
||||
int job;
|
||||
{
|
||||
@@ -544,7 +588,7 @@
|
||||
@@ -544,7 +587,7 @@ lp_rmjob( job )
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -361,7 +358,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
n = strlen( buf );
|
||||
if ( write( s, buf, n ) != n ) {
|
||||
syslog( LOG_ERR, "lp_rmjob write: %m" );
|
||||
@@ -569,6 +613,7 @@
|
||||
@@ -569,6 +612,7 @@ char *tag_files = "files: ";
|
||||
char *tag_size = "size: ";
|
||||
char *tag_status = "status: ";
|
||||
|
||||
@ -369,7 +366,7 @@ $OpenBSD: patch-etcpapd-lpc,v 1.2 2000/06/12 17:27:33 espie Exp $
|
||||
lp_queue( out )
|
||||
struct papfile *out;
|
||||
{
|
||||
@@ -581,7 +626,7 @@
|
||||
@@ -581,7 +625,7 @@ lp_queue( out )
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-version,v 1.2 2001/03/19 13:51:21 wilfried Exp $
|
||||
$OpenBSD: patch-version,v 1.3 2001/04/18 13:17:44 brad Exp $
|
||||
--- VERSION.orig Sun Jan 31 09:49:05 1999
|
||||
+++ VERSION Thu Mar 15 19:34:56 2001
|
||||
+++ VERSION Wed Apr 18 14:04:32 2001
|
||||
@@ -1 +1 @@
|
||||
-990130
|
||||
+990130-OpenBSD-1.1
|
||||
+990130-OpenBSD-1.1.2
|
||||
|
Loading…
x
Reference in New Issue
Block a user