From 3baedb3aee3a7fa00893369f1616007172d20251 Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Thu, 26 Oct 2000 22:53:33 +0000 Subject: Remove the notion of "Copybuffer ownership" now that copybuffer contents are always cleared on logout; from Jean-Baptiste.Marchand@epita.fr. --- sys/arch/i386/isa/pcvt/pcvt_hdr.h | 5 +---- sys/arch/i386/isa/pcvt/pcvt_mouse.c | 41 ++----------------------------------- 2 files changed, 3 insertions(+), 43 deletions(-) (limited to 'sys') diff --git a/sys/arch/i386/isa/pcvt/pcvt_hdr.h b/sys/arch/i386/isa/pcvt/pcvt_hdr.h index 2f5e710010f..de19fe9b175 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_hdr.h +++ b/sys/arch/i386/isa/pcvt/pcvt_hdr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_hdr.h,v 1.41 2000/10/07 03:12:46 aaron Exp $ */ +/* $OpenBSD: pcvt_hdr.h,v 1.42 2000/10/26 22:53:31 aaron Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -1144,9 +1144,6 @@ static __inline void vt_selattr(struct video_state *svsp) char *Copybuffer; /* buffer that contains mouse selections */ unsigned int Copybuffer_size; -uid_t Copyowner; /* uid of the owner of the selection, useful for verifying - permissions on it - */ char Paste_avail; /* flag, to indicate whether a selection is in the Copy buffer */ diff --git a/sys/arch/i386/isa/pcvt/pcvt_mouse.c b/sys/arch/i386/isa/pcvt/pcvt_mouse.c index 887c2cda833..e92ad33e0c7 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_mouse.c +++ b/sys/arch/i386/isa/pcvt/pcvt_mouse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_mouse.c,v 1.6 2000/10/25 16:55:53 aaron Exp $ */ +/* $OpenBSD: pcvt_mouse.c,v 1.7 2000/10/26 22:53:32 aaron Exp $ */ /* * Copyright (c) 2000 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon @@ -63,7 +63,6 @@ void mouse_copy_extend_after(void); void remove_selection(void); void mouse_copy_selection(void); void mouse_paste(void); -uid_t current_uid(void); void mouse_zaxis(int z); void mouse_button(int button, int clicks); @@ -911,38 +910,6 @@ remove_selection() vsp->mouse_flags &= ~SEL_EXISTS; } -/* - * Function to get the uid of the user behind the *shell* on the current tty - * We handle su and sudo cases... - */ - -uid_t -current_uid(void) -{ - pid_t pg = 0; /* process group id */ - struct proc *owner_proc = 0; - - if (vsp->vs_tty && vsp->vs_tty->t_pgrp) - pg = vsp->vs_tty->t_pgrp->pg_id; - else - return (0); /* the uid of root, just to be sure */ - - if (pg) - owner_proc = pfind(pg); - - if (!owner_proc) { - Paste_avail = 0; /* this selection will never be available - because the process doesn't exist... */ - return (0); /* the uid of root, just to be sure */ - } - - /* - * We use the real user id and not the *effective* one, as a foreground - * setuid process could permit to paste selection of another user - */ - - return (owner_proc->p_cred->p_ruid); -} /* * Function to put the current visual selection in the selection buffer @@ -976,7 +943,6 @@ mouse_copy_selection(void) } Copybuffer[current] = '\0'; - Copyowner = current_uid(); } /* @@ -988,11 +954,8 @@ mouse_paste(void) { unsigned short len; char *current = Copybuffer; - uid_t cur_uid; - cur_uid = current_uid(); - if (Paste_avail && ((cur_uid == Copyowner) || !cur_uid)) { - /* either the owner of the selection or root */ + if (Paste_avail) { len = strlen(Copybuffer); for (; len > 0; len--) { (*linesw[vsp->vs_tty->t_line].l_rint) -- cgit v1.2.3