svn commit: r362490 - head/sys/fs/nfs

2020-06-22 Thread Doug Rabson
Author: dfr
Date: Mon Jun 22 08:23:16 2020
New Revision: 362490
URL: https://svnweb.freebsd.org/changeset/base/362490

Log:
  Add some missing parts for supporting va_birthtime.
  
  Reviewed by:  rmacklem

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfs/nfsport.h
  head/sys/fs/nfs/nfsproto.h

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cMon Jun 22 08:12:21 2020
(r362489)
+++ head/sys/fs/nfs/nfs_commonsubs.cMon Jun 22 08:23:16 2020
(r362490)
@@ -594,6 +594,8 @@ nfscl_fillsattr(struct nfsrv_descript *nd, struct vatt
NFSSETBIT_ATTRBIT(, NFSATTRBIT_TIMEACCESSSET);
if (vap->va_mtime.tv_sec != VNOVAL)
NFSSETBIT_ATTRBIT(, NFSATTRBIT_TIMEMODIFYSET);
+   if (vap->va_birthtime.tv_sec != VNOVAL)
+   NFSSETBIT_ATTRBIT(, NFSATTRBIT_TIMECREATE);
(void) nfsv4_fillattr(nd, vp->v_mount, vp, NULL, vap, NULL, 0,
, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL);
break;
@@ -2043,8 +2045,15 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
break;
case NFSATTRBIT_TIMECREATE:
NFSM_DISSECT(tl, u_int32_t *, NFSX_V4TIME);
-   if (compare && !(*retcmpp))
-   *retcmpp = NFSERR_ATTRNOTSUPP;
+   fxdr_nfsv4time(tl, );
+   if (compare) {
+   if (!(*retcmpp)) {
+   if (!NFS_CMPTIME(temptime, nap->na_btime))
+   *retcmpp = NFSERR_NOTSAME;
+   }
+   } else if (nap != NULL) {
+   nap->na_btime = temptime;
+   }
attrsum += NFSX_V4TIME;
break;
case NFSATTRBIT_TIMEDELTA:

Modified: head/sys/fs/nfs/nfsport.h
==
--- head/sys/fs/nfs/nfsport.h   Mon Jun 22 08:12:21 2020(r362489)
+++ head/sys/fs/nfs/nfsport.h   Mon Jun 22 08:23:16 2020(r362490)
@@ -649,6 +649,7 @@ struct nfsvattr {
 #definena_atimena_vattr.va_atime
 #definena_mtimena_vattr.va_mtime
 #definena_ctimena_vattr.va_ctime
+#definena_btimena_vattr.va_birthtime
 #definena_gen  na_vattr.va_gen
 #definena_flagsna_vattr.va_flags
 #definena_rdev na_vattr.va_rdev

Modified: head/sys/fs/nfs/nfsproto.h
==
--- head/sys/fs/nfs/nfsproto.h  Mon Jun 22 08:12:21 2020(r362489)
+++ head/sys/fs/nfs/nfsproto.h  Mon Jun 22 08:23:16 2020(r362490)
@@ -1127,6 +1127,7 @@ struct nfsv3_sattr {
NFSATTRBM_SPACETOTAL |  \
NFSATTRBM_SPACEUSED |   \
NFSATTRBM_TIMEACCESS |  \
+   NFSATTRBM_TIMECREATE |  \
NFSATTRBM_TIMEDELTA |   \
NFSATTRBM_TIMEMETADATA |\
NFSATTRBM_TIMEMODIFY |  \
@@ -1176,6 +1177,7 @@ struct nfsv3_sattr {
(NFSATTRBM_MODE |   \
NFSATTRBM_OWNER |   \
NFSATTRBM_OWNERGROUP |  \
+   NFSATTRBM_TIMECREATE |  \
NFSATTRBM_TIMEACCESSSET |   \
NFSATTRBM_TIMEMODIFYSET)
 #defineNFSATTRBIT_SETABLE2 
\
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362175 - head/sys/fs/nfs

2020-06-14 Thread Doug Rabson
Author: dfr
Date: Sun Jun 14 11:41:57 2020
New Revision: 362175
URL: https://svnweb.freebsd.org/changeset/base/362175

Log:
  Add support for the timecreate attribute
  
  This maps to the va_birthtime VFS attribute.

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cSun Jun 14 10:13:40 2020
(r362174)
+++ head/sys/fs/nfs/nfs_commonsubs.cSun Jun 14 11:41:57 2020
(r362175)
@@ -2922,6 +2922,11 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount
txdr_nfsv4time(>va_mtime, tl);
retnum += NFSX_V4TIME;
break;
+   case NFSATTRBIT_TIMECREATE:
+   NFSM_BUILD(tl, u_int32_t *, NFSX_V4TIME);
+   txdr_nfsv4time(>va_birthtime, tl);
+   retnum += NFSX_V4TIME;
+   break;
case NFSATTRBIT_TIMEMODIFYSET:
if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343706 - head/usr.sbin/rpc.statd

2019-02-03 Thread Doug Rabson
Author: dfr
Date: Sun Feb  3 08:15:26 2019
New Revision: 343706
URL: https://svnweb.freebsd.org/changeset/base/343706

Log:
  Reduce log spam from rpc.statd
  
  This only reports failed attempts to contact hosts on the first attempt.

Modified:
  head/usr.sbin/rpc.statd/file.c

Modified: head/usr.sbin/rpc.statd/file.c
==
--- head/usr.sbin/rpc.statd/file.c  Sun Feb  3 05:26:10 2019
(r343705)
+++ head/usr.sbin/rpc.statd/file.c  Sun Feb  3 08:15:26 2019
(r343706)
@@ -248,9 +248,12 @@ void init_file(const char *filename)
 /*
Purpose:Perform SM_NOTIFY procedure at specified host
Returns:TRUE if success, FALSE if failed.
+   Notes:  Only report failure if verbose is non-zero. Caller will
+   only set verbose to non-zero for the first attempt to
+   contact the host.
 */
 
-static int notify_one_host(char *hostname)
+static int notify_one_host(char *hostname, int verbose)
 {
   struct timeval timeout = { 20, 0 };  /* 20 secs timeout  */
   CLIENT *cli;
@@ -277,7 +280,8 @@ static int notify_one_host(char *hostname)
   (xdrproc_t)xdr_void, , timeout)
 != RPC_SUCCESS)
   {
-syslog(LOG_ERR, "Failed to contact rpc.statd at host %s", hostname);
+if (verbose)
+  syslog(LOG_ERR, "Failed to contact rpc.statd at host %s", hostname);
 clnt_destroy(cli);
 return (FALSE);
   }
@@ -346,7 +350,7 @@ void notify_hosts(void)
 {
   if (hp->notifyReqd)
   {
-if (notify_one_host(hp->hostname))
+if (notify_one_host(hp->hostname, attempts == 0))
{
  hp->notifyReqd = FALSE;
   sync_file();
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317402 - head/lib/librpcsec_gss

2017-04-25 Thread Doug Rabson
Author: dfr
Date: Tue Apr 25 10:29:08 2017
New Revision: 317402
URL: https://svnweb.freebsd.org/changeset/base/317402

Log:
  Fix a potential problem where we might try to shift by more than 31 bits
  
  CID:1198859

Modified:
  head/lib/librpcsec_gss/svc_rpcsec_gss.c

Modified: head/lib/librpcsec_gss/svc_rpcsec_gss.c
==
--- head/lib/librpcsec_gss/svc_rpcsec_gss.c Tue Apr 25 09:08:44 2017
(r317401)
+++ head/lib/librpcsec_gss/svc_rpcsec_gss.c Tue Apr 25 10:29:08 2017
(r317402)
@@ -913,7 +913,9 @@ svc_rpc_gss_update_seq(struct svc_rpc_gs
 {
int offset, i, word, bit;
uint32_t carry, newcarry;
+   uint32_t* maskp;
 
+   maskp = client->cl_seqmask;
if (seq > client->cl_seqlast) {
/*
 * This request has a sequence number greater
@@ -923,28 +925,29 @@ svc_rpc_gss_update_seq(struct svc_rpc_gs
 * number)
 */
offset = seq - client->cl_seqlast;
-   while (offset > 32) {
+   while (offset >= 32) {
for (i = (SVC_RPC_GSS_SEQWINDOW / 32) - 1;
 i > 0; i--) {
-   client->cl_seqmask[i] = client->cl_seqmask[i-1];
+   maskp[i] = maskp[i-1];
}
-   client->cl_seqmask[0] = 0;
+   maskp[0] = 0;
offset -= 32;
}
-   carry = 0;
-   for (i = 0; i < SVC_RPC_GSS_SEQWINDOW / 32; i++) {
-   newcarry = client->cl_seqmask[i] >> (32 - offset);
-   client->cl_seqmask[i] =
-   (client->cl_seqmask[i] << offset) | carry;
-   carry = newcarry;
+   if (offset > 0) {
+   carry = 0;
+   for (i = 0; i < SVC_RPC_GSS_SEQWINDOW / 32; i++) {
+   newcarry = maskp[i] >> (32 - offset);
+   maskp[i] = (maskp[i] << offset) | carry;
+   carry = newcarry;
+   }
}
-   client->cl_seqmask[0] |= 1;
+   maskp[0] |= 1;
client->cl_seqlast = seq;
} else {
offset = client->cl_seqlast - seq;
word = offset / 32;
bit = offset % 32;
-   client->cl_seqmask[word] |= (1 << bit);
+   maskp[word] |= (1 << bit);
}
 
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r293168 - head/lib/libgssapi

2016-01-04 Thread Doug Rabson
Author: dfr
Date: Mon Jan  4 17:42:12 2016
New Revision: 293168
URL: https://svnweb.freebsd.org/changeset/base/293168

Log:
  Fix a memory leak in gss_release_oid_set

Modified:
  head/lib/libgssapi/gss_release_oid_set.c

Modified: head/lib/libgssapi/gss_release_oid_set.c
==
--- head/lib/libgssapi/gss_release_oid_set.cMon Jan  4 17:25:32 2016
(r293167)
+++ head/lib/libgssapi/gss_release_oid_set.cMon Jan  4 17:42:12 2016
(r293168)
@@ -32,15 +32,25 @@
 
 OM_uint32
 gss_release_oid_set(OM_uint32 *minor_status,
-gss_OID_set *set)
+gss_OID_set *setp)
 {
+   gss_OID_set set;
+   gss_OID o;
+   size_t i;
 
*minor_status = 0;
-   if (set && *set) {
-   if ((*set)->elements)
-   free((*set)->elements);
-   free(*set);
-   *set = GSS_C_NO_OID_SET;
+   if (setp) {
+   set = *setp;
+   if (set) {
+   for (i = 0; i < set->count; i++) {
+   o = >elements[i];
+   if (o->elements)
+   free(o->elements);
+   }
+   free(set->elements);
+   free(set);
+   *setp = GSS_C_NO_OID_SET;
+   }
}
return (GSS_S_COMPLETE);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r259914 - head/usr.bin/rpcgen

2013-12-26 Thread Doug Rabson
Author: dfr
Date: Thu Dec 26 11:38:33 2013
New Revision: 259914
URL: http://svnweb.freebsd.org/changeset/base/259914

Log:
  Generate client sample code which compiles without warnings.
  For 'rpcgen -a', generate a makefile where 'make clean all' works.

Modified:
  head/usr.bin/rpcgen/rpc_main.c

Modified: head/usr.bin/rpcgen/rpc_main.c
==
--- head/usr.bin/rpcgen/rpc_main.c  Thu Dec 26 11:32:39 2013
(r259913)
+++ head/usr.bin/rpcgen/rpc_main.c  Thu Dec 26 11:38:33 2013
(r259914)
@@ -776,6 +776,8 @@ clnt_output(const char *infile, const ch
free(include);
} else
f_print(fout, #include rpc/rpc.h\n);
+   f_print(fout, #include stdio.h\n);
+   f_print(fout, #include stdlib.h\n);
tell = ftell(fout);
while ( (def = get_definition()) ) {
has_program += write_sample_clnt(def);
@@ -863,6 +865,10 @@ $(TARGETS_SVC.c:%%.c=%%.o) );
f_print(fout, all : $(CLIENT) $(SERVER)\n\n);
f_print(fout, $(TARGETS) : $(SOURCES.x) \n);
f_print(fout, \trpcgen $(RPCGENFLAGS) $(SOURCES.x)\n\n);
+   if (allfiles) {
+   f_print(fout, \trpcgen -Sc $(RPCGENFLAGS) $(SOURCES.x) -o 
%s\n\n, clientname);
+   f_print(fout, \trpcgen -Ss $(RPCGENFLAGS) $(SOURCES.x) -o 
%s\n\n, servername);
+   }
f_print(fout, $(OBJECTS_CLNT) : $(SOURCES_CLNT.c) $(SOURCES_CLNT.h) \
 $(TARGETS_CLNT.c) \n\n);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r239058 - in head/sys/boot: common userboot userboot/test userboot/userboot

2012-08-05 Thread Doug Rabson
If you change the loader callbacks structure, you need to change the version 
number to avoid unexpected results for mismatched combinations of application 
and userboot.so.


On 5 Aug 2012, at 13:15, Andrey V. Elsukov wrote:

 Author: ae
 Date: Sun Aug  5 12:15:15 2012
 New Revision: 239058
 URL: http://svn.freebsd.org/changeset/base/239058
 
 Log:
  Introduce new API to work with disks from the loader's drivers.
  It uses new API from the part.c to work with partition tables.
 
  Update userboot's disk driver to use new API. Note that struct
  loader_callbacks_v1 has changed.
 
 Modified:
  head/sys/boot/common/Makefile.inc
  head/sys/boot/common/disk.c
  head/sys/boot/common/disk.h
  head/sys/boot/userboot/test/test.c
  head/sys/boot/userboot/userboot.h
  head/sys/boot/userboot/userboot/Makefile
  head/sys/boot/userboot/userboot/devicename.c
  head/sys/boot/userboot/userboot/userboot_disk.c
 
 Modified: head/sys/boot/common/Makefile.inc
 ==
 --- head/sys/boot/common/Makefile.inc Sun Aug  5 11:59:46 2012
 (r239057)
 +++ head/sys/boot/common/Makefile.inc Sun Aug  5 12:15:15 2012
 (r239058)
 @@ -1,6 +1,6 @@
 # $FreeBSD$
 
 -SRCS+=   boot.c commands.c console.c devopen.c disk.c interp.c 
 +SRCS+=   boot.c commands.c console.c devopen.c interp.c 
 SRCS+=interp_backslash.c interp_parse.c ls.c misc.c 
 SRCS+=module.c panic.c
 
 @@ -24,6 +24,18 @@ SRCS+= load_elf64.c reloc_elf64.c
 SRCS+=dev_net.c
 .endif
 
 +.if !defined(LOADER_NO_DISK_SUPPORT)
 +SRCS+=   disk.c part.c
 +CFLAGS+= -DLOADER_DISK_SUPPORT
 +.if !defined(LOADER_NO_GPT_SUPPORT)
 +SRCS+=   crc32.c
 +CFLAGS+= -DLOADER_GPT_SUPPORT
 +.endif
 +.if !defined(LOADER_NO_MBR_SUPPORT)
 +CFLAGS+= -DLOADER_MBR_SUPPORT
 +.endif
 +.endif
 +
 .if defined(HAVE_BCACHE)
 SRCS+=  bcache.c
 .endif
 
 Modified: head/sys/boot/common/disk.c
 ==
 --- head/sys/boot/common/disk.c   Sun Aug  5 11:59:46 2012
 (r239057)
 +++ head/sys/boot/common/disk.c   Sun Aug  5 12:15:15 2012
 (r239058)
 @@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 1998 Michael Smith msm...@freebsd.org
 + * Copyright (c) 2012 Andrey V. Elsukov a...@freebsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 @@ -27,26 +28,11 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
 -/*
 - * MBR/GPT partitioned disk device handling.
 - *
 - * Ideas and algorithms from:
 - *
 - * - NetBSD libi386/biosdisk.c
 - * - FreeBSD biosboot/disk.c
 - *
 - */
 -
 +#include sys/disk.h
 #include stand.h
 -
 -#include sys/diskmbr.h
 -#include sys/disklabel.h
 -#include sys/gpt.h
 -
 #include stdarg.h
 -#include uuid.h
 -
 #include bootstrap.h
 +#include part.h
 
 #include disk.h
 
 @@ -56,53 +42,26 @@ __FBSDID($FreeBSD$);
 # define DEBUG(fmt, args...)
 #endif
 
 -/*
 - * Search for a slice with the following preferences:
 - *
 - * 1: Active FreeBSD slice
 - * 2: Non-active FreeBSD slice
 - * 3: Active Linux slice
 - * 4: non-active Linux slice
 - * 5: Active FAT/FAT32 slice
 - * 6: non-active FAT/FAT32 slice
 - */
 -#define PREF_RAWDISK 0
 -#define PREF_FBSD_ACT1
 -#define PREF_FBSD2
 -#define PREF_LINUX_ACT   3
 -#define PREF_LINUX   4
 -#define PREF_DOS_ACT 5
 -#define PREF_DOS 6
 -#define PREF_NONE7
 -
 -#ifdef LOADER_GPT_SUPPORT
 -
 -struct gpt_part {
 - int gp_index;
 - uuid_t  gp_type;
 - uint64_tgp_start;
 - uint64_tgp_end;
 +struct open_disk {
 + struct ptable   *table;
 + off_t   mediasize;
 + u_int   sectorsize;
 };
 
 -static uuid_t efi = GPT_ENT_TYPE_EFI;
 -static uuid_t freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT;
 -static uuid_t freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
 -static uuid_t freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP;
 -static uuid_t freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
 -static uuid_t ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA;
 -
 -#endif
 -
 -#if defined(LOADER_GPT_SUPPORT) || defined(LOADER_MBR_SUPPORT)
 +struct print_args {
 + struct disk_devdesc *dev;
 + const char  *prefix;
 + int verbose;
 +};
 
 -/* Given a size in 512 byte sectors, convert it to a human-readable number. 
 */
 +/* Convert size to a human-readable number. */
 static char *
 -display_size(uint64_t size)
 +display_size(uint64_t size, u_int sectorsize)
 {
   static char buf[80];
   char unit;
 
 - size /= 2;
 + size = size * sectorsize / 1024;
   unit = 'K';
   if (size = 1048576LL) {
   size /= 1073741824;
 @@ -114,687 +73,230 @@ display_size(uint64_t size)
   size /= 1024;
   unit = 'M';
   }
 - sprintf(buf, %.6ld%cB, (long)size, unit);
 + sprintf(buf, %ld%cB, (long)size, unit);
   return (buf);
 }
 
 -#endif
 

svn commit: r239061 - head/include/gssapi

2012-08-05 Thread Doug Rabson
Author: dfr
Date: Sun Aug  5 13:38:15 2012
New Revision: 239061
URL: http://svn.freebsd.org/changeset/base/239061

Log:
  Reduce namespace pollution from gssapi.h
  
  MFC after:2 weeks

Modified:
  head/include/gssapi/gssapi.h

Modified: head/include/gssapi/gssapi.h
==
--- head/include/gssapi/gssapi.hSun Aug  5 12:57:38 2012
(r239060)
+++ head/include/gssapi/gssapi.hSun Aug  5 13:38:15 2012
(r239061)
@@ -31,15 +31,13 @@
 #ifndef _GSSAPI_GSSAPI_H_
 #define _GSSAPI_GSSAPI_H_
 
-/*
- * First, include stddef.h to get size_t defined.
- */
-#include stddef.h
+#include sys/cdefs.h
+#include sys/_types.h
 
-/*
- * Include stdint.h to get explicitly sized data types.
- */
-#include stdint.h
+#ifndef _SIZE_T_DECLARED
+typedef__size_tsize_t;
+#define_SIZE_T_DECLARED
+#endif
 
 #ifndef _SSIZE_T_DECLARED
 typedef__ssize_t   ssize_t;
@@ -67,7 +65,7 @@ typedef struct _gss_name_t *gss_name_t;
  * unsigned integer supported by the platform that has at least
  * 32 bits of precision.
  */
-typedef uint32_t gss_uint32;
+typedef __uint32_t gss_uint32;
 
 
 #ifdef OM_STRING
@@ -89,7 +87,7 @@ typedef OM_object_identifier gss_OID_des
  */
 
 typedef gss_uint32 OM_uint32;
-typedef uint64_t OM_uint64;
+typedef __uint64_t OM_uint64;
 
 typedef struct gss_OID_desc_struct {
   OM_uint32 length;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r239062 - head/lib/libpam/modules/pam_krb5

2012-08-05 Thread Doug Rabson
Author: dfr
Date: Sun Aug  5 13:40:35 2012
New Revision: 239062
URL: http://svn.freebsd.org/changeset/base/239062

Log:
  Add an option for pam_krb5 to allow it to authenticate users which don't have
  a local account.
  
  PR:   76678
  Submitted by: daved at tamu.edu
  MFC after:2 weeks

Modified:
  head/lib/libpam/modules/pam_krb5/pam_krb5.c

Modified: head/lib/libpam/modules/pam_krb5/pam_krb5.c
==
--- head/lib/libpam/modules/pam_krb5/pam_krb5.c Sun Aug  5 13:38:15 2012
(r239061)
+++ head/lib/libpam/modules/pam_krb5/pam_krb5.c Sun Aug  5 13:40:35 2012
(r239062)
@@ -91,6 +91,7 @@ static void   compat_free_data_contents(kr
 #define PAM_OPT_NO_CCACHE  no_ccache
 #define PAM_OPT_NO_USER_CHECK  no_user_check
 #define PAM_OPT_REUSE_CCACHE   reuse_ccache
+#define PAM_OPT_NO_USER_CHECK  no_user_check
 
 #definePAM_LOG_KRB5_ERR(ctx, rv, fmt, ...) 
\
do {\
@@ -218,10 +219,12 @@ pam_sm_authenticate(pam_handle_t *pamh, 
PAM_LOG(PAM_USER Redone);
}
 
-   pwd = getpwnam(user);
-   if (pwd == NULL) {
-   retval = PAM_USER_UNKNOWN;
-   goto cleanup2;
+   if (!openpam_get_option(pamh, PAM_OPT_NO_USER_CHECK)) {
+   pwd = getpwnam(user);
+   if (pwd == NULL) {
+   retval = PAM_USER_UNKNOWN;
+   goto cleanup2;
+   }
}
 
PAM_LOG(Done getpwnam());
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r210650 - head/sys/boot/zfs

2010-07-30 Thread Doug Rabson
Author: dfr
Date: Fri Jul 30 13:54:15 2010
New Revision: 210650
URL: http://svn.freebsd.org/changeset/base/210650

Log:
  A simple test harness to help debug problems with the ZFS boot code.

Added:
  head/sys/boot/zfs/zfstest.c   (contents, props changed)

Added: head/sys/boot/zfs/zfstest.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/zfs/zfstest.c Fri Jul 30 13:54:15 2010(r210650)
@@ -0,0 +1,120 @@
+/*-
+ * Copyright (c) 2010 Doug Rabson
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/* $FreeBSD$ */
+/*
+ * Compile with 'cc -I. -I../../cddl/boot/zfs zfstest.c -o zfstest'
+ */
+
+#include sys/param.h
+#include sys/queue.h
+#include fcntl.h
+#include stdint.h
+#include stdio.h
+#include string.h
+#include stdarg.h
+#include stddef.h
+#include stdlib.h
+#include errno.h
+
+#define NBBY 8
+
+void
+pager_output(const char *line)
+{
+   printf(%s, line);
+}
+
+#include zfsimpl.c
+
+static int
+vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes)
+{
+   int fd = *(int *) priv;
+
+   if (pread(fd, buf, bytes, off) != bytes)
+   return -1;
+   return 0;
+}
+
+static int
+zfs_read(spa_t *spa, dnode_phys_t *dn, void *buf, size_t size, off_t off)
+{
+   const znode_phys_t *zp = (const znode_phys_t *) dn-dn_bonus;
+   size_t n;
+   int rc;
+
+   n = size;
+   if (off + n  zp-zp_size)
+   n = zp-zp_size - off;
+   
+   rc = dnode_read(spa, dn, off, buf, n);
+   if (rc)
+   return (rc);
+
+   return (n);
+}
+
+int
+main(int argc, char** argv)
+{
+   int i, n, off;
+   int fd[99];
+   spa_t *spa;
+   dnode_phys_t dn;
+   char buf[512];
+
+   zfs_init();
+   if (argc == 1) {
+   static char *av[] = {
+   zfstest, /dev/da0p2, /dev/da1p2, /dev/da2p2,
+   NULL,
+   };
+   argc = 4;
+   argv = av;
+   }
+   for (i = 1; i  argc; i++) {
+   fd[i] = open(argv[i], O_RDONLY);
+   if (fd[i]  0)
+   continue;
+   if (vdev_probe(vdev_read, fd[i], NULL) != 0)
+   close(fd[i]);
+   }
+   spa_all_status();
+
+   spa = STAILQ_FIRST(zfs_pools);
+   if (!spa || zfs_mount_pool(spa))
+   exit(1);
+
+   if (zfs_lookup(spa, zfs.c, dn))
+   exit(1);
+
+   off = 0;
+   do {
+   n = zfs_read(spa, dn, buf, 512, off);
+   write(1, buf, n);
+   off += n;
+   } while (n == 512);
+}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org