diff options
-rw-r--r-- | system/gnsu/README | 16 | ||||
-rw-r--r-- | system/gnsu/doinst.sh | 19 | ||||
-rw-r--r-- | system/gnsu/douninst.sh | 6 | ||||
-rw-r--r-- | system/gnsu/gnsu-root-terminal.desktop | 35 | ||||
-rw-r--r-- | system/gnsu/gnsu.SlackBuild | 111 | ||||
-rw-r--r-- | system/gnsu/gnsu.info | 10 | ||||
-rw-r--r-- | system/gnsu/gnsu.man | 36 | ||||
-rw-r--r-- | system/gnsu/icons/128.png | bin | 0 -> 2570 bytes | |||
-rw-r--r-- | system/gnsu/icons/16.png | bin | 0 -> 321 bytes | |||
-rw-r--r-- | system/gnsu/icons/22.png | bin | 0 -> 593 bytes | |||
-rw-r--r-- | system/gnsu/icons/24.png | bin | 0 -> 633 bytes | |||
-rw-r--r-- | system/gnsu/icons/32.png | bin | 0 -> 839 bytes | |||
-rw-r--r-- | system/gnsu/icons/48.png | bin | 0 -> 1330 bytes | |||
-rw-r--r-- | system/gnsu/icons/64.png | bin | 0 -> 1855 bytes | |||
-rw-r--r-- | system/gnsu/slack-desc | 19 | ||||
-rw-r--r-- | system/gnsu/translations.diff | 68 |
16 files changed, 320 insertions, 0 deletions
diff --git a/system/gnsu/README b/system/gnsu/README new file mode 100644 index 0000000000..5d1855eeb5 --- /dev/null +++ b/system/gnsu/README @@ -0,0 +1,16 @@ +gnsu (grahical frontend for sudo) + +gnsu (gnsu's not su) allows a permitted user to execute a command with +superuser privileges, or as any other user. gnsu shows a graphical +dialog requesting the user password to allow the execution of the +specified command. The user, or a group the user is part of, has to be +allowed access to launching applications using sudo. + +gnsu is similar to gksu, and can act as a replacement for it. If gksu is +not installed, gnsu will create symlinks for /usr/bin/{gksu,gksudo}, +so software that expects to run commands via gksu will work with gnsu. + +Note: you may have seen a gnsu-0.3.1 package from SalixOS. Do not ask +for this build to be "upgraded" to 0.3.1; it already includes Salix's +(very minor) changes. I used the version number of the latest official +gnsu release from its GitHub repository. diff --git a/system/gnsu/doinst.sh b/system/gnsu/doinst.sh new file mode 100644 index 0000000000..8fb5e807ab --- /dev/null +++ b/system/gnsu/doinst.sh @@ -0,0 +1,19 @@ +# based on Slackware's doinst.sh for vim. + +# If gksu isn't installed, we create symlinks so gnsu acts as a +# replacement for gksu and gksudo. +if [ ! -r usr/bin/gksu ]; then + ( cd usr/bin ; ln -sf gnsu gksu ) + ( cd usr/bin ; ln -sf gnsu gksudo ) +fi + +# rest is standard desktop/icon stuff. +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/system/gnsu/douninst.sh b/system/gnsu/douninst.sh new file mode 100644 index 0000000000..7a1d892de4 --- /dev/null +++ b/system/gnsu/douninst.sh @@ -0,0 +1,6 @@ +# if gksu and gksudo exist as broken symlinks, that means we just +# uninstalled the gnsu package, and gksu isn't installed. removepkg +# doesn't remove these symlinks, so we do it in post. + +[ ! -e /usr/bin/gksu -a -h /usr/bin/gksu ] && rm -f /usr/bin/gksu +[ ! -e /usr/bin/gksudo -a -h /usr/bin/gksudo ] && rm -f /usr/bin/gksudo diff --git a/system/gnsu/gnsu-root-terminal.desktop b/system/gnsu/gnsu-root-terminal.desktop new file mode 100644 index 0000000000..91c7748d39 --- /dev/null +++ b/system/gnsu/gnsu-root-terminal.desktop @@ -0,0 +1,35 @@ +[Desktop Entry] +Name=Root Terminal (gnsu) +Name[cs]=Terminál uživatele root (gnsu) +Name[da]=Root-terminal (gnsu) +Name[es]=Terminal de «Root» (gnsu) +Name[fr]=Terminal administrateur (gnsu) +Name[hu]=Rendszergazda terminál (gnsu) +Name[it]=Terminale root (gnsu) +Name[ko]=루트 터미널 (gnsu) +Name[lt]=Administratoriaus terminalas (gnsu) +Name[nl]=Terminal als root (gnsu) +Name[pl]=Terminal użytkownika root (gnsu) +Name[pt_BR]=Terminal como Root (gnsu) +Name[sv]=Root-terminal (gnsu) +Comment=Opens a terminal as the root user, using gnsu to ask for the password +Comment[cs]=Otevře terminál pod uživatelem root, na heslo se dotáže přes gnsu +Comment[da]=Åbner en terminal som brugeren root, og bruger gnsu til at spørge om adgangskoden. +Comment[de]=Root-Terminal +Comment[es]=Abre un terminal como el usuario «root» utilizando gnsu para preguntar la contraseña. +Comment[fr]=Ouvrir un terminal en tant qu'administrateur, en utilisant gnsu pour demander le mot de passe +Comment[hu]=Megnyit egy rendszergazda terminált, a gnsu-t használva a jelszó bekérésére +Comment[it]=Apre un terminale come root, usando gnsu per la richiesta della password +Comment[ko]=루트 사용자로 터미널을 열고, GKSU로 열쇠글을 물어봅니다 +Comment[lt]=Atveria terminalą 'root' naudotojo teisėmis, naudojant gnsu slaptažodžiui įvesti +Comment[nl]=Start een terminal als de root-gebruiker waarbij gnsu gebruikt wordt om het wachtwoord te vragen. +Comment[pl]=Uruchamia terminal użytkownika root, używając gnsu do wczytania hasła +Comment[pt_BR]=Abre um terminal como usuário root, usando o gnsu para pedir a senha +Comment[sv]=Öppnar en terminal som root-användaren och använder gnsu för att fråga efter lösenordet +Exec=gnsu /usr/bin/xfce4-terminal +Icon=gnsu-root-terminal +StartupNotify=true +Terminal=false +X-MultipleArgs=false +Type=Application +Categories=GTK;Utility;TerminalEmulator; diff --git a/system/gnsu/gnsu.SlackBuild b/system/gnsu/gnsu.SlackBuild new file mode 100644 index 0000000000..afa10259d7 --- /dev/null +++ b/system/gnsu/gnsu.SlackBuild @@ -0,0 +1,111 @@ +#!/bin/bash + +# Slackware build script for gnsu + +# Written by B. Watson (urchlay@slackware.uk) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# Didier Spaier suggested (on the mailing list) that someone should +# package this, as a replacement for gksu. Sure, why not? + +# I'm not a gksu user. If I were, I might not consider this a proper +# replacement. The main feature it's missing is, it doesn't grab the +# keyboard & mouse when prompting for a password (to prevent the user +# accidentally typing the password into some other window). Also, gksu +# will prompt for a command to run, if you don't supply one; gnsu just +# prints the --help message (on stderr, not in a dialog) and exits. + +# OTOH, this is written in python3 and is pretty self +# contained. There's no compiled code and no extra dependencies. + +# I've added a .desktop and icon, so this can replace gksu's "root +# terminal" menu entry... not that that ever *worked* because +# gksu.desktop executes "gksu /usr/bin/terminal", and Slackware +# doesn't have any such binary. It's supposed to be xfce4-terminal, +# but nobody ever got around to updating the .desktop file when XFCE +# changed its terminal binary's name. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=gnsu +VERSION=${VERSION:-0.3} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} +ARCH=noarch + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod -h 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod -h 644 {} + + +# SalixOS has a "gnsu-0.3.1" package. The only differences between +# upstream's 0.3 and salix's 0.3.1 are that salix added an Irish +# (Gaelic?) translation, and modified the Portuguese translations +# incorrectly (fixed the "a a", but got rid of the "Por favor"). This +# patch adds the Irish translation and fixes the Portuguese +# *correctly*. +patch -p1 < $CWD/translations.diff + +# We ship our own man page. It was generated by running 'make man', +# but manually edited to set the date in the .TH line (txt2tags wasn't +# expanding the %%mtime macro). Doing it this way also means we don't +# have to have REQUIRES="txt2tags". +cat $CWD/$PRGNAM.man > man/$PRGNAM.man + +# The make command doesn't include "all" because we don't want +# it regenerating the man page. The -j1 may not be necessary, but +# removing it won't speed things up anyway (since we're not compiling +# anything). +make -j1 mo install PREFIX=/usr DESTDIR=$PKG + +gzip -9 $PKG/usr/man/man*/* + +# .desktop is just a modified copy of the one from gksu, and the icons +# are unmodified from gksu. +APP=gnsu-root-terminal +mkdir -p $PKG/usr/share/applications +cat $CWD/$APP.desktop > $PKG/usr/share/applications/$APP.desktop + +for i in $CWD/icons/*.png; do + px="$( basename $i | cut -d. -f1 )" + sz="${px}x${px}" + dir=$PKG/usr/share/icons/hicolor/$sz/apps + mkdir -p $dir + cat $i > $dir/$APP.png +done + +mkdir -p $PKG/usr/share/pixmaps +ln -s ../icons/hicolor/48x48/apps/$APP.png $PKG/usr/share/pixmaps/$APP.png + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a COPYING README* $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild + +# The douninst.sh removes the gksu and gksudo symlinks on package +# removal, but only if they're actually symlinks to gnsu. +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh +cat $CWD/douninst.sh > $PKG/install/douninst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/gnsu/gnsu.info b/system/gnsu/gnsu.info new file mode 100644 index 0000000000..6c22edfe4f --- /dev/null +++ b/system/gnsu/gnsu.info @@ -0,0 +1,10 @@ +PRGNAM="gnsu" +VERSION="0.3" +HOMEPAGE="https://github.com/gapan/gnsu" +DOWNLOAD="https://github.com/gapan/gnsu/archive/0.3/gnsu-0.3.tar.gz" +MD5SUM="d4409eb0de674548f0af45cce7b7d9f5" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/system/gnsu/gnsu.man b/system/gnsu/gnsu.man new file mode 100644 index 0000000000..12904285f3 --- /dev/null +++ b/system/gnsu/gnsu.man @@ -0,0 +1,36 @@ +.TH "gnsu" 8 "Dec 11, 2024" "George Vlahavas" + +.SH NAME +.P +gnsu \- Gnsu's Not SU +.SH SYNOPSIS +.P +\fBgnsu\fR [\fISUDOOPTIONS\fR] \fICOMMAND\fR [\fICOMMANDOPTIONS\fR] +.SH DESCRIPTION +.P +\fBgnsu\fR allows a permitted user to execute a \fIcommand\fR with superuser privileges, or as any other user. \fBgnsu\fR shows a graphical dialog requesting the user password to allow the execution of the specified command. +.P +As \fBgnsu\fR uses \fBsudo\fR as its backend, the password that you need to provide is your current user's password, \fInot\fR the \fIroot\fR user password. In any case, the user name whose password you need to enter is shown in the gnsu graphical dialog. +.P +The user, or a group the user is part of, has to be allowed access to launching applications using \fBsudo\fR. This can be accomplished by editing the \fB/etc/sudoers\fR file using the \fBvisudo\fR command. For example, adding the following line somewhere in the \fB/etc/sudoers\fR file will allow user \fIgeorge\fR to run any command using \fBsudo\fR and by extension, \fBgnsu\fR: +.P +george ALL=(ALL) ALL +.P +Note that you can use any option that \fBsudo\fR has with \fBgnsu\fR, as \fBgnsu\fR passes all arguments it is given to \fBsudo\fR. For example, you can use the \fBsudo\fR option \fB\-u\fR to run a command as another user, instead of running it as the superuser, which is the default behaviour. Consult the \fBsudo\fR man page for more details about those options. +.SH GENERAL OPTIONS + +.TP +\fB\-h\fR, \fB\-\-help\fR +Prints a usage message briefly summarizing all command\-line options +and exits. + +.SH WEBSITE +.P +https://github.com/gapan/gnsu +.SH AUTHORS +.P +gnsu was written by George Vlahavas <vlahavas~at~gmail~dot~com> +.SH SEE ALSO +.P +\fBsudo\fR(8), \fBsu\fR(8), \fBvisudo\fR(8), \fBsudoers\fR(5) + diff --git a/system/gnsu/icons/128.png b/system/gnsu/icons/128.png Binary files differnew file mode 100644 index 0000000000..b0ebbebb11 --- /dev/null +++ b/system/gnsu/icons/128.png diff --git a/system/gnsu/icons/16.png b/system/gnsu/icons/16.png Binary files differnew file mode 100644 index 0000000000..28d5e0e23a --- /dev/null +++ b/system/gnsu/icons/16.png diff --git a/system/gnsu/icons/22.png b/system/gnsu/icons/22.png Binary files differnew file mode 100644 index 0000000000..5163557690 --- /dev/null +++ b/system/gnsu/icons/22.png diff --git a/system/gnsu/icons/24.png b/system/gnsu/icons/24.png Binary files differnew file mode 100644 index 0000000000..019e382380 --- /dev/null +++ b/system/gnsu/icons/24.png diff --git a/system/gnsu/icons/32.png b/system/gnsu/icons/32.png Binary files differnew file mode 100644 index 0000000000..3fb2319e85 --- /dev/null +++ b/system/gnsu/icons/32.png diff --git a/system/gnsu/icons/48.png b/system/gnsu/icons/48.png Binary files differnew file mode 100644 index 0000000000..bcdcb83bf1 --- /dev/null +++ b/system/gnsu/icons/48.png diff --git a/system/gnsu/icons/64.png b/system/gnsu/icons/64.png Binary files differnew file mode 100644 index 0000000000..f150bb667e --- /dev/null +++ b/system/gnsu/icons/64.png diff --git a/system/gnsu/slack-desc b/system/gnsu/slack-desc new file mode 100644 index 0000000000..75bf674db5 --- /dev/null +++ b/system/gnsu/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +gnsu: gnsu (grahical frontend for sudo) +gnsu: +gnsu: gnsu (gnsu's not su) allows a permitted user to execute a command with +gnsu: superuser privileges, or as any other user. gnsu shows a graphical +gnsu: dialog requesting the user password to allow the execution of the +gnsu: specified command. The user, or a group the user is part of, has to be +gnsu: allowed access to launching applications using sudo. +gnsu: +gnsu: +gnsu: +gnsu: diff --git a/system/gnsu/translations.diff b/system/gnsu/translations.diff new file mode 100644 index 0000000000..70d95a8422 --- /dev/null +++ b/system/gnsu/translations.diff @@ -0,0 +1,68 @@ +diff -Naur gnsu-0.3/po/ie.po gnsu-0.3.patched/po/ie.po +--- gnsu-0.3/po/ie.po 1969-12-31 19:00:00.000000000 -0500 ++++ gnsu-0.3.patched/po/ie.po 2025-01-17 17:01:35.920414846 -0500 +@@ -0,0 +1,28 @@ ++# SOME DESCRIPTIVE TITLE. ++# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER ++# This file is distributed under the same license as the PACKAGE package. ++# ++# Translators: ++# Caarmi, 2021 ++msgid "" ++msgstr "" ++"Project-Id-Version: Salix\n" ++"Report-Msgid-Bugs-To: \n" ++"POT-Creation-Date: 2013-11-24 00:01+0200\n" ++"PO-Revision-Date: 2021-09-02 21:59+0000\n" ++"Last-Translator: Caarmi\n" ++"Language-Team: Interlingue (http://www.transifex.com/gapan/salix/language/ie/)\n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=UTF-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++"Language: ie\n" ++"Plural-Forms: nplurals=2; plural=(n != 1);\n" ++ ++#: src/gnsu-askpass:59 ++#, python-format ++msgid "Please enter the password for %s:" ++msgstr "Ples intrar li contrasigne de %s:" ++ ++#: src/gnsu-askpass:61 ++msgid "Permission denied" ++msgstr "Permission es refusat" +diff -Naur gnsu-0.3/po/pt.po gnsu-0.3.patched/po/pt.po +--- gnsu-0.3/po/pt.po 2021-01-08 09:30:31.000000000 -0500 ++++ gnsu-0.3.patched/po/pt.po 2025-01-17 17:02:15.307411140 -0500 +@@ -23,7 +23,7 @@ + #: src/gnsu-askpass:59 + #, python-format + msgid "Please enter the password for %s:" +-msgstr "Por favor, insira a a palavra-passe para %s:" ++msgstr "Por favor, insira a palavra-passe para %s:" + + #: src/gnsu-askpass:61 + msgid "Permission denied" +diff -Naur gnsu-0.3/po/pt_BR.po gnsu-0.3.patched/po/pt_BR.po +--- gnsu-0.3/po/pt_BR.po 2021-01-08 09:30:31.000000000 -0500 ++++ gnsu-0.3.patched/po/pt_BR.po 2025-01-17 17:02:19.571410738 -0500 +@@ -22,7 +22,7 @@ + #: src/gnsu-askpass:59 + #, python-format + msgid "Please enter the password for %s:" +-msgstr "Por favor, insira a a senha para %s:" ++msgstr "Por favor, insira a senha para %s:" + + #: src/gnsu-askpass:61 + msgid "Permission denied" +diff -Naur gnsu-0.3/po/pt_PT.po gnsu-0.3.patched/po/pt_PT.po +--- gnsu-0.3/po/pt_PT.po 2021-01-08 09:30:31.000000000 -0500 ++++ gnsu-0.3.patched/po/pt_PT.po 2025-01-17 17:02:23.737410346 -0500 +@@ -23,7 +23,7 @@ + #: src/gnsu-askpass:59 + #, python-format + msgid "Please enter the password for %s:" +-msgstr "Por favor, insira a a palavra-passe para %s:" ++msgstr "Por favor, insira a palavra-passe para %s:" + + #: src/gnsu-askpass:61 + msgid "Permission denied" |