From root@srv1.galle.com.br  Wed Oct 13 18:04:18 2004
Return-Path: <root@srv1.galle.com.br>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 78A6416A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 13 Oct 2004 18:04:18 +0000 (GMT)
Received: from srv1.galle.com.br (srv1.galle.com.br [200.246.25.2])
	by mx1.FreeBSD.org (Postfix) with SMTP id 4591943D3F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 13 Oct 2004 18:04:17 +0000 (GMT)
	(envelope-from root@srv1.galle.com.br)
Received: (qmail 86107 invoked by uid 0); 13 Oct 2004 15:04:15 -0300
Message-Id: <20041013180415.86106.qmail@srv1.galle.com.br>
Date: 13 Oct 2004 15:04:15 -0300
From: Renato Botelho <renato@galle.com.br>
To: FreeBSD-gnats-submit@freebsd.org
Cc: s_bschmi@ira.uka.de
Subject: [PATCH] editors/jed: Fix a bug - lost setuid and setgid bits when save file
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         72652
>Category:       ports
>Synopsis:       [PATCH] editors/jed: Fix a bug - lost setuid and setgid bits when save file
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pav
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 13 18:10:16 GMT 2004
>Closed-Date:    Mon Nov 01 19:12:26 GMT 2004
>Last-Modified:  Mon Nov 01 19:12:26 GMT 2004
>Originator:     Renato Botelho
>Release:        FreeBSD 5.2.1-RELEASE-p8 i386
>Organization:
Galle Folheados
>Environment:
System: FreeBSD srv1.galle.com.br 5.2.1-RELEASE-p8 FreeBSD 5.2.1-RELEASE-p8 #27: Wed May 26 10:21:14 BRT 2004
>Description:
When you save a file its loosing setuid and setgid bit

Added file(s):
- files/patch-file
- files/patch-unix

Port maintainer (s_bschmi@ira.uka.de) is cc'd.

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:

touch x
chmod 4755 x
ls -l x
The permissions will be -rwsr-xr-x
jed x
Change & save the file
ls -l x
The permissions will be -rwxr-xr-x

>Fix:

--- jed-0.99.16.patch begins here ---
diff -ruN --exclude=CVS /var/jail/data/usr/ports/editors/jed.orig/files/patch-file /var/jail/data/usr/ports/editors/jed/files/patch-file
--- /var/jail/data/usr/ports/editors/jed.orig/files/patch-file	Wed Dec 31 21:00:00 1969
+++ /var/jail/data/usr/ports/editors/jed/files/patch-file	Wed Oct 13 14:53:32 2004
@@ -0,0 +1,20 @@
+--- src/file.c.orig	Wed Oct 13 14:52:57 2004
++++ src/file.c	Wed Oct 13 14:53:07 2004
+@@ -173,7 +173,7 @@
+ 	   case FAB$C_STMLF:  rfm = "stmlf"; break;
+ 	   case FAB$C_STMCR:  rfm = "stmcr"; break;
+ 	  }
+-	mode = s.st_mode & 0777;
++	mode = s.st_mode & 07777;
+      }
+    else strcpy (rat_buf, "rat=cr");
+    
+@@ -1729,7 +1729,7 @@
+ #ifdef REAL_UNIX_SYSTEM
+ 	int u;
+ 	
+-	u = umask (mask & 0777);
++	u = umask (mask & 07777);
+ 	if (default_umask == 0) default_umask = u;
+ #endif
+      }
diff -ruN --exclude=CVS /var/jail/data/usr/ports/editors/jed.orig/files/patch-unix /var/jail/data/usr/ports/editors/jed/files/patch-unix
--- /var/jail/data/usr/ports/editors/jed.orig/files/patch-unix	Wed Dec 31 21:00:00 1969
+++ /var/jail/data/usr/ports/editors/jed/files/patch-unix	Wed Oct 13 14:53:42 2004
@@ -0,0 +1,11 @@
+--- src/unix.c.orig	Wed Oct 13 14:52:19 2004
++++ src/unix.c	Wed Oct 13 14:52:32 2004
+@@ -722,7 +722,7 @@
+ # endif
+ #endif
+ 
+-   *mode = m & 0777;
++   *mode = m & 07777;
+ 
+    if (S_ISDIR(m)) return (2);
+    return(1);
--- jed-0.99.16.patch ends here ---

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: pav 
State-Changed-When: Sat Oct 16 12:37:42 GMT 2004 
State-Changed-Why:  
Asked maintainer for approval. 


Responsible-Changed-From-To: freebsd-ports-bugs->pav 
Responsible-Changed-By: pav 
Responsible-Changed-When: Sat Oct 16 12:37:42 GMT 2004 
Responsible-Changed-Why:  
Handle. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72652 

From: Pav Lucistnik <pav@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, renato@galle.com.br,
	s_bschmi@ira.uka.de
Cc:  
Subject: Re: ports/72652: [PATCH] editors/jed: Fix a bug - lost setuid and
	setgid bits when save file
Date: Sat, 16 Oct 2004 14:37:39 +0200

 Dear maintainer of FreeBSD port editors/jed, please take a look at
 
 http://www.freebsd.org/cgi/query-pr.cgi?q=72652
 
 Do you approve this patch?
 
 -- 
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 
 If God didn't mean for us to juggle, tennis balls wouldn't come three
 to a can.
State-Changed-From-To: feedback->closed 
State-Changed-By: pav 
State-Changed-When: Mon Nov 1 19:12:18 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72652 
>Unformatted:
