GNU bug report logs - #73451
privileged-program - Wrong type argument in position 1 (expecting struct)

Previous Next

Package: guix;

Reported by: Giovanni Biscuolo <g <at> xelera.eu>

Date: Tue, 24 Sep 2024 14:05:01 UTC

Severity: normal

Done: Giovanni Biscuolo <g <at> xelera.eu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Giovanni Biscuolo <g <at> xelera.eu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#73451: closed (privileged-program - Wrong type argument in
 position 1 (expecting struct))
Date: Tue, 24 Sep 2024 17:09:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 24 Sep 2024 19:07:37 +0200
with message-id <87y13hf09y.fsf <at> xelera.eu>
and subject line Re: bug#73451: privileged-program - Wrong type argument in position 1 (expecting struct)
has caused the debbugs.gnu.org bug report #73451,
regarding privileged-program - Wrong type argument in position 1 (expecting struct)
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
73451: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73451
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Giovanni Biscuolo <g <at> xelera.eu>
To: bug-guix <at> gnu.org
Subject: privileged-program - Wrong type argument in position 1 (expecting
 struct)
Date: Tue, 24 Sep 2024 16:03:55 +0200
[Message part 3 (text/plain, inline)]
Hello,

is this a bug or I'm using privileged-programs the wrng way?

I'm trying to switch from setuid-programs to the new privileged-programs
but I get an error trying to reconfigure.

--8<---------------cut here---------------start------------->8---

g <at> ken ~$ guix describe
Generation 3    Sep 24 2024 15:42:22    (current)
  guix 60dfa7f
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 60dfa7f673344f7f81faafc225191c4492f9dd03

--8<---------------cut here---------------end--------------->8---

this is the configuration for privileged-programs:

--8<---------------cut here---------------start------------->8---

