gnu: ktsuss: Fix paths.

  • Done
  • quality assurance status badge
Details
3 participants
  • Jan Nieuwenhuizen
  • Ludovic Courtès
  • Raghav Gururajan
Owner
unassigned
Submitted by
Raghav Gururajan
Severity
normal
R
R
Raghav Gururajan wrote on 27 Apr 2020 15:37
(address . guix-patches@gnu.org)(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
20200427093702.16f9d953.raghavgururajan@disroot.org

From ecdb9f73f2aa9854f03ace199fcc4c4547a2be49 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <raghavgururajan@disroot.org>
Date: Mon, 27 Apr 2020 09:32:43 -0400
Subject: [PATCH] gnu: ktsuss: Fix paths.

* gnu/packages/admin.scm (ktsuss): Fix paths.
---
gnu/packages/admin.scm | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 236eebe53c..9316e974bc 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -150,24 +150,25 @@
(list "--enable-sudo=yes")
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'patch-sudo-path
- (lambda* (#:key inputs #:allow-other-keys)
+ (add-after 'unpack 'patch-paths
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (substitute* "src/ktsuss.c"
+ (("/usr/sbin:/usr/local/sbin:/sbin")
+ "~/.guix-profile/sbin"))
(substitute* "configure.ac"
+ (("supath=`which su 2>/dev/null`")
+ "supath=/run/setuid-programs/su")
(("sudopath=`which sudo 2>/dev/null`")
- (string-append "sudopath="
- (string-append (assoc-ref inputs "sudo")
- "/bin/sudo"))))
+ "sudopath=/run/setuid-programs/sudo"))
#t)))))
(native-inputs
`(("autoconf" ,autoconf)
- ("autogen" ,autogen)
("automake" ,automake)
("libtool" ,libtool)
("pkg-config" ,pkg-config)))
(inputs
`(("glib" ,glib)
- ("gtk+" ,gtk+-2)
- ("sudo" ,sudo)))
+ ("gtk+" ,gtk+-2)))
(synopsis "Graphical front end for @command{su}")
(description
"Ktsuss stands for ``Keep the @command{su} simple, stupid''.
--
2.26.2
J
J
Jan Nieuwenhuizen wrote on 27 Apr 2020 18:21
(name . Raghav Gururajan)(address . raghavgururajan@disroot.org)(address . 40901@debbugs.gnu.org)
87k120527o.fsf@gnu.org
Raghav Gururajan writes:

Hello Raghav,

Toggle quote (7 lines)
> From ecdb9f73f2aa9854f03ace199fcc4c4547a2be49 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <raghavgururajan@disroot.org>
> Date: Mon, 27 Apr 2020 09:32:43 -0400
> Subject: [PATCH] gnu: ktsuss: Fix paths.
>
> * gnu/packages/admin.scm (ktsuss): Fix paths.

I changed the commit message to

Toggle snippet (8 lines)
gnu: ktsuss: Use setuid "su" and "sudo" commands.

This has ktsudo actually gain root access.

* gnu/packages/admin.scm (ktsuss)[arguments]: Instead of <sudo>/bin/{su,sudo}
file names, use the setuid' verrsions.

When there is a fix being made, a short explanation is nice to have.
What was wrong that the file name were changed, what was fixed?

Also, we are (mainly) fixing the file names of SU and SUDO, not PATHs.

Toggle quote (4 lines)
> - (add-after 'unpack 'patch-sudo-path
> - (lambda* (#:key inputs #:allow-other-keys)
> + (add-after 'unpack 'patch-paths

Renamed to 'patch-file-names'

Toggle quote (2 lines)
> + (lambda* (#:key inputs outputs #:allow-other-keys)

Parameters inputs and outputs are both not used; I changed this to

+ (lambda _

Toggle quote (4 lines)
> + (substitute* "src/ktsuss.c"
> + (("/usr/sbin:/usr/local/sbin:/sbin")
> + "~/.guix-profile/sbin"))

No way! :-)

I removed/did not apply this change.

Toggle quote (9 lines)
> (substitute* "configure.ac"
> + (("supath=`which su 2>/dev/null`")
> + "supath=/run/setuid-programs/su")
> (("sudopath=`which sudo 2>/dev/null`")
> - (string-append "sudopath="
> - (string-append (assoc-ref inputs "sudo")
> - "/bin/sudo"))))
> + "sudopath=/run/setuid-programs/sudo"))

LGTM!

Can you please remember to test a program before submitting it? And I
mean not only check if "it runs", but also if it is actually useful?

Pushed to master with these changes.

Greetings,
janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
R
R
Raghav Gururajan wrote on 28 Apr 2020 09:43
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . 40901@debbugs.gnu.org)
20200428034314.37f199f3.raghavgururajan@disroot.org
Hello Jan!

Toggle quote (3 lines)
> Can you please remember to test a program before submitting it? And I
> mean not only check if "it runs", but also if it is actually useful?

Sorry. I have attached a patch with this email to make ktsuss work correctly.

This, along with #40922, allows me to fix SpaceFM.

Regards,
RG.
From a1d5a14bb634fe52201fdde9ffbd3e385b89d234 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <raghavgururajan@disroot.org>
Date: Tue, 28 Apr 2020 03:34:05 -0400
Subject: [PATCH 2/2] gnu: ktsuss: Disable sudo.

* gnu/packages/admin.scm (ktsuss): Disable sudo.

Disabled sudo-backend as there is an unknown bug in upstream.
Ktsuss now fall-back to using su-backend, which works correctly.
---
gnu/packages/admin.scm | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index cb3de79713..356fd1cdf4 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -146,9 +146,7 @@
(file-name (git-file-name name version))))
(build-system glib-or-gtk-build-system)
(arguments
- `(#:configure-flags
- (list "--enable-sudo=yes")
- #:phases
+ `(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-file-names
(lambda _
--
2.26.2
J
J
Jan Nieuwenhuizen wrote on 28 Apr 2020 19:13
(name . Raghav Gururajan)(address . raghavgururajan@disroot.org)(address . 40901@debbugs.gnu.org)
87sggncz4s.fsf@gnu.org
Raghav Gururajan writes:

Hello Raghav,

Toggle quote (6 lines)
>> Can you please remember to test a program before submitting it? And I
>> mean not only check if "it runs", but also if it is actually useful?
>
> Sorry. I have attached a patch with this email to make ktsuss work
> correctly.

Hmm, I experienced no problem when I tested it. What did you observe
(see my question below).

Toggle quote (10 lines)
> From a1d5a14bb634fe52201fdde9ffbd3e385b89d234 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <raghavgururajan@disroot.org>
> Date: Tue, 28 Apr 2020 03:34:05 -0400
> Subject: [PATCH 2/2] gnu: ktsuss: Disable sudo.
>
> * gnu/packages/admin.scm (ktsuss): Disable sudo.
>
> Disabled sudo-backend as there is an unknown bug in upstream.
> Ktsuss now fall-back to using su-backend, which works correctly.

Having a like this is great. Two remarks

* please move it above the "* gnu/packages/admin" line
* it would be great if you can add link to the ktsuss bug tracer about
this "unknown" bug

Without any indication about what the bug is or how it can be
reproduced, it becomes hard to remove this workaround.

Other than that: LGTM.

Greetings,
janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
R
R
Raghav Gururajan wrote on 30 Apr 2020 10:39
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . 40901@debbugs.gnu.org)
20200430043918.0f36cbc0.raghavgururajan@disroot.org
Hi Jan!
Toggle quote (4 lines)
> Having a like this is great. Two remarks
>
> * please move it above the "* gnu/packages/admin" line

Done!

Toggle quote (3 lines)
> * it would be great if you can add link to the ktsuss bug tracer about
> this "unknown" bug

It is not reported yet. I could report it, but I am not sure how to debug
deeper to pin-point the exact part of the sudo-backend that has the bug. So I
have changed commit-message to fit situation.

Please find the revised patch attached with this email.

Regards,
RG.
From 736ac4d7940bdc9982f05b5b58fbaf32f3d6aec4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <raghavgururajan@disroot.org>
Date: Thu, 30 Apr 2020 04:26:05 -0400
Subject: [PATCH] gnu: ktsuss: Revert back to su from sudo.

Sudo authentication does not work in guix system. Disabled sudo-backend.
Ktsuss will now use su-backend, which is the default.

* gnu/packages/admin.scm (ktsuss): Revert back to su from sudo.
---
gnu/packages/admin.scm | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index cb3de79713..356fd1cdf4 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -146,9 +146,7 @@
(file-name (git-file-name name version))))
(build-system glib-or-gtk-build-system)
(arguments
- `(#:configure-flags
- (list "--enable-sudo=yes")
- #:phases
+ `(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-file-names
(lambda _
--
2.26.2
R
R
Raghav Gururajan wrote on 30 Apr 2020 15:54
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . 40901@debbugs.gnu.org)
20200430095407.5384bf61.raghavgururajan@disroot.org
Hi Jan!

Please ignore #40901. Let's leave it closed.

Regards,
RG.
L
L
Ludovic Courtès wrote on 2 May 2020 16:23
control message for bug #40901
(address . control@debbugs.gnu.org)
87v9le5sb8.fsf@gnu.org
tags 40901 fixed
close 40901
quit
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 40901
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