LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-10-2012, 11:58 AM   #1
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Is it possible to run sbopkg with -s or -g option as restricted user?


When I search for a software that I want to test or that i need my first look is if it is in the SlackBuild repositories. I use
Code:
sbopkg -g NAME-OF-SOFTWARE
for this. I never use the -s option, but I think my question can be extended to that option (and may be any other option that doesn't change things on the system).
What really annoys me is that I have to become root only to search for a package. I understand that root privileges are needed for installing (and sometimes building) the packages, but why do I need to be root to search in the database?

Is there a workaround for this behavior or do I have to make a feature request?

Last edited by TobiSGD; 04-10-2012 at 12:00 PM.
 
Old 04-10-2012, 12:09 PM   #2
WhiteWolf1776
Member
 
Registered: Oct 2010
Location: Bowling Green, KY
Distribution: Slackware
Posts: 288

Rep: Reputation: 95
slackbuilds are setup to be run as root.... so sbopkg will not work properly unless run as root.
 
Old 04-10-2012, 12:12 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148

Original Poster
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
I know that SlackBuilds need to be run as root.I don't want to run them as restricted user. But I don't see any reason to be root just to do a search in the database or use sbopkg with any other option that does not change anything on the system.
I can for example use slackpkg to search for packages without being root, but need to be root to install/remove/upgrade packages.
 
Old 04-10-2012, 12:14 PM   #4
WhiteWolf1776
Member
 
Registered: Oct 2010
Location: Bowling Green, KY
Distribution: Slackware
Posts: 288

Rep: Reputation: 95
Just not the way it was designed Tobi. sbopkg must be run by the root user... by design.
 
Old 04-10-2012, 12:16 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148

Original Poster
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
So my only option is to ask the author for that feature?
 
Old 04-10-2012, 12:18 PM   #6
WhiteWolf1776
Member
 
Registered: Oct 2010
Location: Bowling Green, KY
Distribution: Slackware
Posts: 288

Rep: Reputation: 95
or go write it yourself. I honestly can't see any benefit to running sbopkg as a normal user, as it's whole point is making it easier to handle slackbuild scripts... that require you to run as root.
 
Old 04-10-2012, 12:25 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148

Original Poster
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Searching in sbopkg's package database is not an administrative task. I can't see the point in doing non-administrative tasks as root, besides that it would just be more convenient.
But let's not argue about that. I will mark this thread as solved and have a look if I can make a feature request.
 
Old 04-10-2012, 12:26 PM   #8
WhiteWolf1776
Member
 
Registered: Oct 2010
Location: Bowling Green, KY
Distribution: Slackware
Posts: 288

Rep: Reputation: 95
there is this website... http://slackbuilds.org where you can search all the packages
 
Old 04-10-2012, 12:48 PM   #9
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
you can also search packages names faking sbopkg behaviour (eh, maybe I'm making it too simple ) with a bash script, like this:
it looks for the first argument and you can specify a REPO variable on the command line
Code:
#!/usr/bin/bash
REPO=${REPO:-SBo/13.37}
echo "Searching for $1"
echo "Found the following matches for $1:"
ls -1 /var/lib/sbopkg/$REPO/*/*/*.info | grep $1 | cut -d/ -f7,8
EDIT: I refined it a little: now it gets the variables it needs directly from sbopkg.conf
Code:
#!/usr/bin/bash
. /etc/sbopkg/sbopkg.conf
echo "Searching for $1"
echo "Found the following matches for $1:"
if [ "$(grep $REPO_NAME /etc/sbopkg/repos.d/* | grep $REPO_BRANCH | grep git\:)" ]; then
  ls -1 $REPO_ROOT/$REPO_NAME/*/*/*.info | grep $1 | cut -d/ -f6,7
else
  ls -1 $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/*/*/*.info | grep $1 | cut -d/ -f7,8
fi

Last edited by ponce; 04-10-2012 at 01:24 PM. Reason: new version
 
1 members found this post helpful.
Old 04-10-2012, 01:12 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148

Original Poster
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by WhiteWolf1776 View Post
there is this website... http://slackbuilds.org where you can search all the packages
Yeah, of course, instead of typing su - I launch the browser, surf to SlackBuilds.org and type in the software I am searching for. Very convenient:

Quote:
Originally Posted by ponce
you can also search packages names faking sbopkg behaviour (eh, maybe I'm making it too simple ) with a bash script
As always I am missing the obvious. Shame on me, thanks for your script.
 
Old 04-10-2012, 01:32 PM   #11
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
Quote:
Originally Posted by TobiSGD View Post
Yeah, of course, instead of typing su - I launch the browser, surf to SlackBuilds.org and type in the software I am searching for. Very convenient:
that's not completly true: actually, if you got a network connection (but you need it for sbopkg) you can do in a single command (script that uses links/lynx?) also that
Code:
lynx "http://slackbuilds.org/result/?search=qemu&sv=13.37"
works only with slackbuilds.org (thanks go to SBo coders) but the result is much more informative (it searches in the tags too), browsable and maybe also faster

Last edited by ponce; 04-10-2012 at 01:47 PM.
 
1 members found this post helpful.
Old 04-10-2012, 01:47 PM   #12
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148

Original Poster
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Thanks for the tip, but I think your script is sufficient for me.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
create restricted area user anaskoara Linux - Newbie 2 02-16-2011 11:17 AM
svn user with very restricted possibilities? khaan Linux - Newbie 2 03-16-2010 01:55 PM
Need to create a restricted user(Centos) ankushpandit Linux - Newbie 7 09-10-2009 09:24 AM
Files restricted to only root user Peter_APIIT Mandriva 18 03-25-2007 03:03 PM
SSH user IP restricted access??? ifm Linux - Security 3 07-21-2002 11:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration