[Box Backup-dev] COMMIT r892 - box/chris/merge/lib/common

Ben Summers boxbackup-dev at fluffy.co.uk
Fri Sep 1 09:16:38 BST 2006


On 31 Aug 2006, at 23:35, subversion at fluffy.co.uk wrote:

> Author: chris
> Date: 2006-08-31 23:35:51 +0100 (Thu, 31 Aug 2006)
> New Revision: 892
>
> Modified:
>    box/chris/merge/lib/common/UnixUser.cpp
> Log:
> Disable all calls to set*id() on Win32 (doesn't work) (refs #3)

Wouldn't just returning 1 from those functions on Win32 be a better  
plan?

Use #defines to replace them in the Win32 header files with that  
modified function if necessary.

Ben




>
>
> Modified: box/chris/merge/lib/common/UnixUser.cpp
> ===================================================================
> --- box/chris/merge/lib/common/UnixUser.cpp	2006-08-31 22:33:05 UTC  
> (rev 891)
> +++ box/chris/merge/lib/common/UnixUser.cpp	2006-08-31 22:35:51 UTC  
> (rev 892)
> @@ -78,8 +78,12 @@
>  	if(mRevertOnDestruction)
>  	{
>  		// Revert to "real" user and group id of the process
> +		#ifdef WIN32
> +		if(0)
> +		#else
>  		if(::setegid(::getgid()) != 0
>  			|| ::seteuid(::getuid()) != 0)
> +		#endif
>  		{
>  			THROW_EXCEPTION(CommonException, CouldNotRestoreProcessUser)
>  		}
> @@ -101,8 +105,12 @@
>  	if(Temporary)
>  	{
>  		// Change temporarily (change effective only)
> +		#ifdef WIN32
> +		if(0)
> +		#else
>  		if(::setegid(mGID) != 0
>  			|| ::seteuid(mUID) != 0)
> +		#endif
>  		{
>  			THROW_EXCEPTION(CommonException, CouldNotChangeProcessUser)
>  		}
> @@ -112,9 +120,13 @@
>  	}
>  	else
>  	{
> -		// Change perminantely (change all UIDs and GIDs)
> +		// Change permanently (change all UIDs and GIDs)
> +		#ifdef WIN32
> +		if(0)
> +		#else
>  		if(::setgid(mGID) != 0
>  			|| ::setuid(mUID) != 0)
> +		#endif
>  		{
>  			THROW_EXCEPTION(CommonException, CouldNotChangeProcessUser)
>  		}
>
> _______________________________________________
> Boxbackup-dev mailing list
> Boxbackup-dev at fluffy.co.uk
> http://lists.warhead.org.uk/mailman/listinfo/boxbackup-dev




More information about the Boxbackup-dev mailing list