privileged-program - Wrong type argument in position 1 (expecting struct)

  • Done
  • quality assurance status badge
Details
2 participants
  • Giovanni Biscuolo
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Giovanni Biscuolo
Severity
normal

Debbugs page

Giovanni Biscuolo wrote 6 months ago
(address . bug-guix@gnu.org)
87cyktgnck.fsf@xelera.eu
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.

Toggle snippet (10 lines)
g@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


this is the configuration for privileged-programs:

Toggle snippet (16 lines)
(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)))



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:

Toggle snippet (41 lines)
g@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@2.37.4 gnu/packages/linux.scm:2213 7f498082adc0> "/bin/umount"> setuid?: #t setgid?: #f user: 0 group: 0 capabilities: #f>)


Any hint please?

Happy hacking! Gio'



[1] this is the diff:

Toggle snippet (13 lines)
- (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)))


--
Giovanni Biscuolo

Xelera IT Infrastructures
-----BEGIN PGP SIGNATURE-----

iQJABAEBCgAqFiEERcxjuFJYydVfNLI5030Op87MORIFAmbyxssMHGdAeGVsZXJh
LmV1AAoJENN9DqfOzDkSJE0P/3d9sH5HOsxKNKKKmIeMRHJ+WJSjGSpwksdPZUEF
jxezgYpP6V8BQwRG939KrfI5HBmGXmmTedyJu9JOOszY8QhnSjHAdBwncKi192hO
yO6r4aqVopDiif4Yi5Ab35Q7q9apmqjEk8H5VqE9IJMUhQe9IggXwLb7gW3phyod
oB2DAw51atSkyArKQ23tvDgCdCogwNtLtAL/aTZkiqBoMT4wzNq5mP5Apq8JPThY
6IVqehxGv1xylFqCI3eR7Jf6HbQ5OEzjdQitlBLR381W1LGaXvKopiBpkG0RDjFp
klGQqzzffy1/Bxx+sii5oogPkt/4jHyxMK2X/qugr30Km352LclfF76xelP3HsU3
3ELKAz3bstKod0Fpt8DcSKeHpRTByWOVp2stWlksSeeMIl9uNDnmgGBNTIbzE3MU
d/rdXRohkF76PBkARrfQ6kzSh6PAIJyChaMNxRBEbzbcz6xXa1sYOOpK0JEBJh+O
BdssFMeviA2/btDQ3bNY+uFkrxbAy6rH5yaIyklHIdlWBAGLDLT619SOBLqkG/8M
jki1BPO8CnDPCvEwfEQDANcz1E3UZORcLagBs0s4CLmkzJonMWfOeWSeejH5p+Jk
o6TenxEgCeSYhquSsRa5DSkl/t7BF2JLzYcj1U5VQhxs7bYW8Ou2l48haXGXcXhs
DhJc
=pFyH
-----END PGP SIGNATURE-----

Tobias Geerinckx-Rice wrote 6 months ago
Re: bug#73451: privileged-program - Wrong ty pe argument in position 1 (expecting struct)
(name . Giovanni Biscuolo)(address . g@xelera.eu)(name . Giovanni Biscuolo via Bug reports for GNU Guix)(address . bug-guix@gnu.org)(address . 73451@debbugs.gnu.org)
3534A21B-162B-43AA-8572-30D65E0A003B@tobias.gr
Hi Giovanni,

(Did you mean to immediately open a bug report?)

On 24 September 2024 14:03:55 UTC, Giovanni Biscuolo via Bug reports for GNU Guix <bug-guix@gnu.org> wrote:
Toggle quote (5 lines)
> (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.

The error will immediately become obvious, and future ones like it will too. You meant to write

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

not

(append (list foo %another-list))

which creates that incorrectly nested your Guix is freaking out about.

Kind regards,

T G-R

Sent on the go. Excuse or enjoy my brevity.
Giovanni Biscuolo wrote 6 months ago
Re: bug#73451: privileged-program - Wrong type argument in position 1 (expecting struct)
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(name . Giovanni Biscuolo via Bug reports for GNU Guix)(address . bug-guix@gnu.org)(address . 73451-done@debbugs.gnu.org)
87y13hf09y.fsf@xelera.eu
Hi Tobias,

thank you for your immediate reply!

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

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

yes, I really missed my obvious mistake, sorry!

[...]

Toggle quote (7 lines)
>> (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)

[...]

Toggle quote (2 lines)
> (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
-----BEGIN PGP SIGNATURE-----

iQJABAEBCgAqFiEERcxjuFJYydVfNLI5030Op87MORIFAmby8doMHGdAeGVsZXJh
LmV1AAoJENN9DqfOzDkSg68QAIf514MXGLuiWos12bvkt6LaYn5mA/8kv3cf4NMq
PMZ5p8YmetxwwzJ0uUYiuDQFF1tf4sWDkpUbcjyrBKhPzySDIo0KxVIkfa6ACf1o
NjMoNBelU1ldhVL7oy3cQf4dHApRii0Mj3LDij5myjWAb38V0ra3nBINZ6cRs1CQ
YGDAmw3WxC58+BG5ygMOWpDZ8ZYE7WyYzA5E5SUINC0q+VYzfKkBf/CpN8IflVz8
1vW/PAt+xBmE5Xnbt6i8zIrQjg8yi4AtB64ABTDugCJPZaPOAE9VgoYsQ3iQTQQy
UjREV8GCV7y9DVmkMIGxqyqrnn0h06M/XLL7/u/GZpAQtkaMOuvGJSABNyAqaUhy
3j9L7cWJrwhh5X7dTEB+BgGJb/E0uRcKJUk4M6XAm3K/NNedri8qK/ioNH6Kmzd0
ZrHni7YcpZJHtInlzBTMqczNo4G5N8dviKuVE2FPTISlF4NxWDbbp7V9MA1MVhVn
LYhtL3OQhGAIX9dZrJgcEyVWV7B5yH4jeRdd8vszdcwrGps1X2osQGqtIA2vL7h8
RhoQad02yanVlsHTXUbmHbmG70wFDtCpfoHgI4SjN2SpHj5bgMPO111eDeZhrSQ1
83w1eF28ddK6MWKOTCZDJkhshRGN+TOblrPc0ltyiAXpeg7uWb6YaN4UdlBlc3P2
dH0x
=oxyL
-----END PGP SIGNATURE-----

Closed
Tobias Geerinckx-Rice wrote 6 months ago
Re: bug#73451: privileged-program - Wrong ty pe argument in position 1 (expecting struct)
(name . Giovanni Biscuolo)(address . g@xelera.eu)(name . Giovanni Biscuolo via Bug reports for GNU Guix)(address . bug-guix@gnu.org)(address . 73451-done@debbugs.gnu.org)
04819BD8-1F77-45DC-B481-96C453A42130@tobias.gr
Hi Gio',

I tried to account for my client's proportional font and even counted the spaces, and even checked the Web interface which uses fixed-width fonts (attached). It does not look like what I think you're describing.

Anyway, we're drifting, and I'm happy that your 'issue' was so easily resolved!

Kind regards,

T G-R

Sent on the go. Excuse or enjoy my brevity.
?
Your comment

This issue is archived.

To comment on this conversation send an email to 73451@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 73451
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help