]> arthur.barton.de Git - netatalk.git/commitdiff
Tru64 fixes from Burkhard Schmidt <bs@cpfs.mpg.de>
authorrufustfirefly <rufustfirefly>
Thu, 3 May 2001 13:57:44 +0000 (13:57 +0000)
committerrufustfirefly <rufustfirefly>
Thu, 3 May 2001 13:57:44 +0000 (13:57 +0000)
etc/afpd/main.c
etc/afpd/quota.c
etc/afpd/unix.h
etc/uams/uams_passwd.c

index 7f273c23abdd84f769f0579c452bff565ba57b5f..603d663f699288b4ca793c46969eaa49b079e32c 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: main.c,v 1.5 2001-05-03 13:57:44 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
@@ -126,6 +128,10 @@ int main( ac, av )
     struct sigaction   sv;
     sigset_t            sigs;
 
+#ifdef DIGITAL_UNIX_SECURITY
+       set_auth_parameters( ac, av );
+#endif /* DIGITAL_UNIX_SECURITY */
+
     umask( 0 );                /* so inherited file permissions work right */
 
     afp_options_init(&default_options);
index 6a68d6a29f87265dc06f236c697463ec1bc08c3c..522fff9fc53bcbbd6ade8d20e0ebad789b1bf29d 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: quota.c,v 1.4 2001-05-03 13:57:44 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
@@ -199,11 +201,13 @@ static int getfsquota(vol, uid, dq)
 #define QCMD(a,b)  (a)
 #endif
 
+#ifndef TRU64
     /* for group quotas. we only use these if the user belongs
      * to one group. */
     struct dqblk        dqg;
 
     memset(&dqg, 0, sizeof(dqg));
+#endif /* TRU64 */
 
 #ifdef BSD4_4
     if ( quotactl( vol->v_gvs, QCMD(Q_GETQUOTA,USRQUOTA), 
@@ -215,6 +219,15 @@ static int getfsquota(vol, uid, dq)
       quotactl(vol->v_gvs, QCMD(Q_GETQUOTA, GRPQUOTA),
                   groups[0], (char *) &dqg);
       
+#elif defined(TRU64)
+       if ( seteuid( getuid() ) == 0 ) {
+               if ( quotactl( vol->v_path, QCMD(Q_GETQUOTA, USRQUOTA),
+                               uid, (char *)dq ) != 0 ) {
+                       seteuid( uid );
+                       return ( AFPERR_PARAM );
+               }
+       }
+
 #else /* BSD4_4 */
     if ( quotactl(QCMD(Q_GETQUOTA, USRQUOTA), vol->v_gvs, uid,
                  (caddr_t) dq ) != 0 ) {
@@ -226,6 +239,7 @@ static int getfsquota(vol, uid, dq)
               groups[0], (char *) &dqg);
 #endif  /* BSD4_4 */
 
+#ifndef TRU64
     /* set stuff up for group quotas if necessary */
 
     /* max(user blocks, group blocks) */
@@ -247,6 +261,8 @@ static int getfsquota(vol, uid, dq)
         (dq->dqb_btimelimit > dqg.dqb_btimelimit)))
       dq->dqb_btimelimit = dqg.dqb_btimelimit;
 
+#endif /* TRU64 */
+
 #endif /* ultrix */
 #endif /* __svr4__ */
 
index f6b299457bf44fba07dac9266c73c58db109d22c..0f6771087b7abf245639e7448d3102425a07fb27 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * $Id: unix.h,v 1.3 2001-05-03 13:57:44 rufustfirefly Exp $
+ */
+
 #ifndef AFPD_UNIX_H
 #define AFPD_UNIX_H
 
@@ -35,8 +39,12 @@ typedef int  mode_t;
 #include <sys/statvfs.h>
 #define statfs statvfs
 #else
+#if defined(TRU64)
+#define f_frsize f_fsize
+#else /* TRU64 */
 #define        f_frsize f_bsize
-#endif
+#endif /* TRU64 */
+#endif /* USE_STATVFS_H */
 
 #if defined(__svr4__) || defined(USE_MNTTAB_H)
 #include <sys/mnttab.h>
index 83cf7d1b7cbb4b4f68e675cae1265e3bba61574f..ea8fb53131f423e231e7b65b3778533fdc4012da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_passwd.c,v 1.6 2001-02-27 17:07:43 rufustfirefly Exp $
+ * $Id: uams_passwd.c,v 1.7 2001-05-03 13:57:44 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
 
 #define PASSWDLEN 8
 
+#ifdef DIGITAL_UNIX_SECURITY
+#include <sys/types.h>
+#include <sys/security.h>
+#include <prot.h>
+#endif /* DIGITAL_UNIX_SECURITY */
+
 /* cleartxt login */
 static int passwd_login(void *obj, struct passwd **uam_pwd,
                        char *ibuf, int ibuflen,
@@ -41,9 +47,13 @@ static int passwd_login(void *obj, struct passwd **uam_pwd,
     struct passwd *pwd;
 #ifdef SHADOWPW
     struct spwd *sp;
-#endif
+#endif /* SHADOWPW */
     char *username, *p;
     int len, ulen;
+#ifdef DIGITAL_UNIX_SECURITY
+       char *bigcrypt();
+       struct pr_passwd *pr;
+#endif /* DIGITAL_UNIX_SECURITY */
 
     *rbuflen = 0;
 
@@ -84,9 +94,18 @@ static int passwd_login(void *obj, struct passwd **uam_pwd,
 
     *uam_pwd = pwd;
 
+#ifdef DIGITAL_UNIX_SECURITY
+       pr = getprpwnam( username );
+       if ( pr == NULL )
+               return AFPERR_NOTAUTH;
+       if ( strcmp ( bigcrypt ( ibuf, pr->ufld.fd_encrypt ),
+               pr->ufld.fd_encrypt == 0 )
+      return AFP_OK;
+#else /* DIGITAL_UNIX_SECURITY */
     p = crypt( ibuf, pwd->pw_passwd );
     if ( strcmp( p, pwd->pw_passwd ) == 0 ) 
       return AFP_OK;
+#endif /* DIGITAL_UNIX_SECURITY */
 
     return AFPERR_NOTAUTH;
 }