faubackup/src faubackup-scatter.c,1.1,1.2

[email protected]
Newsgroups gmane.comp.sysutils.backup.faubackup.cvs
Message-ID <[email protected]>
Update of /cvsroot/faubackup/faubackup/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28536/src

Modified Files:
	faubackup-scatter.c 
Log Message:
only use lchown when available


Index: faubackup-scatter.c
===================================================================
RCS file: /cvsroot/faubackup/faubackup/src/faubackup-scatter.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** faubackup-scatter.c	10 Dec 2003 21:32:45 -0000	1.1
--- faubackup-scatter.c	10 Dec 2003 23:30:29 -0000	1.2
***************
*** 367,371 ****
  static const int SET_MODE	= 2;
  static const int SET_TIME	= 4;
! static const int SET_ALL = -1;
  
  /*
--- 367,372 ----
  static const int SET_MODE	= 2;
  static const int SET_TIME	= 4;
! static const int SET_LINK_OWNER = 8;
! static const int SET_ALL = SET_OWNER | SET_MODE | SET_TIME;
  
  /*
***************
*** 394,398 ****
--- 395,407 ----
  	/* set owner, unset suid/sgid bits if chown fails */
  	if( flags & SET_OWNER ) {
+ #ifdef HAVE_LCHOWN
  		ret = lchown(path, st->st_uid, st->st_gid);
+ #else
+ 		if( flags & SET_LINK_OWNER ) {
+ 			ret = 0; /* simply ignore if it's not supported */
+ 		} else {
+ 			ret = chown(path, st->st_uid, st->st_gid);
+ 		}
+ #endif
  		if( ret < 0 && errno == EPERM ) {
  			cannot_set_owner();
***************
*** 695,699 ****
  	free( link );
  
! 	set_perms( path, st, SET_OWNER );
  }
  
--- 704,708 ----
  	free( link );
  
! 	set_perms( path, st, SET_OWNER | SET_LINK_OWNER);
  }
  




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.