(operating-system

[...]

	;; libvirt clients need spice-client-glib-usb-acl-helper suid
	;; to be able to selectively share USB devices
	(privileged-programs
	 (append (list (privileged-program
			(program (file-append spice-gtk "/libexec/spice-client-glib-usb-acl-helper"))
			(setuid? #t))
		       %default-privileged-programs)))


--8<---------------cut here---------------end--------------->8---

I've changed the above code since I was using setuid-programs before [1]
and It was running.

this is the error I get when trying to reconfigure:

--8<---------------cut here---------------start------------->8---

g <at> ken ~$ sudo guix system reconfigure /etc/config.scm 
In guix/scripts/system.scm:
   1311:4 19 (_)
In ice-9/boot-9.scm:
  1752:10 18 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   689:37 17 (thunk)
   1330:8 16 (call-with-build-handler #<procedure 7f497a4a5600 at g…> …)
  2210:25 15 (run-with-store #<store-connection 256.100 7f497a490280> …)
In guix/scripts/system.scm:
    853:2 14 (_ _)
    727:8 13 (_ #<store-connection 256.100 7f497a490280>)
In gnu/system.scm:
  1323:19 12 (operating-system-derivation _)
In gnu/services.scm:
  1240:16 11 (_ _)
In guix/monads.scm:
    487:9 10 (_ _)
In gnu/services.scm:
  1243:36  9 (_ _)
In srfi/srfi-1.scm:
   586:29  8 (map1 (#<<service> type: #<service-type firmware 7f4…> …))
   586:29  7 (map1 (#<<service> type: #<service-type linux-bare-m…> …))
   586:17  6 (map1 (#<<service> type: #<service-type privileged-p…> …))
In gnu/services.scm:
    897:9  5 (privileged-program->activation-gexp _)
In srfi/srfi-1.scm:
   586:29  4 (map1 (#<<privileged-program> program: #<file-append…> …))
   586:17  3 (map1 ((#<<privileged-program> program: #<file-ap…> …) …))
In gnu/services.scm:
   899:36  2 (_ (#<<privileged-program> program: #<file-append #<…> …))
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): (#<<privileged-program> program: #<file-append #<package shadow <at> 4.13 gnu/packages/admin.scm:1021 7f4980b0c160> "/bin/passwd"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package shadow <at> 4.13 gnu/packages/admin.scm:1021 7f4980b0c160> "/bin/chfn"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package shadow <at> 4.13 gnu/packages/admin.scm:1021 7f4980b0c160> "/bin/sg"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package shadow <at> 4.13 gnu/packages/admin.scm:1021 7f4980b0c160> "/bin/su"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package shadow <at> 4.13 gnu/packages/admin.scm:1021 7f4980b0c160> "/bin/newgrp"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package shadow <at> 4.13 gnu/packages/admin.scm:1021 7f4980b0c160> "/bin/newuidmap"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package shadow <at> 4.13 gnu/packages/admin.scm:1021 7f4980b0c160> "/bin/newgidmap"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package inetutils <at> 2.5 gnu/packages/admin.scm:961 7f4980b0c210> "/bin/ping"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package inetutils <at> 2.5 gnu/packages/admin.scm:961 7f4980b0c210> "/bin/ping6"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package sudo <at> 1.9.16 gnu/packages/admin.scm:2038 7f4980b0f420> "/bin/sudo"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package sudo <at> 1.9.16 gnu/packages/admin.scm:2038 7f4980b0f420> "/bin/sudoedit"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package fuse <at> 2.9.9 gnu/packages/linux.scm:3915 7f498082c210> "/bin/fusermount"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package fuse <at> 3.10.5 gnu/packages/linux.scm:3842 7f498082c2c0> "/bin/fusermount3"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package util-linux <at> 2.37.4 gnu/packages/linux.scm:2213 7f498082adc0> "/bin/mount"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f> #<<privileged-program> program: #<file-append #<package util-linux <at> 2.37.4 gnu/packages/linux.scm:2213 7f498082adc0> "/bin/umount"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f>)

--8<---------------cut here---------------end--------------->8---

Any hint please?

Happy hacking! Gio'



[1] this is the diff:

--8<---------------cut here---------------start------------->8---

-	(setuid-programs
-	 (append (list (setuid-program
-			(program (file-append spice-gtk "/libexec/spice-client-glib-usb-acl-helper"))))
-		 %setuid-programs))
+	(privileged-programs
+	 (append (list (privileged-program
+			(program (file-append spice-gtk "/libexec/spice-client-glib-usb-acl-helper"))
+			(setuid? #t))
+		       %default-privileged-programs)))

--8<---------------cut here---------------end--------------->8---

-- 
Giovanni Biscuolo

Xelera IT Infrastructures
[signature.asc (application/pgp-signature, inline)]
[Message part 5 (message/rfc822, inline)]
From: Giovanni Biscuolo <g <at> xelera.eu>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>,
 Giovanni Biscuolo via Bug reports for GNU Guix <bug-guix <at> gnu.org>,
 73451-done <at> debbugs.gnu.org
Subject: Re: bug#73451: privileged-program - Wrong type argument in position
 1 (expecting struct)
Date: Tue, 24 Sep 2024 19:07:37 +0200
[Message part 6 (text/plain, inline)]
Hi Tobias,

thank you for your immediate reply!

Tobias Geerinckx-Rice <me <at> tobias.gr> writes:

> Hi Giovanni,
>
> (Did you mean to immediately open a bug report?)

yes, I really missed my obvious mistake, sorry!

[...]

>>	 (append (list (privileged-program
>>			(program (file-append spice-gtk "/libexec/spice-client-glib-usb-acl-helper"))
>>			(setuid? #t))
>>		       %default-privileged-programs)))
>
> You should really [configure your editor to] indent your code.

isn't it?  As you can see "%default-privileged-programs" is aligned with
the previous "(privileged-program": AFAIU it's a correct inidentation

(for the record I'm using Emacs in scheme-mode with the default
indentation rules)

[...]

>   (append (list foo %another-list))

sorry, I "simply" missed to understand I was using a list inside a list
:-(

forgive me, I'm closing this NON-bug

Happy hacking! Gio'

-- 
Giovanni Biscuolo

Xelera IT Infrastructures
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.