add missing 5 pam functions

This commit is contained in:
Daniel J Walsh 2004-10-05 14:31:29 +00:00
parent e859c61a3d
commit 1ba26cacf9

View File

@ -1,99 +1,5 @@
--- coreutils-5.2.1/src/su.c.runuser 2004-10-05 12:50:23.915824850 +0100
+++ coreutils-5.2.1/src/su.c 2004-10-05 12:50:24.254760375 +0100
@@ -171,6 +171,10 @@
#ifndef USE_PAM
char *crypt ();
#endif
+#ifndef CHECKPASSWD
+#define CHECKPASSWD 1
+#endif
+
char *getpass ();
char *getusershell ();
void endusershell ();
@@ -740,7 +744,7 @@
pw->pw_dir = xstrdup (pw->pw_dir);
pw->pw_shell = xstrdup (pw->pw_shell);
- if (!correct_password (pw))
+ if (CHECKPASSWD && !correct_password (pw))
{
#ifdef SYSLOG_FAILURE
log_su (pw, 0);
--- coreutils-5.2.1/src/Makefile.am.runuser 2004-10-05 12:50:23.909825991 +0100
+++ coreutils-5.2.1/src/Makefile.am 2004-10-05 12:50:24.258759614 +0100
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
-EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who
+EXTRA_PROGRAMS = chroot df hostid nice pinky stty su runuser uname uptime users who
bin_SCRIPTS = groups
bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \
@@ -67,6 +67,7 @@
uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
su_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
+runuser_LDADD = $(LDADD) $(LIB_CRYPT)
$(PROGRAMS): ../lib/libfetish.a
@@ -84,7 +85,7 @@
chmod +x $@-t
mv $@-t $@
-all-local: su$(EXEEXT)
+all-local: su$(EXEEXT) runuser
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
@@ -100,7 +101,7 @@
chmod $(setuid_root_mode) $(installed_su)
install-root: su$(EXEEXT)
- @$(INSTALL_SU)
+ @$(INSTALL_SU)
install-exec-local: su$(EXEEXT)
@TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \
--- /dev/null 2004-09-27 14:44:32.781829323 +0100
+++ coreutils-5.2.1/src/runuser.c 2004-10-05 12:50:24.261759043 +0100
@@ -0,0 +1,33 @@
+#define CHECKPASSWD 0
+#define pam_start my_pam_start
+#define pam_end my_pam_end
+#define pam_setcred my_pam_setcred
+#define pam_open_session my_pam_open_session
+#define pam_close_session my_pam_close_session
+#define pam_strerror my_pam_strerror
+#define pam_getenvlist my_pam_getenvlist
+#include "su.c"
+int pam_start(const char *service_name, const char *user,
+ const struct pam_conv *pam_conversation,
+ pam_handle_t **pamh) {
+ return PAM_SUCCESS;
+}
+int pam_end(pam_handle_t *pamh, int pam_status) {
+ return PAM_SUCCESS;
+}
+int pam_setcred(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+int pam_open_session(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+int pam_close_session(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+const char *pam_strerror(pam_handle_t *pamh, int err){
+ return "";
+}
+char **pam_getenvlist(pam_handle_t *pamh){
+ return NULL;
+}
+
--- /dev/null 2004-09-27 14:44:32.781829323 +0100
+++ coreutils-5.2.1/man/runuser.1 2004-10-05 12:50:24.265758283 +0100
--- /dev/null 2004-09-30 04:21:43.103661032 -0400
+++ coreutils-5.2.1/man/runuser.1 2004-10-05 09:56:25.919169327 -0400
@@ -0,0 +1,59 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.33.
+.TH RUNUSER "1" "September 2004" "runuser (coreutils) 5.2.1" "User Commands"
@ -154,8 +60,8 @@
+.B info coreutils su
+.PP
+should give you access to the complete manual.
--- coreutils-5.2.1/man/Makefile.am.runuser 2004-01-23 15:54:23.000000000 +0000
+++ coreutils-5.2.1/man/Makefile.am 2004-10-05 12:50:54.285047667 +0100
--- coreutils-5.2.1/man/Makefile.am.runuser 2004-01-23 10:54:23.000000000 -0500
+++ coreutils-5.2.1/man/Makefile.am 2004-10-05 09:56:25.921169102 -0400
@@ -7,7 +7,7 @@
link.1 ln.1 logname.1 \
ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nice.1 nl.1 nohup.1 od.1 \
@ -173,25 +79,15 @@
seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c
sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c
shred.1: $(common_dep) $(srcdir)/shred.x ../src/shred.c
--- /dev/null 2004-09-27 14:44:32.781829323 +0100
+++ coreutils-5.2.1/man/runuser.x 2004-10-05 12:50:24.282755049 +0100
--- /dev/null 2004-09-30 04:21:43.103661032 -0400
+++ coreutils-5.2.1/man/runuser.x 2004-10-05 09:56:25.922168989 -0400
@@ -0,0 +1,4 @@
+[NAME]
+runuser \- run a shell with substitute user and group IDs
+[DESCRIPTION]
+.\" Add any additional description here
--- coreutils-5.2.1/tests/help-version.runuser 2004-02-17 16:04:23.000000000 +0000
+++ coreutils-5.2.1/tests/help-version 2004-10-05 12:50:24.284754669 +0100
@@ -130,6 +130,7 @@
seq_args=10
sleep_args=0
su_args=--version
+runuser_args=--version
test_args=foo
# This is necessary in the unusual event that there is
--- coreutils-5.2.1/README.runuser 2004-01-18 07:59:41.000000000 +0000
+++ coreutils-5.2.1/README 2004-10-05 12:50:24.287754098 +0100
--- coreutils-5.2.1/README.runuser 2004-01-18 02:59:41.000000000 -0500
+++ coreutils-5.2.1/README 2004-10-05 09:56:25.925168651 -0400
@@ -11,7 +11,7 @@
df dir dircolors dirname du echo env expand expr factor false fmt fold
ginstall groups head hostid hostname id join kill link ln logname ls
@ -201,3 +97,127 @@
split stat stty su sum sync tac tail tee test touch tr true tsort tty
uname unexpand uniq unlink uptime users vdir wc who whoami yes
--- coreutils-5.2.1/tests/help-version.runuser 2004-02-17 11:04:23.000000000 -0500
+++ coreutils-5.2.1/tests/help-version 2004-10-05 09:56:25.924168764 -0400
@@ -130,6 +130,7 @@
seq_args=10
sleep_args=0
su_args=--version
+runuser_args=--version
test_args=foo
# This is necessary in the unusual event that there is
--- coreutils-5.2.1/src/su.c.runuser 2004-10-05 09:56:25.680196251 -0400
+++ coreutils-5.2.1/src/su.c 2004-10-05 09:56:25.915169778 -0400
@@ -171,6 +171,10 @@
#ifndef USE_PAM
char *crypt ();
#endif
+#ifndef CHECKPASSWD
+#define CHECKPASSWD 1
+#endif
+
char *getpass ();
char *getusershell ();
void endusershell ();
@@ -740,7 +744,7 @@
pw->pw_dir = xstrdup (pw->pw_dir);
pw->pw_shell = xstrdup (pw->pw_shell);
- if (!correct_password (pw))
+ if (CHECKPASSWD && !correct_password (pw))
{
#ifdef SYSLOG_FAILURE
log_su (pw, 0);
--- coreutils-5.2.1/src/Makefile.am.runuser 2004-10-05 09:56:25.677196589 -0400
+++ coreutils-5.2.1/src/Makefile.am 2004-10-05 09:56:25.916169665 -0400
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
-EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who
+EXTRA_PROGRAMS = chroot df hostid nice pinky stty su runuser uname uptime users who
bin_SCRIPTS = groups
bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \
@@ -67,6 +67,7 @@
uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
su_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
+runuser_LDADD = $(LDADD) $(LIB_CRYPT)
$(PROGRAMS): ../lib/libfetish.a
@@ -84,7 +85,7 @@
chmod +x $@-t
mv $@-t $@
-all-local: su$(EXEEXT)
+all-local: su$(EXEEXT) runuser
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
@@ -100,7 +101,7 @@
chmod $(setuid_root_mode) $(installed_su)
install-root: su$(EXEEXT)
- @$(INSTALL_SU)
+ @$(INSTALL_SU)
install-exec-local: su$(EXEEXT)
@TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \
--- /dev/null 2004-09-30 04:21:43.103661032 -0400
+++ coreutils-5.2.1/src/runuser.c 2004-10-05 10:04:28.835490381 -0400
@@ -0,0 +1,53 @@
+#define CHECKPASSWD 0
+#define pam_start my_pam_start
+#define pam_end my_pam_end
+#define pam_setcred my_pam_setcred
+#define pam_open_session my_pam_open_session
+#define pam_close_session my_pam_close_session
+#define pam_strerror my_pam_strerror
+#define pam_getenvlist my_pam_getenvlist
+#include "su.c"
+int pam_start(const char *service_name, const char *user,
+ const struct pam_conv *pam_conversation,
+ pam_handle_t **pamh) {
+ return PAM_SUCCESS;
+}
+int pam_end(pam_handle_t *pamh, int pam_status) {
+ return PAM_SUCCESS;
+}
+int pam_setcred(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+int pam_open_session(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+int pam_close_session(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+const char *pam_strerror(pam_handle_t *pamh, int err){
+ return "";
+}
+char **pam_getenvlist(pam_handle_t *pamh){
+ return NULL;
+}
+
+int misc_conv(int num_msg, const struct pam_message **msgm,
+ struct pam_response **response, void *appdata_ptr) {
+ return PAM_SUCCESS;
+}
+
+int pam_authenticate(pam_handle_t *pamh, int flags) {
+ return PAM_SUCCESS;
+}
+
+int pam_acct_mgmt(pam_handle_t *pamh, int flags) {
+ return PAM_SUCCESS;
+}
+
+int pam_chauthtok (pam_handle_t *pamh, int flags) {
+ return PAM_SUCCESS;
+}
+
+int pam_set_item(pam_handle_t *pamh, int item_type, const void *item) {
+ return PAM_SUCCESS;
+}