From e59072ee5301a9d9722f6d26ce78338697a5d7f9 Mon Sep 17 00:00:00 2001 From: luisgulo Date: Sun, 4 Jun 2023 16:47:17 +0200 Subject: [PATCH] Subida a GITEA --- .directory | 2 ++ .gambas/FMAIN | Bin 0 -> 2992 bytes .gitignore | 0 .hidden/CHANGELOG | 3 +++ .icon.png | Bin 0 -> 11063 bytes .project | 25 +++++++++++++++++++++++ .settings | 23 ++++++++++++++++++++++ .src/FMain.class | 47 ++++++++++++++++++++++++++++++++++++++++++++ .src/FMain.class~ | 48 +++++++++++++++++++++++++++++++++++++++++++++ .src/FMain.form | 41 ++++++++++++++++++++++++++++++++++++++ .src/FMain.form~ | 41 ++++++++++++++++++++++++++++++++++++++ .startup | 10 ++++++++++ AjustarSudo.gambas | Bin 0 -> 4754 bytes README.md | 0 sudo.png | Bin 0 -> 1145 bytes 15 files changed, 240 insertions(+) create mode 100644 .directory create mode 100644 .gambas/FMAIN create mode 100644 .gitignore create mode 100644 .hidden/CHANGELOG create mode 100644 .icon.png create mode 100644 .project create mode 100644 .settings create mode 100644 .src/FMain.class create mode 100644 .src/FMain.class~ create mode 100644 .src/FMain.form create mode 100644 .src/FMain.form~ create mode 100644 .startup create mode 100755 AjustarSudo.gambas create mode 100644 README.md create mode 100644 sudo.png diff --git a/.directory b/.directory new file mode 100644 index 0000000..06dab1c --- /dev/null +++ b/.directory @@ -0,0 +1,2 @@ +[Desktop Entry] +Icon=./.icon.png diff --git a/.gambas/FMAIN b/.gambas/FMAIN new file mode 100644 index 0000000000000000000000000000000000000000..656d68d5f55b7b1180f79543b5b1c6c8dd7041ac GIT binary patch literal 2992 zcma)8&2JM&6o0$^$`{!b91Zzzy`E@2|U(chdji3;45H3V4V3AO&R-X>`OKrM+zHixI>+jotaLW$J)># zU9%62wwYqtq~QlNZnp0opcZW#qlU7X>6Vap*VHREo5aAH2`xeIIR?zh=?lZse z99?oe(|dJP+_8RGt@_zIW6`u4=GdOs;;J}^mGFAFe(-MddKQ(;Z(|Ol{OzYHeAD<| zSKk@DLGR%!sBewdXdT}T^6}lFFVuHedwG`eyen8^@;}3e=$~J)9goiYLH$OlAw8-@ zUfFh?;6~APs-JLo;p1i)*+IEk^R-fIM0s_wL?QGi8r}v)TT#)qH|15|kBHGlzwXz3 zC5qzXhujfILdO#gS#ttW^}Q&tL;3he`=|nyvN7fsG1lIA` zJ$=x05SL(C*rM);X4td?$KMe&CByv>P%V~vzgWSlcHvgsr;Aw%tASIobsPvNz!K+Z zw&HlR6+65|OF`fVb7E0eq`w*`W|WS^!t$~>C)SUEuOAhcOIH@k5yl~Hw;k3|OI ziQ25)jQqg)%*OHc{Fj&BU%gsVUd|~Wb3H%o_2t$VFZa%TM?hlzHK8{Sr{pQj%RLo+ z@1}#(Mo@x8!wzggq=xfK=sEn>cGSENfT{-!KfZCBQmk}e|S=!zYNx8a}GY_|#DE~kG{dJ!g66VxHo zYKZP-yDq7GOS&#yb0Syvj+v@~dy_7DH+`CSeY-~Uj^{))@5$SI1s1AR2h-5MzKTJr literal 0 HcmV?d00001 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.hidden/CHANGELOG b/.hidden/CHANGELOG new file mode 100644 index 0000000..7b11e57 --- /dev/null +++ b/.hidden/CHANGELOG @@ -0,0 +1,3 @@ +* Tue Aug 17 2021 luisgulo 1.0.1 +- Lanzamiento inicial + diff --git a/.icon.png b/.icon.png new file mode 100644 index 0000000000000000000000000000000000000000..e70d7c18f6b4583db53bea3874655941225cd6a7 GIT binary patch literal 11063 zcmb_?WmHsO^!A-(V2Gi+RZu|(=@1xNNtMn4l#oD+oZq zDG%$%ADk$U8CP|6BcHq4Y5>6T$`OlI>Ia~D^t7~Jo?O(#Y#7imzPLj}t0N%sr5+EG z#oosr`O|6KKwFQ{iP`__$!Fsxih(T=1u8(LjzW5WFW5l@GsYy~|Kt{iI=K|$Ai~ZP zHm1rhxy2F%m52OMR;^W2U{a)hmi5vyllJ~1@Mjy*`ftz~TXED*ASf{kzL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gm(IoX58I3|w~%3p}TG+GR8jiJqk+j(AVzUPS6c7ZFCG=BPGuw*zdC0)>#xpc^HA zSW4~yPZQlrsJU8St1)csZ9<(^N^qij2J+~h9rxpnMGA0JX_5r9=6R%KfjWUp_1*6-h6^7}`kJ;C zgH2hzAA+_PpzOtt@TX#a4i-&xeG9i@Jc2QHQ* zr~+jKe2kXPp69ZtORCbMBv~M)7NTW@15h-NSQ;f`Z9-pk1HF6{`RE5JDUv9Hy$E!& zefw=RiFc=aAUotw*Tq`>IkZ1Li3#(7o|J-Nf zVqYKW#>+E`ZQRMqrcK`?93Cd^ziix+Qz&l^fLSA9$a=PUE*G;1YgiN;bo$s2H6D$i zA;}g9G=&k#t;C=sa|#;=!FKJgsK;E!=b<}O#_WGHEj6*0mXx% AWdHyG literal 0 HcmV?d00001 diff --git a/.project b/.project new file mode 100644 index 0000000..b3da6b3 --- /dev/null +++ b/.project @@ -0,0 +1,25 @@ +# Gambas Project File 3.0 +Title=ajustarsudo +Startup=FMain +Icon=sudo.png +Version=1.0.1 +Component=gb.image +Component=gb.gui +Component=gb.form +Description="Ajustar SUDO para el usuario actual.\nSolo se permite si conoce la clave de root" +Authors="luisgulo@soloconlinux.org.es" +TabSize=2 +Language=es_ES +SourcePath=/home/luisgulo/ProyectosGAMBAS/SOURCEs +Maintainer=luisgulo +Vendor=SoloConLinux +Address=luisgulo@gmail.com +Url=https://repositorio.soloconlinux.org.es +License=General Public License +PackageName=ajustarsudo-1.0.1 +CreateEachDirectory=1 +Packager=1 +Systems=debian +Menus=debian:"Applications/System/Administration" +Categories=debian:"System" +Groups=debian:"admin" diff --git a/.settings b/.settings new file mode 100644 index 0000000..ce93749 --- /dev/null +++ b/.settings @@ -0,0 +1,23 @@ +[Breakpoints] +Count=0 + +[DebugWindow] +Count=0 + +[Executable] +DoNotIncrementVersion=False +NoTestModule=False +Path="AjustarSudo.gambas" + +[OpenFile] +File[1]=".src/FMain.form" +Active=2 +File[2]=".src/FMain.class:0.14" +Count=2 + +[Package] +Dir="~/ProyectosGAMBAS/INSTALADOR/AjustarSudo/" + +[Watches] +Count=0 + diff --git a/.src/FMain.class b/.src/FMain.class new file mode 100644 index 0000000..3dac691 --- /dev/null +++ b/.src/FMain.class @@ -0,0 +1,47 @@ +' Gambas class file + + +Public Sub Form_Open() + ' Cargamos usuario actual + txtUsuario.Text = System.User.Name + System.Shell = "/bin/bash" +End + +Public Sub btnSalir_Click() + Quit +End + +Public Sub btnAjustarSudo_Click() + Dim txtAccion As String + Message.Title = Me.Text + ' Comprobar Clave ROOT + If IsNull(txtClaveRoot.Text) Then + ' Clave Vacia + + Message.Error("Error: Debe de escribir la clave de 'root'" & gb.crlf & "La clave no puede estar vacia") + Else + ' Clave introducida + If SudoComodo.Value Then + ' Ajustar sudo en modo Cómodo + txtAccion = "SUDO COMODO" + 'Shell "echo '" & txtUsuario.Text & " ALL = (ALL) NOPASSWD: ALL' > /tmp/autorizado_" & txtUsuario.Text + 'Shell "echo -n '" & txtClaveRoot.Text & "' |su -c 'cp /tmp/autorizado_" & txtUsuario.Text & " /tmp/kk/'" + Shell "echo -n '" & txtClaveRoot.Text & "' |su -c 'echo " & txtUsuario.Text & " ALL = \\(ALL\\) NOPASSWD: ALL > /etc/sudoers.d/autorizado_" & txtUsuario.Text & "'" + Endif + If SudoSeguro.Value Then + ' Ajustar sudo en modo Seguro + txtAccion = "SUDO SEGURO" + 'Shell "echo '" & txtUsuario.Text & " ALL=(ALL:ALL) ALL' > /tmp/autorizado_" & txtUsuario.Text + 'Shell "echo -n '" & txtClaveRoot.Text & "' |su -c 'cp /tmp/autorizado_" & txtUsuario.Text & " /tmp/kk/'" + Shell "echo -n '" & txtClaveRoot.Text & "' |su -c 'echo " & txtUsuario.Text & " ALL=\\(ALL:ALL\\) ALL > /etc/sudoers.d/autorizado_" & txtUsuario.Text & "'" + Endif + If SinSudo.Value Then + 'Eliminar SUDO + txtAccion = "SIN SUDO" + Shell "echo -n '" & txtClaveRoot.Text & "' |su -c 'echo \\# Usuario sin SUDO > /etc/sudoers.d/autorizado_" & txtUsuario.Text & "'" + Endif + Message.Info("Configurado " & txtAccion & " para " & txtUsuario.Text) + Quit + Endif + +End diff --git a/.src/FMain.class~ b/.src/FMain.class~ new file mode 100644 index 0000000..6e9dfdb --- /dev/null +++ b/.src/FMain.class~ @@ -0,0 +1,48 @@ +' Gambas class file + + +Public Sub Form_Open() + ' Cargamos usuario actual + txtUsuario.Text = System.User.Name + System.Shell = "/bin/bash" +End + +Public Sub btnSalir_Click() + Quit +End + +Public Sub btnAjustarSudo_Click() + Dim SalidaShell As String + Dim txtAccion As String + Message.Title = Me.Text + ' Comprobar Clave ROOT + If IsNull(txtClaveRoot.Text) Then + ' Clave Vacia + + Message.Error("Error: Debe de escribir la clave de 'root'" & gb.crlf & "La clave no puede estar vacia") + Else + ' Clave introducida + If SudoComodo.Value Then + ' Ajustar sudo en modo Cómodo + txtAccion = "SUDO COMODO" + 'Shell "echo '" & txtUsuario.Text & " ALL = (ALL) NOPASSWD: ALL' > /tmp/autorizado_" & txtUsuario.Text + 'Shell "echo -n '" & txtClaveRoot.Text & "' |su -c 'cp /tmp/autorizado_" & txtUsuario.Text & " /tmp/kk/'" + Shell "echo -n '" & txtClaveRoot.Text & "' |su -c 'echo " & txtUsuario.Text & " ALL = \\(ALL\\) NOPASSWD: ALL > /etc/sudoers.d/autorizado_" & txtUsuario.Text & "'" + Endif + If SudoSeguro.Value Then + ' Ajustar sudo en modo Seguro + txtAccion = "SUDO SEGURO" + 'Shell "echo '" & txtUsuario.Text & " ALL=(ALL:ALL) ALL' > /tmp/autorizado_" & txtUsuario.Text + 'Shell "echo -n '" & txtClaveRoot.Text & "' |su -c 'cp /tmp/autorizado_" & txtUsuario.Text & " /tmp/kk/'" + Shell "echo -n '" & txtClaveRoot.Text & "' |su -c 'echo " & txtUsuario.Text & " ALL=\\(ALL:ALL\\) ALL > /etc/sudoers.d/autorizado_" & txtUsuario.Text & "'" + Endif + If SinSudo.Value Then + 'Eliminar SUDO + txtAccion = "SIN SUDO" + Shell "echo -n '" & txtClaveRoot.Text & "' |su -c 'echo \\# Usuario sin SUDO > /etc/sudoers.d/autorizado_" & txtUsuario.Text & "'" + Endif + Message.Info("Configurado " & txtAccion & " para " & txtUsuario.Text) + Quit + Endif + +End diff --git a/.src/FMain.form b/.src/FMain.form new file mode 100644 index 0000000..0902597 --- /dev/null +++ b/.src/FMain.form @@ -0,0 +1,41 @@ +# Gambas Form File 3.0 + +{ Form Form + MoveScaled(0,0,50,39) + Text = ("Ajustar SUDO") + Icon = Picture["sudo.png"] + { txtClaveRoot TextBox + MoveScaled(24,9,24,4) + Password = True + } + { SudoComodo RadioButton + MoveScaled(2,15,46,4) + Text = ("Sudo Cómodo (sin pedir contraseña)") + Value = True + } + { SudoSeguro RadioButton + MoveScaled(2,20,46,4) + Text = ("Sudo Seguro (pide clave siempre)") + } + { SinSudo RadioButton + MoveScaled(2,25,46,4) + Text = ("Quitar Sudo a mi usuario") + } + { btnAjustarSudo Button + MoveScaled(20,32,28,4) + Text = ("Ajustar SUDO a mi usuario") + } + { btnSalir Button + MoveScaled(2,32,16,4) + Text = ("Salir") + } + { txtUsuario TextLabel + MoveScaled(2,3,46,4) + Border = Border.Plain + } + { lblClaveRoot TextLabel + MoveScaled(2,9,21,4) + Text = ("Escriba clave de root:") + Alignment = Align.Center + } +} diff --git a/.src/FMain.form~ b/.src/FMain.form~ new file mode 100644 index 0000000..07aab4a --- /dev/null +++ b/.src/FMain.form~ @@ -0,0 +1,41 @@ +# Gambas Form File 3.0 + +{ Form Form + MoveScaled(0,0,50,39) + Text = ("Ajustar SUDO") + Icon = Picture["icon:/22/linux"] + { txtClaveRoot TextBox + MoveScaled(24,9,24,4) + Password = True + } + { SudoComodo RadioButton + MoveScaled(2,15,46,4) + Text = ("Sudo Cómodo (sin pedir contraseña)") + Value = True + } + { SudoSeguro RadioButton + MoveScaled(2,20,46,4) + Text = ("Sudo Seguro (pide clave siempre)") + } + { SinSudo RadioButton + MoveScaled(2,25,46,4) + Text = ("Quitar Sudo a mi usuario") + } + { btnAjustarSudo Button + MoveScaled(20,32,28,4) + Text = ("Ajustar SUDO a mi usuario") + } + { btnSalir Button + MoveScaled(2,32,16,4) + Text = ("Salir") + } + { txtUsuario TextLabel + MoveScaled(2,3,46,4) + Border = Border.Plain + } + { lblClaveRoot TextLabel + MoveScaled(2,9,21,4) + Text = ("Escriba clave de root:") + Alignment = Align.Center + } +} diff --git a/.startup b/.startup new file mode 100644 index 0000000..eac771c --- /dev/null +++ b/.startup @@ -0,0 +1,10 @@ +FMain +ajustarsudo +0 +0 +1.0.1 + +gb.image +gb.gui +gb.form + diff --git a/AjustarSudo.gambas b/AjustarSudo.gambas new file mode 100755 index 0000000000000000000000000000000000000000..25a2e5a757442da84acc73afa3ad4c0e736605f3 GIT binary patch literal 4754 zcma)A30xCr7XK0wj)=qqRFu{!xPmPPuiBPMm(z+xu*PHC;@U|v!f42(lZ2vm)m7VC zx=KCjZd;|C3RDmjYzl&)f_F>Xb;Wu#q7|c6qSX6f-e`n#yzY7_FI_$m$tt ztZI~EI&0Q5QSScK;Mi<2Mmc**)N+O>>_=rZq$y@Hyom*cv%fel!^jyJgE^|F<406D zghv#@VB#5*mS>G-^b;K8oCu|!5uZXCX`ZGSJ!LUjXrARLT5Gn@dR3}H&FMMH#85_t z&tT0AWnw897N=z>Jxyu#bS6XT7>egObFd=DVov9HQ&h0t!kW@7dM?@o)&SSD21}NT z~RNDSjGo3d!38e&dU>TL_UHpPDp10je!6Er-88aPa8<+B)l3b=KH|lb?U(FlY-eh$)dvr^T(ozbI(@3TX8Znw`zos{_O>+U<>wU^6>i$J3C#2JKW}Sm zJ8|MfZf-7Asd4|^e`sIJp}j2!_ckBcvu}SBxZTs- z*tBnV)82;0J@vcy>}qJ*Ro_@wzq@u<9yo;r1EOUag94Yd{9%0F7Wsa`!|8lXb9e zJF2TTmll1x>7T_Vg|J*z+qdQBeFkM)Wko?zZgELL>DJAqUzC(rmX(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