[opensuse-buildservice] [PATCH] run build under uid 0 when userootforbuild is used
osc --userootforbuild setup the --build_uid to 0:0. When both specified, --userootforbuild has bigger priority. --- osc/build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osc/build.py b/osc/build.py index 9f97063..6879a2e 100644 --- a/osc/build.py +++ b/osc/build.py @@ -442,6 +442,8 @@ def main(apiurl, opts, argv): build_uid = config['build-uid'] if opts.build_uid: build_uid = opts.build_uid + if opts.userootforbuild: + build_uid='0:0' if build_uid: buildidre = re.compile('^[0-9]{1,5}:[0-9]{1,5}$') if build_uid == 'caller': -- 1.7.10.4 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Am Montag, 25. Juni 2012, 16:24:47 schrieb Michal Vyskocil:
osc --userootforbuild setup the --build_uid to 0:0. When both specified, --userootforbuild has bigger priority. --- osc/build.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/osc/build.py b/osc/build.py index 9f97063..6879a2e 100644 --- a/osc/build.py +++ b/osc/build.py @@ -442,6 +442,8 @@ def main(apiurl, opts, argv): build_uid = config['build-uid'] if opts.build_uid: build_uid = opts.build_uid + if opts.userootforbuild: + build_uid='0:0'
hm, the problem is that needs also to be permitted by the admin on server side. So, just with this it will not have the same result as on the server. I think we should export the used user via buildinfo.xml ...
if build_uid: buildidre = re.compile('^[0-9]{1,5}:[0-9]{1,5}$') if build_uid == 'caller':
-- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Hi, On 2012-06-25 16:24:47 +0200, Michal Vyskocil wrote:
osc --userootforbuild setup the --build_uid to 0:0. When both specified, --userootforbuild has bigger priority. --- osc/build.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/osc/build.py b/osc/build.py index 9f97063..6879a2e 100644 --- a/osc/build.py +++ b/osc/build.py @@ -442,6 +442,8 @@ def main(apiurl, opts, argv): build_uid = config['build-uid'] if opts.build_uid: build_uid = opts.build_uid + if opts.userootforbuild: + build_uid='0:0'
Normally this is not needed (given that you have a "# needsrootforbuild" line in your spec file). Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Wed, Jun 27, 2012 at 02:22:54PM +0200, Marcus Hüwe wrote:
Hi,
On 2012-06-25 16:24:47 +0200, Michal Vyskocil wrote:
osc --userootforbuild setup the --build_uid to 0:0. When both specified, --userootforbuild has bigger priority. --- osc/build.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/osc/build.py b/osc/build.py index 9f97063..6879a2e 100644 --- a/osc/build.py +++ b/osc/build.py @@ -442,6 +442,8 @@ def main(apiurl, opts, argv): build_uid = config['build-uid'] if opts.build_uid: build_uid = opts.build_uid + if opts.userootforbuild: + build_uid='0:0'
Normally this is not needed (given that you have a "# needsrootforbuild" line in your spec file).
Well, the osc build --userootforbuild did not work for me even the #needsrootforbuild was not present. Adding --build_uid=0:0 made my build as root. Regards Michal Vyskocil
On 2012-06-27 14:32:24 +0200, Michal Vyskocil wrote:
On Wed, Jun 27, 2012 at 02:22:54PM +0200, Marcus Hüwe wrote:
Hi,
On 2012-06-25 16:24:47 +0200, Michal Vyskocil wrote:
osc --userootforbuild setup the --build_uid to 0:0. When both specified, --userootforbuild has bigger priority. --- osc/build.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/osc/build.py b/osc/build.py index 9f97063..6879a2e 100644 --- a/osc/build.py +++ b/osc/build.py @@ -442,6 +442,8 @@ def main(apiurl, opts, argv): build_uid = config['build-uid'] if opts.build_uid: build_uid = opts.build_uid + if opts.userootforbuild: + build_uid='0:0'
Normally this is not needed (given that you have a "# needsrootforbuild" line in your spec file).
Well, the osc build --userootforbuild did not work for me even the #needsrootforbuild was not present.
It _has_ to be present otherwise "build" still builds as "abuild" (or the passed abuild user). That is in order to build as root the following is necessary: - "osc build --userootforbuild" - a "# needsrootforbuild" line in the spec file
Adding --build_uid=0:0 made my build as root.
Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Wed, Jun 27, 2012 at 02:43:40PM +0200, Marcus Hüwe wrote:
On 2012-06-27 14:32:24 +0200, Michal Vyskocil wrote:
On Wed, Jun 27, 2012 at 02:22:54PM +0200, Marcus Hüwe wrote:
Hi,
On 2012-06-25 16:24:47 +0200, Michal Vyskocil wrote:
osc --userootforbuild setup the --build_uid to 0:0. When both specified, --userootforbuild has bigger priority. --- osc/build.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/osc/build.py b/osc/build.py index 9f97063..6879a2e 100644 --- a/osc/build.py +++ b/osc/build.py @@ -442,6 +442,8 @@ def main(apiurl, opts, argv): build_uid = config['build-uid'] if opts.build_uid: build_uid = opts.build_uid + if opts.userootforbuild: + build_uid='0:0'
Normally this is not needed (given that you have a "# needsrootforbuild" line in your spec file).
Well, the osc build --userootforbuild did not work for me even the #needsrootforbuild was not present.
It _has_ to be present otherwise "build" still builds as "abuild" (or the passed abuild user). That is in order to build as root the following is necessary: - "osc build --userootforbuild" - a "# needsrootforbuild" line in the spec file
Adding --build_uid=0:0 made my build as root.
OK, thanks for the help - that was not clear to me Regards Michal Vyskocil
participants (3)
-
Adrian Schröter
-
Marcus Hüwe
-
Michal Vyskocil