conf/84221: Wrong permissions on /etc/opiekeys

Eygene A. Ryabinkin freebsd at rea.mbslab.kiae.ru
Fri Jul 29 12:50:25 GMT 2005


The following reply was made to PR conf/84221; it has been noted by GNATS.

From: "Eygene A. Ryabinkin" <freebsd at rea.mbslab.kiae.ru>
To: FreeBSD-gnats-submit at FreeBSD.org, freebsd-bugs at FreeBSD.org
Cc:  
Subject: Re: conf/84221: Wrong permissions on /etc/opiekeys
Date: Fri, 29 Jul 2005 16:50:13 +0400

  The patch follows: (for /usr/src/contrib/opie)
  Thanks to Andrey Chernov for his commit to the -CURRENT.
 
 --- libopie/readrec.c.orig	Fri Jul 29 16:40:21 2005
 +++ libopie/readrec.c	Fri Jul 29 16:40:36 2005
 @@ -94,7 +94,7 @@
    FILE *f = NULL;
    int rval = -1;
  
 -  if (!(f = __opieopen(KEY_FILE, 0, 0644))) {
 +  if (!(f = __opieopen(KEY_FILE, 0, 0600))) {
  #if DEBUG
      syslog(LOG_DEBUG, "__opiereadrec: __opieopen(KEY_FILE..) failed!");
  #endif /* DEBUG */
 --- libopie/writerec.c.orig	Fri Jul 29 16:40:11 2005
 +++ libopie/writerec.c	Fri Jul 29 16:40:59 2005
 @@ -65,13 +65,13 @@
  
    switch(i) {
    case 0:
 -    if (!(f = __opieopen(KEY_FILE, 1, 0644)))
 +    if (!(f = __opieopen(KEY_FILE, 1, 0600)))
        return -1;
      if (fseek(f, opie->opie_recstart, SEEK_SET))
        return -1;
      break;
    case 1:
 -    if (!(f = __opieopen(KEY_FILE, 2, 0644)))
 +    if (!(f = __opieopen(KEY_FILE, 2, 0600)))
        return -1;
      break;
    default:
 --- Makefile.in.orig	Fri Jul 29 16:45:26 2005
 +++ Makefile.in	Fri Jul 29 16:44:13 2005
 @@ -237,7 +237,7 @@
  	@echo "Making sure OPIE database file exists";
  	@touch $(KEY_FILE)
  	@echo "Changing permissions of OPIE database file"
 -	@chmod 0644 $(KEY_FILE)
 +	@chmod 0600 $(KEY_FILE)
  	@echo "Changing ownership of OPIE database file"
  	@$(CHOWN) $(OWNER) $(KEY_FILE)
  	@chgrp $(GROUP) $(KEY_FILE)
 -- 
  rea


More information about the freebsd-bugs mailing list