PERFORCE change 32188 for review
Peter Wemm
peter at FreeBSD.org
Sat May 31 11:45:16 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=32188
Change 32188 by peter at peter_daintree on 2003/05/31 11:45:06
IFC @32187
Affected files ...
.. //depot/projects/hammer/games/fortune/datfiles/fortunes#8 integrate
.. //depot/projects/hammer/lib/libpam/libpam/security/pam_mod_misc.h#4 integrate
.. //depot/projects/hammer/lib/libpam/modules/modules.inc#9 integrate
.. //depot/projects/hammer/lib/libpam/modules/pam_guest/Makefile#1 branch
.. //depot/projects/hammer/lib/libpam/modules/pam_guest/pam_guest.8#1 branch
.. //depot/projects/hammer/lib/libpam/modules/pam_guest/pam_guest.c#1 branch
.. //depot/projects/hammer/lib/libpam/modules/pam_krb5/pam_krb5.c#4 integrate
.. //depot/projects/hammer/lib/libpam/modules/pam_opie/pam_opie.c#2 integrate
.. //depot/projects/hammer/lib/libpam/modules/pam_radius/pam_radius.c#3 integrate
.. //depot/projects/hammer/lib/libpam/modules/pam_tacplus/pam_tacplus.c#2 integrate
.. //depot/projects/hammer/lib/libpam/modules/pam_unix/pam_unix.c#4 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_cond.c#6 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_mutex.c#7 integrate
.. //depot/projects/hammer/libexec/rtld-elf/libmap.c#7 integrate
.. //depot/projects/hammer/libexec/rtld-elf/map_object.c#6 integrate
.. //depot/projects/hammer/libexec/rtld-elf/rtld.1#5 integrate
.. //depot/projects/hammer/libexec/rtld-elf/rtld.c#9 integrate
.. //depot/projects/hammer/sbin/bsdlabel/bsdlabel.c#7 integrate
.. //depot/projects/hammer/share/man/man9/VFS_CHECKEXP.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VFS_FHTOVP.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VFS_MOUNT.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VFS_ROOT.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VFS_START.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VFS_STATFS.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VFS_SYNC.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VFS_UNMOUNT.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VFS_VGET.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VFS_VPTOFH.9#2 integrate
.. //depot/projects/hammer/share/man/man9/VOP_ACCESS.9#4 integrate
.. //depot/projects/hammer/share/man/man9/VOP_ACLCHECK.9#4 integrate
.. //depot/projects/hammer/share/man/man9/VOP_ADVLOCK.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VOP_BWRITE.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VOP_CREATE.9#4 integrate
.. //depot/projects/hammer/share/man/man9/VOP_FSYNC.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VOP_GETEXTATTR.9#4 integrate
.. //depot/projects/hammer/share/man/man9/VOP_GETPAGES.9#2 integrate
.. //depot/projects/hammer/share/man/man9/VOP_INACTIVE.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VOP_IOCTL.9#4 integrate
.. //depot/projects/hammer/share/man/man9/VOP_LINK.9#4 integrate
.. //depot/projects/hammer/share/man/man9/VOP_LOCK.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VOP_LOOKUP.9#4 integrate
.. //depot/projects/hammer/share/man/man9/VOP_OPENCLOSE.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VOP_PATHCONF.9#2 integrate
.. //depot/projects/hammer/share/man/man9/VOP_PRINT.9#2 integrate
.. //depot/projects/hammer/share/man/man9/VOP_RDWR.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VOP_READDIR.9#4 integrate
.. //depot/projects/hammer/share/man/man9/VOP_READLINK.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VOP_REALLOCBLKS.9#2 integrate
.. //depot/projects/hammer/share/man/man9/VOP_REMOVE.9#3 integrate
.. //depot/projects/hammer/share/man/man9/VOP_RENAME.9#4 integrate
.. //depot/projects/hammer/share/man/man9/VOP_STRATEGY.9#3 integrate
.. //depot/projects/hammer/share/man/man9/atomic.9#2 integrate
.. //depot/projects/hammer/share/man/man9/devclass.9#2 integrate
.. //depot/projects/hammer/share/man/man9/devclass_find.9#2 integrate
.. //depot/projects/hammer/share/man/man9/device.9#2 integrate
.. //depot/projects/hammer/share/man/man9/kobj.9#2 integrate
.. //depot/projects/hammer/share/man/man9/ktr.9#3 integrate
.. //depot/projects/hammer/share/man/man9/make_dev.9#2 integrate
.. //depot/projects/hammer/share/man/man9/namei.9#3 integrate
.. //depot/projects/hammer/share/man/man9/rtalloc.9#2 integrate
.. //depot/projects/hammer/share/man/man9/sleep.9#4 integrate
.. //depot/projects/hammer/share/man/man9/vget.9#3 integrate
.. //depot/projects/hammer/share/man/man9/vnode.9#5 integrate
.. //depot/projects/hammer/share/man/man9/vput.9#2 integrate
.. //depot/projects/hammer/share/man/man9/vref.9#3 integrate
.. //depot/projects/hammer/share/man/man9/vrele.9#3 integrate
.. //depot/projects/hammer/share/man/man9/zone.9#4 integrate
.. //depot/projects/hammer/share/mk/bsd.sys.mk#7 integrate
.. //depot/projects/hammer/share/termcap/termcap.src#6 integrate
.. //depot/projects/hammer/sys/boot/forth/beastie.4th#2 integrate
.. //depot/projects/hammer/sys/cam/cam_periph.c#7 integrate
.. //depot/projects/hammer/sys/cam/scsi/scsi_all.c#6 integrate
.. //depot/projects/hammer/sys/cam/scsi/scsi_ch.c#5 integrate
.. //depot/projects/hammer/sys/cam/scsi/scsi_ch.h#2 integrate
.. //depot/projects/hammer/sys/conf/files.i386#13 integrate
.. //depot/projects/hammer/sys/conf/files.pc98#14 integrate
.. //depot/projects/hammer/sys/dev/exca/exca.c#4 integrate
.. //depot/projects/hammer/sys/dev/mcd/mcd.c#6 integrate
.. //depot/projects/hammer/sys/dev/md/md.c#13 integrate
.. //depot/projects/hammer/sys/dev/sio/sio.c#15 integrate
.. //depot/projects/hammer/sys/geom/bde/g_bde.c#7 integrate
.. //depot/projects/hammer/sys/geom/geom.h#16 integrate
.. //depot/projects/hammer/sys/geom/geom_aes.c#10 integrate
.. //depot/projects/hammer/sys/geom/geom_apple.c#5 integrate
.. //depot/projects/hammer/sys/geom/geom_bsd.c#17 integrate
.. //depot/projects/hammer/sys/geom/geom_dev.c#15 integrate
.. //depot/projects/hammer/sys/geom/geom_disk.c#14 integrate
.. //depot/projects/hammer/sys/geom/geom_gpt.c#13 integrate
.. //depot/projects/hammer/sys/geom/geom_mbr.c#12 integrate
.. //depot/projects/hammer/sys/geom/geom_mirror.c#5 integrate
.. //depot/projects/hammer/sys/geom/geom_pc98.c#14 integrate
.. //depot/projects/hammer/sys/geom/geom_subr.c#13 integrate
.. //depot/projects/hammer/sys/geom/geom_sunlabel.c#12 integrate
.. //depot/projects/hammer/sys/geom/geom_vol_ffs.c#5 integrate
.. //depot/projects/hammer/sys/i386/conf/NOTES#16 integrate
.. //depot/projects/hammer/sys/i386/isa/ctx.c#3 integrate
.. //depot/projects/hammer/sys/i4b/driver/i4b_trace.c#4 integrate
.. //depot/projects/hammer/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c#3 integrate
.. //depot/projects/hammer/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c#3 integrate
.. //depot/projects/hammer/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c#3 integrate
.. //depot/projects/hammer/sys/i4b/layer1/itjc/i4b_itjc_pci.c#6 integrate
.. //depot/projects/hammer/sys/i4b/layer2/i4b_l2fsm.c#3 integrate
.. //depot/projects/hammer/sys/isa/psm.c#5 integrate
.. //depot/projects/hammer/sys/kern/kern_uuid.c#4 integrate
.. //depot/projects/hammer/sys/kern/tty_pty.c#5 integrate
.. //depot/projects/hammer/sys/kern/vfs_bio.c#15 integrate
.. //depot/projects/hammer/sys/kern/vfs_cluster.c#9 integrate
.. //depot/projects/hammer/sys/modules/Makefile#18 integrate
.. //depot/projects/hammer/sys/modules/geom/Makefile#1 branch
.. //depot/projects/hammer/sys/modules/geom/geom_apple/Makefile#1 branch
.. //depot/projects/hammer/sys/modules/geom/geom_bde/Makefile#1 branch
.. //depot/projects/hammer/sys/modules/geom/geom_bsd/Makefile#1 branch
.. //depot/projects/hammer/sys/modules/geom/geom_gpt/Makefile#1 branch
.. //depot/projects/hammer/sys/modules/geom/geom_mbr/Makefile#1 branch
.. //depot/projects/hammer/sys/modules/geom/geom_pc98/Makefile#1 branch
.. //depot/projects/hammer/sys/modules/geom/geom_sunlabel/Makefile#1 branch
.. //depot/projects/hammer/sys/netinet/ip_output.c#13 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_bio.c#6 integrate
.. //depot/projects/hammer/sys/nfsserver/nfs_syscalls.c#5 integrate
.. //depot/projects/hammer/sys/pc98/conf/NOTES#6 integrate
.. //depot/projects/hammer/sys/sys/buf.h#5 integrate
.. //depot/projects/hammer/sys/sys/chio.h#2 integrate
.. //depot/projects/hammer/sys/sys/uuid.h#3 integrate
.. //depot/projects/hammer/sys/sys/vnode.h#13 integrate
.. //depot/projects/hammer/sys/ufs/ffs/ffs_alloc.c#5 integrate
.. //depot/projects/hammer/sys/ufs/ffs/ffs_vfsops.c#10 integrate
.. //depot/projects/hammer/sys/ufs/ffs/ffs_vnops.c#12 integrate
.. //depot/projects/hammer/usr.sbin/diskinfo/diskinfo.8#3 integrate
.. //depot/projects/hammer/usr.sbin/gstat/gstat.8#2 integrate
.. //depot/projects/hammer/usr.sbin/jexec/jexec.8#2 integrate
.. //depot/projects/hammer/usr.sbin/sysinstall/config.c#4 integrate
.. //depot/projects/hammer/usr.sbin/sysinstall/install.c#12 integrate
.. //depot/projects/hammer/usr.sbin/sysinstall/sysinstall.h#8 integrate
Differences ...
==== //depot/projects/hammer/games/fortune/datfiles/fortunes#8 (text+ko) ====
@@ -1,5 +1,5 @@
This fortune brought to you by:
-$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.110 2003/03/15 02:10:53 grog Exp $
+$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.111 2003/05/31 16:27:53 hoek Exp $
%
-- Gifts for Children --
@@ -6918,7 +6918,7 @@
I gave up Smoking, Drinking and Sex. It was the most *__________horrifying* 20
minutes of my life!
%
-'I generally avoid temptation unless I can't resist it."
+"I generally avoid temptation unless I can't resist it."
-- Mae West
%
I get up each morning, gather my wits.
@@ -9476,7 +9476,7 @@
Magnetism, n.: Something acting upon a magnet.
-The two definition immediately foregoing are condensed from the works
+The two definitions immediately foregoing are condensed from the works
of one thousand eminent scientists, who have illuminated the subject
with a great white light, to the inexpressible advancement of human
knowledge.
@@ -11761,7 +11761,7 @@
do all that I can to protect the environment of this great nation of
ours, and put prayer back in the schools, where it belongs. What we
need is jobs, not empty promises. I realize I'm risking my political
-career be being so outspoken on a sensitive issue such as the MX, but
+career by being so outspoken on a sensitive issue such as the MX, but
that's just the kind of straight-talking honest person I am, and I
can't help it.
-- Dave Barry, "On Presidential Politics"
@@ -15112,7 +15112,7 @@
"We had it tough ... I had to get up at 9 o'clock at night, half an
hour before I went to bed, eat a lump of dry poison, work 29 hours down
mill, and when we came home our Dad would kill us, and dance about on
-our grave singing Haleleuia ..."
+our grave singing Halleluja ..."
-- Monty Python
%
We have met the enemy, and he is us.
==== //depot/projects/hammer/lib/libpam/libpam/security/pam_mod_misc.h#4 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libpam/libpam/security/pam_mod_misc.h,v 1.11 2003/05/01 15:08:55 des Exp $
+ * $FreeBSD: src/lib/libpam/libpam/security/pam_mod_misc.h,v 1.12 2003/05/31 16:56:35 des Exp $
*/
#ifndef PAM_MOD_MISC_H
@@ -31,33 +31,15 @@
#include <sys/cdefs.h>
-/* Standard options
+/*
+ * Common option names
*/
-enum opt { PAM_OPT_DEBUG, PAM_OPT_NO_WARN, PAM_OPT_ECHO_PASS,
- PAM_OPT_USE_FIRST_PASS, PAM_OPT_TRY_FIRST_PASS, PAM_OPT_USE_MAPPED_PASS,
- PAM_OPT_TRY_MAPPED_PASS, PAM_OPT_EXPOSE_ACCOUNT,
- PAM_OPT_STD_MAX /* XXX */ };
-
-#define PAM_MAX_OPTIONS 32
-
-struct opttab {
- const char *name;
- int value;
-};
-
-struct options {
- struct {
- const char *name;
- int bool;
- char *arg;
- } opt[PAM_MAX_OPTIONS];
-};
+#define PAM_OPT_NULLOK "nullok"
+#define PAM_OPT_AUTH_AS_SELF "auth_as_self"
+#define PAM_OPT_ECHO_PASS "echo_pass"
+#define PAM_OPT_DEBUG "debug"
__BEGIN_DECLS
-void pam_std_option(struct options *, struct opttab *, int, const char **);
-int pam_test_option(struct options *, enum opt, char **);
-void pam_set_option(struct options *, enum opt);
-void pam_clear_option(struct options *, enum opt);
void _pam_verbose_error(pam_handle_t *, int, const char *,
const char *, const char *, ...);
__END_DECLS
==== //depot/projects/hammer/lib/libpam/modules/modules.inc#9 (text+ko) ====
@@ -1,13 +1,13 @@
-# $FreeBSD: src/lib/libpam/modules/modules.inc,v 1.17 2003/05/19 15:51:59 des Exp $
+# $FreeBSD: src/lib/libpam/modules/modules.inc,v 1.18 2003/05/31 16:52:57 des Exp $
MODULES =
MODULES += pam_chroot
MODULES += pam_deny
MODULES += pam_echo
MODULES += pam_exec
-MODULES += pam_ftp
MODULES += pam_ftpusers
MODULES += pam_group
+MODULES += pam_guest
.if !defined(NO_KERBEROS) && !defined(NOCRYPT) && !defined(NO_OPENSSL)
MODULES += pam_krb5
MODULES += pam_ksu
==== //depot/projects/hammer/lib/libpam/modules/pam_krb5/pam_krb5.c#4 (text+ko) ====
@@ -6,7 +6,7 @@
* Copyright (c) Nicolas Williams, 2001. All rights reserved.
* Copyright (c) Perot Systems Corporation, 2001. All rights reserved.
* Copyright (c) Mark R V Murray, 2001. All rights reserved.
- * Copyright (c) Networks Associates Technology, Inc., 2002.
+ * Copyright (c) Networks Associates Technology, Inc., 2002-2003.
* All rights reserved.
*
* Portions of this software were developed for the FreeBSD Project by
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_krb5/pam_krb5.c,v 1.16 2003/03/08 10:30:49 markm Exp $");
+__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_krb5/pam_krb5.c,v 1.18 2003/05/31 17:19:03 des Exp $");
#include <sys/types.h>
#include <sys/stat.h>
@@ -71,6 +71,7 @@
#include <security/pam_appl.h>
#include <security/pam_modules.h>
#include <security/pam_mod_misc.h>
+#include <security/openpam.h>
#define COMPAT_HEIMDAL
/* #define COMPAT_MIT */
@@ -84,29 +85,17 @@
#define PASSWORD_PROMPT "Password:"
#define NEW_PASSWORD_PROMPT "New Password:"
-enum {
- PAM_OPT_AUTH_AS_SELF = PAM_OPT_STD_MAX,
- PAM_OPT_CCACHE,
- PAM_OPT_FORWARDABLE,
- PAM_OPT_NO_CCACHE,
- PAM_OPT_REUSE_CCACHE
-};
+#define PAM_OPT_CCACHE "ccache"
+#define PAM_OPT_FORWARDABLE "forwardable"
+#define PAM_OPT_NO_CCACHE "no_ccache"
+#define PAM_OPT_REUSE_CCACHE "reuse_ccache"
-static struct opttab other_options[] = {
- { "auth_as_self", PAM_OPT_AUTH_AS_SELF },
- { "ccache", PAM_OPT_CCACHE },
- { "forwardable", PAM_OPT_FORWARDABLE },
- { "no_ccache", PAM_OPT_NO_CCACHE },
- { "reuse_ccache", PAM_OPT_REUSE_CCACHE },
- { NULL, 0 }
-};
-
/*
* authentication management
*/
PAM_EXTERN int
pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
- int argc, const char *argv[])
+ int argc __unused, const char *argv[] __unused)
{
krb5_error_code krbret;
krb5_context pam_context;
@@ -114,16 +103,11 @@
krb5_principal princ;
krb5_ccache ccache;
krb5_get_init_creds_opt opts;
- struct options options;
struct passwd *pwd;
int retval;
const char *sourceuser, *user, *pass, *service;
char *principal, *princ_name, *ccache_name, luser[32], *srvdup;
- pam_std_option(&options, other_options, argc, argv);
-
- PAM_LOG("Options processed");
-
retval = pam_get_user(pamh, &user, USER_PROMPT);
if (retval != PAM_SUCCESS)
return (retval);
@@ -153,7 +137,7 @@
krb5_get_init_creds_opt_init(&opts);
- if (pam_test_option(&options, PAM_OPT_FORWARDABLE, NULL))
+ if (openpam_get_option(pamh, PAM_OPT_FORWARDABLE))
krb5_get_init_creds_opt_set_forwardable(&opts, 1);
PAM_LOG("Credentials initialised");
@@ -168,7 +152,7 @@
PAM_LOG("Done krb5_cc_register()");
/* Get principal name */
- if (pam_test_option(&options, PAM_OPT_AUTH_AS_SELF, NULL))
+ if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF))
asprintf(&principal, "%s/%s", sourceuser, user);
else
principal = strdup(user);
@@ -288,7 +272,7 @@
goto cleanup;
}
krbret = verify_krb_v5_tgt(pam_context, ccache, srvdup,
- pam_test_option(&options, PAM_OPT_FORWARDABLE, NULL));
+ openpam_get_option(pamh, PAM_OPT_FORWARDABLE) ? 1 : 0);
free(srvdup);
if (krbret == -1) {
PAM_VERBOSE_ERROR("Kerberos 5 error");
@@ -348,7 +332,7 @@
PAM_EXTERN int
pam_sm_setcred(pam_handle_t *pamh, int flags,
- int argc, const char *argv[])
+ int argc __unused, const char *argv[] __unused)
{
krb5_error_code krbret;
@@ -357,19 +341,14 @@
krb5_creds creds;
krb5_ccache ccache_temp, ccache_perm;
krb5_cc_cursor cursor;
- struct options options;
struct passwd *pwd = NULL;
int retval;
- char *user;
- char *cache_name, *cache_env_name, *p, *q;
+ const char *cache_name, *q, *user;
+ char *cache_name_buf = NULL, *p;
uid_t euid;
gid_t egid;
- pam_std_option(&options, other_options, argc, argv);
-
- PAM_LOG("Options processed");
-
if (flags & PAM_DELETE_CRED)
return (PAM_SUCCESS);
@@ -440,10 +419,11 @@
PAM_LOG("Done setegid() & seteuid()");
/* Get the cache name */
- cache_name = NULL;
- pam_test_option(&options, PAM_OPT_CCACHE, &cache_name);
- if (cache_name == NULL)
- asprintf(&cache_name, "FILE:/tmp/krb5cc_%d", pwd->pw_uid);
+ cache_name = openpam_get_option(pamh, PAM_OPT_CCACHE);
+ if (cache_name == NULL) {
+ asprintf(&cache_name_buf, "FILE:/tmp/krb5cc_%d", pwd->pw_uid);
+ cache_name = cache_name_buf;
+ }
p = calloc(PATH_MAX + 16, sizeof(char));
q = cache_name;
@@ -559,17 +539,9 @@
PAM_LOG("Cache closed");
- cache_env_name = malloc(strlen(cache_name) + 12);
- if (!cache_env_name) {
- PAM_LOG("Error malloc(): failure");
- krb5_cc_destroy(pam_context, ccache_perm);
- retval = PAM_BUF_ERR;
- goto cleanup2;
- }
-
- sprintf(cache_env_name, "KRB5CCNAME=%s", cache_name);
- if ((retval = pam_putenv(pamh, cache_env_name)) != 0) {
- PAM_LOG("Error pam_putenv(): %s", pam_strerror(pamh, retval));
+ retval = pam_setenv(pamh, "KRB5CCNAME", cache_name, 1);
+ if (retval != PAM_SUCCESS) {
+ PAM_LOG("Error pam_setenv(): %s", pam_strerror(pamh, retval));
krb5_cc_destroy(pam_context, ccache_perm);
retval = PAM_SERVICE_ERR;
goto cleanup2;
@@ -589,6 +561,9 @@
PAM_LOG("Done seteuid() & setegid()");
+ if (cache_name_buf != NULL)
+ free(cache_name_buf);
+
return (retval);
}
@@ -597,20 +572,15 @@
*/
PAM_EXTERN int
pam_sm_acct_mgmt(pam_handle_t *pamh, int flags __unused,
- int argc, const char *argv[])
+ int argc __unused, const char *argv[] __unused)
{
krb5_error_code krbret;
krb5_context pam_context;
krb5_ccache ccache;
krb5_principal princ;
- struct options options;
int retval;
const char *user, *ccache_name;
- pam_std_option(&options, other_options, argc, argv);
-
- PAM_LOG("Options processed");
-
retval = pam_get_item(pamh, PAM_USER, (const void **)&user);
if (retval != PAM_SUCCESS)
return (retval);
@@ -673,7 +643,7 @@
*/
PAM_EXTERN int
pam_sm_chauthtok(pam_handle_t *pamh, int flags,
- int argc, const char *argv[])
+ int argc __unused, const char *argv[] __unused)
{
krb5_error_code krbret;
krb5_context pam_context;
@@ -681,15 +651,10 @@
krb5_principal princ;
krb5_get_init_creds_opt opts;
krb5_data result_code_string, result_string;
- struct options options;
int result_code, retval;
const char *user, *pass;
char *princ_name, *passdup;
- pam_std_option(&options, other_options, argc, argv);
-
- PAM_LOG("Options processed");
-
if (!(flags & PAM_UPDATE_AUTHTOK))
return (PAM_AUTHTOK_ERR);
==== //depot/projects/hammer/lib/libpam/modules/pam_opie/pam_opie.c#2 (text+ko) ====
@@ -2,7 +2,7 @@
* Copyright 2000 James Bloom
* All rights reserved.
* Based upon code Copyright 1998 Juniper Networks, Inc.
- * Copyright (c) 2001,2002 Networks Associates Technology, Inc.
+ * Copyright (c) 2001-2003 Networks Associates Technology, Inc.
* All rights reserved.
*
* Portions of this software were developed for the FreeBSD Project by
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_opie/pam_opie.c,v 1.23 2002/07/30 08:32:03 des Exp $");
+__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_opie/pam_opie.c,v 1.25 2003/05/31 17:19:03 des Exp $");
#include <sys/types.h>
#include <opie.h>
@@ -52,23 +52,13 @@
#include <security/pam_modules.h>
#include <security/pam_mod_misc.h>
-enum {
- PAM_OPT_AUTH_AS_SELF = PAM_OPT_STD_MAX,
- PAM_OPT_NO_FAKE_PROMPTS
-};
-
-static struct opttab other_options[] = {
- { "auth_as_self", PAM_OPT_AUTH_AS_SELF },
- { "no_fake_prompts", PAM_OPT_NO_FAKE_PROMPTS },
- { NULL, 0 }
-};
+#define PAM_OPT_NO_FAKE_PROMPTS "no_fake_prompts"
PAM_EXTERN int
pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
- int argc, const char *argv[])
+ int argc __unused, const char *argv[] __unused)
{
struct opie opie;
- struct options options;
struct passwd *pwd;
int retval, i;
const char *(promptstr[]) = { "%s\nPassword: ", "%s\nPassword [echo on]: "};
@@ -77,12 +67,8 @@
char *response;
int style;
- pam_std_option(&options, other_options, argc, argv);
-
- PAM_LOG("Options processed");
-
user = NULL;
- if (pam_test_option(&options, PAM_OPT_AUTH_AS_SELF, NULL)) {
+ if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) {
if ((pwd = getpwnam(getlogin())) == NULL)
return (PAM_AUTH_ERR);
user = pwd->pw_name;
@@ -108,7 +94,7 @@
*/
/* XXX generates a const warning because of incorrect prototype */
if (opiechallenge(&opie, (char *)user, challenge) != 0 &&
- pam_test_option(&options, PAM_OPT_NO_FAKE_PROMPTS, NULL))
+ openpam_get_option(pamh, PAM_OPT_NO_FAKE_PROMPTS))
return (PAM_AUTH_ERR);
/*
==== //depot/projects/hammer/lib/libpam/modules/pam_radius/pam_radius.c#3 (text+ko) ====
@@ -1,7 +1,7 @@
/*-
* Copyright 1998 Juniper Networks, Inc.
* All rights reserved.
- * Copyright (c) 2001,2002 Networks Associates Technology, Inc.
+ * Copyright (c) 2001-2003 Networks Associates Technology, Inc.
* All rights reserved.
*
* Portions of this software were developed for the FreeBSD Project by
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_radius/pam_radius.c,v 1.13 2002/10/28 10:28:46 des Exp $");
+__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_radius/pam_radius.c,v 1.15 2003/05/31 17:19:03 des Exp $");
#include <sys/param.h>
#include <pwd.h>
@@ -51,18 +51,9 @@
#include <security/pam_modules.h>
#include <security/pam_mod_misc.h>
-enum {
- PAM_OPT_CONF = PAM_OPT_STD_MAX,
- PAM_OPT_TEMPLATE_USER,
- PAM_OPT_NAS_ID
-};
-
-static struct opttab other_options[] = {
- { "conf", PAM_OPT_CONF },
- { "template_user", PAM_OPT_TEMPLATE_USER },
- { "nas_id", PAM_OPT_NAS_ID },
- { NULL, 0 }
-};
+#define PAM_OPT_CONF "conf"
+#define PAM_OPT_TEMPLATE_USER "template_user"
+#define PAM_OPT_NAS_ID "nas_id"
#define MAX_CHALLENGE_MSGS 10
#define PASSWORD_PROMPT "RADIUS Password:"
@@ -218,25 +209,17 @@
PAM_EXTERN int
pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
- int argc, const char *argv[])
+ int argc __unused, const char *argv[] __unused)
{
- struct options options;
struct rad_handle *radh;
const char *user, *tmpuser, *pass;
- char *conf_file, *template_user, *nas_id;
+ const char *conf_file, *template_user, *nas_id;
int retval;
int e;
- pam_std_option(&options, other_options, argc, argv);
-
- PAM_LOG("Options processed");
-
- conf_file = NULL;
- pam_test_option(&options, PAM_OPT_CONF, &conf_file);
- template_user = NULL;
- pam_test_option(&options, PAM_OPT_TEMPLATE_USER, &template_user);
- nas_id = NULL;
- pam_test_option(&options, PAM_OPT_NAS_ID, &nas_id);
+ conf_file = openpam_get_option(pamh, PAM_OPT_CONF);
+ template_user = openpam_get_option(pamh, PAM_OPT_TEMPLATE_USER);
+ nas_id = openpam_get_option(pamh, PAM_OPT_NAS_ID);
retval = pam_get_user(pamh, &user, NULL);
if (retval != PAM_SUCCESS)
==== //depot/projects/hammer/lib/libpam/modules/pam_tacplus/pam_tacplus.c#2 (text+ko) ====
@@ -1,7 +1,7 @@
/*-
* Copyright 1998 Juniper Networks, Inc.
* All rights reserved.
- * Copyright (c) 2001,2002 Networks Associates Technology, Inc.
+ * Copyright (c) 2001-2003 Networks Associates Technology, Inc.
* All rights reserved.
*
* Portions of this software were developed for the FreeBSD Project by
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_tacplus/pam_tacplus.c,v 1.12 2002/04/12 22:27:24 des Exp $");
+__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_tacplus/pam_tacplus.c,v 1.14 2003/05/31 17:19:03 des Exp $");
#include <sys/param.h>
@@ -52,17 +52,9 @@
#include <security/pam_modules.h>
#include <security/pam_mod_misc.h>
-enum {
- PAM_OPT_CONF = PAM_OPT_STD_MAX,
- PAM_OPT_TEMPLATE_USER
-};
+#define PAM_OPT_CONF "conf"
+#define PAM_OPT_TEMPLATE_USER "template_user"
-static struct opttab other_options[] = {
- { "conf", PAM_OPT_CONF },
- { "template_user", PAM_OPT_TEMPLATE_USER },
- { NULL, 0 }
-};
-
typedef int (*set_func)(struct tac_handle *, const char *);
static int do_item(pam_handle_t *, struct tac_handle *, int,
@@ -115,22 +107,14 @@
PAM_EXTERN int
pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
- int argc, const char *argv[])
+ int argc __unused, const char *argv[] __unused)
{
- struct options options;
int retval;
struct tac_handle *tach;
- char *conf_file;
- char *template_user;
+ const char *conf_file, *template_user;
- pam_std_option(&options, other_options, argc, argv);
-
- PAM_LOG("Options processed");
-
- conf_file = NULL;
- pam_test_option(&options, PAM_OPT_CONF, &conf_file);
- template_user = NULL;
- pam_test_option(&options, PAM_OPT_TEMPLATE_USER, &template_user);
+ conf_file = openpam_get_option(pamh, PAM_OPT_CONF);
+ template_user = openpam_get_option(pamh, PAM_OPT_TEMPLATE_USER);
tach = tac_open();
if (tach == NULL) {
@@ -184,8 +168,8 @@
return (PAM_AUTHINFO_UNAVAIL);
}
status = TAC_AUTHEN_STATUS(sflags);
- if (!TAC_AUTHEN_NOECHO(sflags))
- pam_set_option(&options, PAM_OPT_ECHO_PASS);
+ openpam_set_option(pamh, PAM_OPT_ECHO_PASS,
+ TAC_AUTHEN_NOECHO(sflags) ? NULL : "");
switch (status) {
case TAC_AUTHEN_STATUS_PASS:
@@ -245,8 +229,8 @@
if ((srvr_msg = get_msg(tach)) == NULL)
return (PAM_SERVICE_ERR);
retval = pam_prompt(pamh,
- pam_test_option(&options, PAM_OPT_ECHO_PASS, NULL)
- ? PAM_PROMPT_ECHO_ON : PAM_PROMPT_ECHO_OFF,
+ openpam_get_option(pamh, PAM_OPT_ECHO_PASS) ?
+ PAM_PROMPT_ECHO_ON : PAM_PROMPT_ECHO_OFF,
&data_msg, "%s", *srvr_msg ? srvr_msg : "Data:");
free(srvr_msg);
if (retval != PAM_SUCCESS) {
==== //depot/projects/hammer/lib/libpam/modules/pam_unix/pam_unix.c#4 (text+ko) ====
@@ -1,7 +1,7 @@
/*-
* Copyright 1998 Juniper Networks, Inc.
* All rights reserved.
- * Copyright (c) 2002 Networks Associates Technology, Inc.
+ * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
* All rights reserved.
*
* Portions of this software was developed for the FreeBSD Project by
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_unix/pam_unix.c,v 1.44 2003/04/30 00:49:42 des Exp $");
+__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_unix/pam_unix.c,v 1.46 2003/05/31 17:19:03 des Exp $");
#include <sys/param.h>
#include <sys/socket.h>
@@ -74,21 +74,9 @@
static char password_hash[] = PASSWORD_HASH;
-enum {
- PAM_OPT_AUTH_AS_SELF = PAM_OPT_STD_MAX,
- PAM_OPT_NULLOK,
- PAM_OPT_LOCAL_PASS,
- PAM_OPT_NIS_PASS
-};
+#define PAM_OPT_LOCAL_PASS "local_pass"
+#define PAM_OPT_NIS_PASS "nis_pass"
-static struct opttab other_options[] = {
- { "auth_as_self", PAM_OPT_AUTH_AS_SELF },
- { "nullok", PAM_OPT_NULLOK },
- { "local_pass", PAM_OPT_LOCAL_PASS },
- { "nis_pass", PAM_OPT_NIS_PASS },
- { NULL, 0 }
-};
-
char *tempname = NULL;
/*
@@ -96,19 +84,14 @@
*/
PAM_EXTERN int
pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
- int argc, const char *argv[])
+ int argc __unused, const char *argv[] __unused)
{
login_cap_t *lc;
- struct options options;
struct passwd *pwd;
int retval;
const char *pass, *user, *realpw, *prompt;
- pam_std_option(&options, other_options, argc, argv);
-
- PAM_LOG("Options processed");
-
- if (pam_test_option(&options, PAM_OPT_AUTH_AS_SELF, NULL)) {
+ if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) {
pwd = getpwnam(getlogin());
} else {
retval = pam_get_user(pamh, &user, NULL);
@@ -124,7 +107,7 @@
realpw = pwd->pw_passwd;
if (realpw[0] == '\0') {
if (!(flags & PAM_DISALLOW_NULL_AUTHTOK) &&
- pam_test_option(&options, PAM_OPT_NULLOK, NULL))
+ openpam_get_option(pamh, PAM_OPT_NULLOK))
return (PAM_SUCCESS);
realpw = "*";
}
@@ -160,10 +143,9 @@
*/
PAM_EXTERN int
pam_sm_acct_mgmt(pam_handle_t *pamh, int flags __unused,
- int argc, const char *argv[])
+ int argc __unused, const char *argv[] __unused)
{
struct addrinfo hints, *res;
- struct options options;
struct passwd *pwd;
struct timeval tp;
login_cap_t *lc;
@@ -172,10 +154,6 @@
const char *rhost, *tty, *user;
char rhostip[MAXHOSTNAMELEN] = "";
- pam_std_option(&options, other_options, argc, argv);
-
- PAM_LOG("Options processed");
-
retval = pam_get_user(pamh, &user, NULL);
if (retval != PAM_SUCCESS)
return (retval);
@@ -279,13 +257,12 @@
*/
PAM_EXTERN int
pam_sm_chauthtok(pam_handle_t *pamh, int flags,
- int argc, const char *argv[])
+ int argc __unused, const char *argv[] __unused)
{
#ifdef YP
struct ypclnt *ypclnt;
const char *yp_domain, *yp_server;
#endif
- struct options options;
char salt[SALTSIZE + 1];
login_cap_t * lc;
struct passwd *pwd, *old_pwd;
@@ -293,11 +270,7 @@
char *encrypted;
int pfd, tfd, retval;
- pam_std_option(&options, other_options, argc, argv);
-
- PAM_LOG("Options processed");
-
- if (pam_test_option(&options, PAM_OPT_AUTH_AS_SELF, NULL))
+ if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF))
pwd = getpwnam(getlogin());
else {
retval = pam_get_user(pamh, &user, NULL);
@@ -321,7 +294,7 @@
return (pam_set_item(pamh, PAM_OLDAUTHTOK, ""));
if (pwd->pw_passwd[0] == '\0'
- && pam_test_option(&options, PAM_OPT_NULLOK, NULL)) {
+ && openpam_get_option(pamh, PAM_OPT_NULLOK)) {
/*
* No password case. XXX Are we giving too much away
* by not prompting for a password?
@@ -338,7 +311,7 @@
/* always encrypt first */
encrypted = crypt(old_pass, pwd->pw_passwd);
if (old_pass[0] == '\0' &&
- !pam_test_option(&options, PAM_OPT_NULLOK, NULL))
+ !openpam_get_option(pamh, PAM_OPT_NULLOK))
return (PAM_PERM_DENIED);
if (strcmp(encrypted, pwd->pw_passwd) != 0)
return (PAM_PERM_DENIED);
@@ -367,7 +340,7 @@
}
if (getuid() != 0 && new_pass[0] == '\0' &&
- !pam_test_option(&options, PAM_OPT_NULLOK, NULL))
+ !openpam_get_option(pamh, PAM_OPT_NULLOK))
return (PAM_PERM_DENIED);
if ((old_pwd = pw_dup(pwd)) == NULL)
==== //depot/projects/hammer/lib/libthr/thread/thr_cond.c#6 (text+ko) ====
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libthr/thread/thr_cond.c,v 1.7 2003/05/29 20:54:00 mtm Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_cond.c,v 1.8 2003/05/31 14:38:22 mtm Exp $
*/
#include <stdlib.h>
#include <errno.h>
@@ -529,10 +529,11 @@
static inline int
cond_init(pthread_cond_t *cond)
{
+ int error = 0;
_SPINLOCK(&static_cond_lock);
if (*cond == PTHREAD_COND_INITIALIZER)
- return (_pthread_cond_init(cond, NULL));
+ error = _pthread_cond_init(cond, NULL);
_SPINUNLOCK(&static_cond_lock);
- return (0);
+ return (error);
}
==== //depot/projects/hammer/lib/libthr/thread/thr_mutex.c#7 (text+ko) ====
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libthr/thread/thr_mutex.c,v 1.9 2003/05/29 20:58:31 mtm Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_mutex.c,v 1.10 2003/05/31 14:38:22 mtm Exp $
*/
#include <stdlib.h>
#include <errno.h>
@@ -269,25 +269,23 @@
static int
init_static(pthread_mutex_t *mutex)
{
+ int error = 0;
_SPINLOCK(&static_init_lock);
- if (*mutex == PTHREAD_MUTEX_INITIALIZER) {
- _SPINUNLOCK(&static_init_lock);
- return(_pthread_mutex_init(mutex, NULL));
- }
+ if (*mutex == PTHREAD_MUTEX_INITIALIZER)
+ error = _pthread_mutex_init(mutex, NULL);
_SPINUNLOCK(&static_init_lock);
- return (0);
+ return (error);
}
static int
init_static_private(pthread_mutex_t *mutex)
{
+ int error = 0;
_SPINLOCK(&static_init_lock);
- if (*mutex == PTHREAD_MUTEX_INITIALIZER) {
- _SPINUNLOCK(&static_init_lock);
- return (_pthread_mutex_init(mutex, &static_mattr));
- }
+ if (*mutex == PTHREAD_MUTEX_INITIALIZER)
+ error = _pthread_mutex_init(mutex, &static_mattr);
_SPINUNLOCK(&static_init_lock);
- return (0);
+ return (error);
}
int
==== //depot/projects/hammer/libexec/rtld-elf/libmap.c#7 (text+ko) ====
@@ -1,5 +1,5 @@
/*
- * $FreeBSD: src/libexec/rtld-elf/libmap.c,v 1.6 2003/05/30 00:49:16 mdodd Exp $
+ * $FreeBSD: src/libexec/rtld-elf/libmap.c,v 1.7 2003/05/31 14:46:38 mdodd Exp $
*/
#include <stdio.h>
@@ -49,6 +49,8 @@
char prog[MAXPATHLEN];
char line[MAXPATHLEN + 2];
+ dbg("%s()", __func__);
+
TAILQ_INIT(&lmp_head);
if ((fp = fopen(_PATH_LIBMAP_CONF, "r")) == NULL)
@@ -133,6 +135,8 @@
{
struct lm *lm;
+ dbg("%s(%p)", __func__, lml);
+
while (!TAILQ_EMPTY(lml)) {
lm = TAILQ_FIRST(lml);
TAILQ_REMOVE(lml, lm, lm_link);
@@ -148,6 +152,8 @@
{
struct lmp *lmp;
+ dbg("%s()", __func__);
+
while (!TAILQ_EMPTY(&lmp_head)) {
lmp = TAILQ_FIRST(&lmp_head);
TAILQ_REMOVE(&lmp_head, lmp, lmp_link);
@@ -167,6 +173,8 @@
if (p == NULL)
p = "$DEFAULT$";
+ dbg("%s(\"%s\", \"%s\", \"%s\")", __func__, p, f, t);
+
if ((lml = lmp_find(p)) == NULL)
lml = lmp_init(xstrdup(p));
@@ -182,6 +190,8 @@
struct lm_list *lml;
char *t;
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list