LinuxQuestions.org
Review your favorite Linux distribution.
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 02-19-2013, 05:19 AM   #16
GazL
Senior Member
 
Registered: May 2008
Posts: 3,392

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918

Quote:
Originally Posted by psionl0 View Post
No matter which user makes a package, only root can install it. I would never su up until I was convinced that all the bugs were removed from the slackbuild.
What I do is run my kernel.Slackbuild as a non-root user and then at the end of the slackbuild there is a su root -c " chown && makepkg".
I've been thinking about writing a wrapper script for makepkg designed to be used safely with sudo to avoid the need to enter a password for the makepkg stage. I've never really liked the fact that entire slackbuild scripts run as root.
 
Old 02-19-2013, 11:52 AM   #17
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.0
Posts: 565
Blog Entries: 2

Original Poster
Rep: Reputation: 75
I see what you did there. I like it but I wonder why you thought it necessary to change the ownership of the finished package back to user since the user can still copy/move root owned files that are in his directory.

If you are going down that path, it might be best to retain the need to enter a password for the makepkg stage. This gives the user a final opportunity to bail and prevents unauthorized users from running the slackbuild to make a package.

As an aside, the slackbuild scripts from SlackBuilds.org all need the user to be logged in as root to run (otherwise they fail). I wonder if they have considered using your trick.
 
Old 02-19-2013, 12:00 PM   #18
GazL
Senior Member
 
Registered: May 2008
Posts: 3,392

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by psionl0 View Post
I see what you did there. I like it but I wonder why you thought it necessary to change the ownership of the finished package back to user since the user can still copy/move root owned files that are in his directory.
I chown it back because my slackbuild puts the package in /tmp and the sticky bit on the directory would prevent the deletion otherwise.
 
Old 02-19-2013, 12:45 PM   #19
qweasd
Member
 
Registered: May 2010
Posts: 439

Rep: Reputation: Disabled
In regard to making things as root.

I have very little professional sysadmin experience, but I do have some. I can see two major use cases for Slackware.

On a production system, where stability and availability are important, I can argue for never building anything. To install software there, one should build and package it on a build system. This confers major advantages, such as building in a clean, sane, well known environment; ability to utilize all of the system's resources; tighter security due to isolation from the net; and an option of testing the package without any fear of wrecking the system. In this situation, doing everything as root is perfectly safe. Safer, indeed, because it is more straightforward.

On a personal computer, such as hobbyist's laptop (a case with which I am thoroughly familiar), it simply doesn't matter what one does. To put it another way, it seems like a personal preference. I happen to like the root prompt on an aesthetic level. I am also not afraid of wrecking my laptop, since I have multiple daily mirrors as well as permanent backup checkpoints. And so I see my reckless use of root as a training experience of sorts. Knowing that I will have to pay for my mistake with a few hours of downtime helps me to stay frosty. This builds up the discipline of thinking carefully about every command I type into the root prompt. But what about possible bugs in Slackbuild scripts? This is also a non-issue to me. Building and packaging as unprivileged user does nothing to prevent package bugs such as installing into the wrong location or overwriting system files. And I've never seen a critical build bug in my life. And even if there is a critical build bug lurking somewhere, would it not be able to trash my user account anyway, which means that I have to restore from backup, which is almost as inconvenient as a complete reinstall? I really can't remember the last time I trashed a Slackware system, so I don't bother.
 
Old 02-19-2013, 09:47 PM   #20
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.0
Posts: 565
Blog Entries: 2

Original Poster
Rep: Reputation: 75
Quote:
Originally Posted by qweasd View Post
On a personal computer, such as hobbyist's laptop (a case with which I am thoroughly familiar), it simply doesn't matter what one does. To put it another way, it seems like a personal preference. I happen to like the root prompt on an aesthetic level. I am also not afraid of wrecking my laptop, since I have multiple daily mirrors as well as permanent backup checkpoints. And so I see my reckless use of root as a training experience of sorts. Knowing that I will have to pay for my mistake with a few hours of downtime helps me to stay frosty. This builds up the discipline of thinking carefully about every command I type into the root prompt. But what about possible bugs in Slackbuild scripts? This is also a non-issue to me. Building and packaging as unprivileged user does nothing to prevent package bugs such as installing into the wrong location or overwriting system files. And I've never seen a critical build bug in my life. And even if there is a critical build bug lurking somewhere, would it not be able to trash my user account anyway, which means that I have to restore from backup, which is almost as inconvenient as a complete reinstall? I really can't remember the last time I trashed a Slackware system, so I don't bother.
Even if you are using Slackware-current on a lap top that is strictly for experimental purposes, there is still a case for being sparing with root. You can save yourself hours of unnecessary time restoring a system that was destroyed by a mistyped command (and no matter how disciplined you are, it still happens).

If you are experimenting with a new source code application, you might find that its Makefile does all sorts of unexpected things to the system (eg make unwanted changes to the rc.6 shutdown script). If you run this as root you might be unaware that this is happening. Running it as an ordinary user will make these things painfully obvious and give you the opportunity to take control of the process. Your ultimate aim should be to create a package that behaves predictably - especially if you want to install it on your bread and butter PC.

It is still possible for your home files to be clobbered as a user but fixing that up is simply a matter of copying the files from your backup back in to your home directory. When system files are clobbered by root, the restoration process becomes far more involved. You might even find that your favourite configuration of Slackware is lost forever because you haven't had a chance to document your changes yet.
 
Old 02-20-2013, 01:29 AM   #21
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,758

Rep: Reputation: 469Reputation: 469Reputation: 469Reputation: 469Reputation: 469
Using src2pkg will let you do the whole build as user -without any sudo/su at all, and still have all the files owned by root. This holds true for many builds -even though occassionally a build must be run as root -either because it sets unusual perms/permissions, or because none of the safe, user-accessible methods work for isolating 'make install' from the real system.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Building linux-firmware package with Pat's slackbuild script Phorize Slackware 8 10-05-2011 05:54 AM
[SOLVED] Failure building nvidia-kernel Slackbuild from SBo sysfce2 Slackware 7 07-02-2011 01:10 AM
[SOLVED] error building glade3 slackbuild? trademark91 Slackware 5 01-21-2011 10:31 PM
building from slackbuild script konfigure Slackware 2 03-21-2009 09:59 AM
SlackBuild.org nvidia kernel build script bug Woodsman Slackware 3 04-06-2008 07:48 PM


All times are GMT -5. The time now is 05:30 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration