Bug 655483

Summary: [patch] libproxy support in libzypp
Product: [openSUSE] openSUSE 11.4 Reporter: Duncan Mac-Vicar <dmacvicar>
Component: libzyppAssignee: Duncan Mac-Vicar <dmacvicar>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P2 - High CC: dimstar, dwmw2, ma, mls, nathaniel, vuntz
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 558539    
Attachments: libproxy sysconfig support
Updated patch

Description Duncan Mac-Vicar 2010-11-23 12:19:40 UTC
This bug is to track the libproxy support in libzypp

Right now the current patches are in libproxy branch on git
Comment 1 Duncan Mac-Vicar 2010-11-23 12:24:14 UTC
Created attachment 401780 [details]
libproxy sysconfig support

This patchs adds support to sysconfig for libproxy.

There are two points that need review:

Right now, the module implements

	virtual bool operator<(const base_extension&) const {
            if (getuid == 0)
		return true;
            return false;            
	}

which means the plugin will be put first, if we run as root.

Also in the module loading macro:

MM_MODULE_INIT_EZ(sysconfig_config_extension, true, NULL, NULL);

It seems the true parameter needs to be replaced by a conditional for this module to be used, something if_exists?(/etc/sysconfig)
Comment 2 Dominique Leuenberger 2010-11-23 12:43:51 UTC
> MM_MODULE_INIT_EZ(sysconfig_config_extension, true, NULL, NULL);

i'd suggest replacing true with getuid() == 0; thus not going through the whole init if you're not root and invalidate the module completely for other users (which would have their own session normally).
Comment 3 Nathaniel McCallum 2010-11-23 14:38:03 UTC
1. a test function needs to be used instead of MM_MODULE_INIT_EZ(..., true) to determine if /etc/sysconfig/proxy exists.
2. getuid needs '()'
3. cleanup spacing to match our style (particularly around funcion calls)
4. Remove the left over comment (copy/paste) from envvar

Let me know when you've got these fixed and we'll merge upstream.
Comment 4 Duncan Mac-Vicar 2010-11-23 15:04:12 UTC
Nathaniel, I sent it upstream ( http://code.google.com/p/libproxy/issues/detail?id=150 )

I will post the updated version there.
Comment 5 Duncan Mac-Vicar 2010-11-23 15:32:17 UTC
Created attachment 401819 [details]
Updated patch

New version of the patch with suggestions.

Could not attach it in code.google.com
Comment 6 Vincent Untz 2010-11-26 12:34:01 UTC
Dominique: do we want to include it in our package now?
Comment 7 Dominique Leuenberger 2010-11-26 13:25:36 UTC
I think that's certainly something we should do, yes...
Comment 8 Vincent Untz 2010-12-06 18:57:35 UTC
Submitted to G:F (sr#54906).

Duncan: I don't know if there's anything else you want to track in this bug, or if your patch covers everything you needed. If the latter, then we can close the bug, I guess.
Comment 9 Duncan Mac-Vicar 2011-02-07 11:57:06 UTC
This can be closed for now.