cvs commit: ALFS/nALFS/src/lib get_url.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Sun Jan 11 13:09:09 PST 2004


kpfleming    04/01/11 14:09:09

  Modified:    nALFS    Tag: branch-1_2 CHANGES bootstrap.configure
               nALFS/src/handlers Tag: branch-1_2 stage.c su.c
               nALFS/src/lib Tag: branch-1_2 get_url.c
  Log:
  backport bug fixes from HEAD branch
  update version for 1.2.1 release
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.2.2.1 +8 -0      ALFS/nALFS/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/CHANGES,v
  retrieving revision 1.2.2.2
  retrieving revision 1.2.2.2.2.1
  diff -u -r1.2.2.2 -r1.2.2.2.2.1
  --- CHANGES	21 Dec 2003 17:24:09 -0000	1.2.2.2
  +++ CHANGES	11 Jan 2004 21:09:08 -0000	1.2.2.2.2.1
  @@ -1,3 +1,11 @@
  +2004-01-11  tag v1_2_1
  +
  +2004-01-11  Kevin P. Fleming
  +
  +        * Backport bug fixes for su and stage handlers from HEAD branch.
  +        * Backport bug fix for get_url function from HEAD branch.
  +        * Version updated to 1.2.1.
  +
   2003-12-21  tag v1_2_0
   
   2003-12-21  Kevin P. Fleming
  
  
  
  1.7.2.3.2.1 +1 -1      ALFS/nALFS/bootstrap.configure
  
  Index: bootstrap.configure
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/bootstrap.configure,v
  retrieving revision 1.7.2.3
  retrieving revision 1.7.2.3.2.1
  diff -u -r1.7.2.3 -r1.7.2.3.2.1
  --- bootstrap.configure	21 Dec 2003 17:24:09 -0000	1.7.2.3
  +++ bootstrap.configure	11 Jan 2004 21:09:08 -0000	1.7.2.3.2.1
  @@ -1,6 +1,6 @@
   #!/bin/bash
   cat << "EOF"
  -AC_INIT(nALFS,1.2.0,[],nALFS)
  +AC_INIT(nALFS,1.2.1,[],nALFS)
   AC_CONFIG_AUX_DIR([gnubuild])
   AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])
   AM_MAINTAINER_MODE
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.12.4.1  +3 -8      ALFS/nALFS/src/handlers/stage.c
  
  Index: stage.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/stage.c,v
  retrieving revision 1.12
  retrieving revision 1.12.4.1
  diff -u -r1.12 -r1.12.4.1
  --- stage.c	6 Nov 2003 17:01:13 -0000	1.12
  +++ stage.c	11 Jan 2004 21:09:08 -0000	1.12.4.1
  @@ -103,23 +103,18 @@
   static INLINE int change_to_user(const char *user)
   {
   	struct passwd *pw;
  -	FILE *fp;
   
   
  -	if ((fp = fopen("/etc/passwd", "r")) == NULL) {
  -		Nprint_h_err("Unable to open /etc/passwd: %s",
  -			strerror(errno));
  -		return -1;
  -	}
  +	setpwent();
   
   	/* getpwnam() is failing in chroot() */
  -	while ((pw = fgetpwent(fp))) {
  +	while ((pw = getpwent())) {
   		if (strcmp(pw->pw_name, user) == 0) {
   			break;
   		}
   	}
   
  -	fclose(fp);
  +	endpwent();
   
   	if (pw == NULL) {
   		Nprint_h_err("User %s doesn't exist.", user);
  
  
  
  1.12.4.1  +3 -8      ALFS/nALFS/src/handlers/su.c
  
  Index: su.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/su.c,v
  retrieving revision 1.12
  retrieving revision 1.12.4.1
  diff -u -r1.12 -r1.12.4.1
  --- su.c	6 Nov 2003 17:01:13 -0000	1.12
  +++ su.c	11 Jan 2004 21:09:08 -0000	1.12.4.1
  @@ -98,23 +98,18 @@
   static INLINE int change_to_user(const char *user)
   {
   	struct passwd *pw;
  -	FILE *fp;
   
   
  -	if ((fp = fopen("/etc/passwd", "r")) == NULL) {
  -		Nprint_h_err("Unable to open /etc/passwd: %s",
  -			strerror(errno));
  -		return -1;
  -	}
  +	setpwent();
   
   	/* getpwnam() is failing in chroot() */
  -	while ((pw = fgetpwent(fp))) {
  +	while ((pw = getpwent())) {
   		if (strcmp(pw->pw_name, user) == 0) {
   			break;
   		}
   	}
   
  -	fclose(fp);
  +	endpwent();
   
   	if (pw == NULL) {
   		Nprint_h_err("User %s doesn't exist.", user);
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.4.1   +10 -1     ALFS/nALFS/src/lib/get_url.c
  
  Index: get_url.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/lib/get_url.c,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- get_url.c	24 Oct 2003 03:28:16 -0000	1.2
  +++ get_url.c	11 Jan 2004 21:09:09 -0000	1.2.4.1
  @@ -28,6 +28,7 @@
   #include <errno.h>
   #include <sys/types.h>
   #include <sys/stat.h>
  +#include <libgen.h>
   
   #ifdef HAVE_CONFIG_H
   #include <config.h>
  @@ -47,12 +48,20 @@
   	int status = -1;
   	int command_status;
   	struct stat stat_buf;
  +	char *dirname_buf;
   	char *temp_file_name;
   	    
   
   	/* Construct a temporary filename */
   
  -	temp_file_name = xstrdup(".nALFS.XXXXXX");
  +	/* have to make a writable copy of the destination path in case
  +	   the dirname() function wants to modify it
  +	*/
  +	dirname_buf = xstrdup(destination);
  +	temp_file_name = xstrdup(dirname(dirname_buf));
  +	xfree(dirname_buf);
  +	append_str(&temp_file_name, "/");
  +	append_str(&temp_file_name, ".nALFS.XXXXXX");
   	if (create_temp_file(temp_file_name))
   		goto free_all_and_return;
   	/* There is a small risk that another user could create a symlink
  
  
  



More information about the alfs-log mailing list