LinuxQuestions.org
Visit Jeremy's Blog.
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 06-01-2014, 11:56 AM   #46
ml4711
Member
 
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 85

Rep: Reputation: 50

Yea - it looks right, is it executable

Just "echo $QTDIR" and "echo $CPLUS_INCLUDE_PATH"
and you see if that script is called
 
Old 06-01-2014, 05:07 PM   #47
irgunII
Member
 
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 384

Rep: Reputation: 69
Quote:
Originally Posted by ml4711 View Post
Yea - it looks right, is it executable

Just "echo $QTDIR" and "echo $CPLUS_INCLUDE_PATH"
and you see if that script is called
Hmmm...looks like it's not working. I got this:

Code:
bash-4.2$ echo $QTDIR

bash-4.2$ echo $CPLUS_INCLUDE_PATH                                                       
/usr/lib/qt/include
And it *is* executable. So something, somewhere is messed up, right?
 
Old 06-02-2014, 02:34 AM   #48
ml4711
Member
 
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 85

Rep: Reputation: 50
Quote:
And it *is* executable. So something, somewhere is messed up, right?
But for everyone?
The file should have these attributes!

Code:
stat /etc/profile.d/qt.sh
...
Access: (0755/-rwxr-xr-x) Uid: (    0/    root)   Gid: (    0/    root)
...
 
Old 06-02-2014, 06:11 AM   #49
irgunII
Member
 
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 384

Rep: Reputation: 69
Quote:
Originally Posted by ml4711 View Post
But for everyone?
The file should have these attributes!

Code:
stat /etc/profile.d/qt.sh
...
Access: (0755/-rwxr-xr-x) Uid: (    0/    root)   Gid: (    0/    root)
...
Yes, it's executable for everyone. I got the same thing you did:

Code:
bash-4.2$ stat /etc/profile.d/qt.sh
...
...
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Not good, huh?
 
Old 06-02-2014, 06:38 AM   #50
ml4711
Member
 
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 85

Rep: Reputation: 50
Try to source the script, and see if you get errors, or the variables are set

Code:
source /etc/profile.d/qt.sh

echo $QTDIR
If this works, then the script is OK,
but for some reason it is not used, when you login

I am wondering, what about all the other scripts in that directory,
do they also not work, f.ex. lang.sh?

They are all sourced from /etc/profile

What shell do you use - Bourne (and related) shells?
 
Old 06-02-2014, 02:05 PM   #51
irgunII
Member
 
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 384

Rep: Reputation: 69
Quote:
Originally Posted by ml4711 View Post
Try to source the script, and see if you get errors, or the variables are set

Code:
source /etc/profile.d/qt.sh

echo $QTDIR
If this works, then the script is OK,
but for some reason it is not used, when you login

I am wondering, what about all the other scripts in that directory,
do they also not work, f.ex. lang.sh?

They are all sourced from /etc/profile

What shell do you use - Bourne (and related) shells?
Okay, here's what I got:

Code:
bash-4.2$ source /etc/profile.d/qt.sh
bash-4.2$ echo $QTDIR
/opt/kde3/lib/qt3
So it seems *that* is working somehow for some reason.

What should I do to see if any of the other scripts are working in /etc/profile.d?

As for shell I use...uuummmm....all I know is I open konsole (same within Krusader, just a konsole)...both use bash (isn't that bourne again shell?).
 
Old 06-02-2014, 02:55 PM   #52
ml4711
Member
 
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 85

Rep: Reputation: 50
Thumbs up

Quote:
....all I know is I open konsole (same within Krusader, just a konsole)...
Hello again irgunII :-)

This found on Gentoo forum:
Quote:
Hello everyone,
I am running Gentoo with KDE as DE. To log in I use KDM.

So there is never any login shell that can source /etc/profile for me.
The result is that running Konsole doesnt have the values from /etc/profile
because its supposed to get sourced only from a login shell.
They advice one solution:

Quote:
Create a bash resource file "$HOME/.bashrc" if you don't have it
and add: "source /etc/profile"
This would do it:
Code:
echo "source /etc/profile" >> $HOME/.bashrc
Or if you can find where konsole is called, add the option --ls to it

This make it a login shell, and so the /etc/profile is sourced!

I do not use KDE, so it is not tested - it is just what They on the big net say!

Enjoy

Last edited by ml4711; 06-02-2014 at 02:57 PM.
 
Old 06-02-2014, 05:57 PM   #53
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12 and higher
Posts: 229

Original Poster
Rep: Reputation: 51
Or, to change Konsole to always open a login shell, open Konsole and find Settings / Edit current profile. On the General tab change Command from /bin/bash to
Code:
/bin/bash -l
This has the advantage that it doesn't change things for _all_ bash invocations, only the one from Konsole.

If you're using XFCE Terminal the procedure is a little different. Edit / Preferences / General / check Run command as login shell

For xterm you have to change the xterm.desktop file. When I use it I just do
Code:
bash$ . /etc/profile

Last edited by jamesf; 06-02-2014 at 05:59 PM.
 
Old 06-02-2014, 09:26 PM   #54
irgunII
Member
 
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 384

Rep: Reputation: 69
@jamesf - Well, I use KDE, and really don't need the login shell, so I have it so I use the gui login screen and goes straight to X. But thanks for the idea and assistance!

@ml4711 - lol...Hi again to you too friend!

Thank you for that information. I'll give that a try and see how things go. I didn't even have enough of an idea what was wrong to ask it on a search engine, so I'm glad you found it. Thanks again too for all the help you've provided. If I ever win the lotto, I'll come over to Denmark, rent me a Harley (I'm disabled and it's the only thing I can get around on that doesn't give me extreme pain, plus, I'm a biker from all the way back in the 70's and hate cages, heh) and buy you a beer...or 20!
 
Old 06-02-2014, 09:38 PM   #55
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12 and higher
Posts: 229

Original Poster
Rep: Reputation: 51
Um, my suggestions were for the GUI. Changing to a login shell will cause /etc/profile to execute. So, you make those mods and only the Konsole and Terminal apps cause the shell to be a login shell, leaving other shell modes alone.
 
Old 06-03-2014, 02:14 AM   #56
ml4711
Member
 
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 85

Rep: Reputation: 50
@irgunII

Quote:
Or, to change Konsole to always open a login shell, open Konsole and find Settings / Edit current profile. On the General tab change Command from /bin/bash to

Code:
/bin/bash -l
This has the advantage that it doesn't change things for _all_ bash invocations, only the one from Konsole.
This advice from jamesf is actually what you need, and it's also the least intrusive solution!

You still have Your GUI Login :-)

The only change You see, is that /etc/profile is sourced, when you start a konsole!

Enjoy
 
Old 06-03-2014, 01:16 PM   #57
irgunII
Member
 
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 384

Rep: Reputation: 69
Okay...seems I have the idea of what a 'shell' is completely wrong (that really shouldn't be surprising if you guys knew me better, lol), so I've deleted the bash.rc and done it the way jamesf said to do.

Thank you both again for helping me 'fix my stuff', you're good people.
 
Old 06-03-2014, 04:05 PM   #58
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12 and higher
Posts: 229

Original Poster
Rep: Reputation: 51
Really off-topic here, but whatevs. ;vD The best discussions are often free-ranging.

A shell, or Command Line Interface (CLI) in this discussion is a command interpreter / user interface. For this definition Slackware comes with multiple shells like csh, tzsh, bash, sh, bsh(?). Then you get a terminal emulator like Konsole, XFCE Terminal, rxvt, urxvt, etc. to provide the 'wrapper' around the shell while in the GUI. There are also GUI shells, but they're basically point-and-click interfaces to the computer. I won't be addressing GUI shells.

For UNIX/Linux shells in general there is the ones I mentioned above, and others listed at http://en.wikipedia.org/wiki/Unix_shell

A discussion of the different types (login, non-login, interactive, non-login interactive) can be found at https://unix.stackexchange.com/quest...on-login-shell

Basically interactive login shells are set up more for human use and as the basis for a GUI environment to start (like KDE, Gnome, etc.) and non-interactive non-login shells are more for script use.

For interactive software development (editing, compiling, linking, installing, testing, repeat) you use an interactive login shell. That usually gives you the rich set of commands like gcc, make, qmake, cmake, etc. in your path that you don't want in the other types of shells.

An example: not making compiler and linker commands available to non-login shells can help prevent some methods of malware spreading because they
compile the malware and then install it. Granted, this was more true years ago, but hey - a good practice is a good practice.

Hope this helps!

Last edited by jamesf; 06-03-2014 at 04:10 PM. Reason: clarity and i misspelled urxvt
 
1 members found this post helpful.
Old 06-03-2014, 04:28 PM   #59
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,373

Rep: Reputation: Disabled
Quote:
Originally Posted by jamesf View Post
An example: not making compiler and linker commands available to non-login shells can help prevent some methods of malware spreading because they
compile the malware and then install it. Granted, this was more true years ago, but hey - a good practice is a good practice.

Hope this helps!
That's a bit far-fetched. Why wouldn't the malware come pre-compiled ? What if the malware is written in assembly ? Technically you can type in the malware using octal or hex without even an assembler. There are better ways to prevent malware.

Scramdisk seems to be Linux-only, so I don't see how this will save truecrypt as the whole point of truecrypt was its cross-platform nature. I mean I use cryptsetup because I don't use Windoze, but people that do need something cross-platform.
 
Old 06-03-2014, 09:56 PM   #60
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12 and higher
Posts: 229

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by metaschima View Post
That's a bit far-fetched. Why wouldn't the malware come pre-compiled ? What if the malware is written in assembly ? Technically you can type in the malware using octal or hex without even an assembler. There are better ways to prevent malware.
No argument, notice that I said that this was more true years ago. The famous Robert Morris worm, considered the first such on the internet (see http://en.wikipedia.org/wiki/Robert_Tappan_Morris) that brought big attention to malware would compile parts of itself if it found itself on a system that the compiled version didn't support. For that to work I'd guess that two parts were downloaded, scripts that checked for a friendly environment and compiled source if needed and a pre-compiled binary for those machines that would support it.

However, it is still good computing practice to compartmentalize permissions. If Bob doesn't need to compile stuff, then Bob can't. If Carol shouldn't 'make install' then she can't. If I don't need into your bank account, then I can't.

Is everyone a member of the root or wheel groups? Same general principle. I was just simplifying a bit for a new user.

P.S. This google search returns multiple recent hits about malware that compiles itself https://www.google.com/#q=malware+%22compiles+itself%22 When I looked the first page of results had hits for Linux, Windows, and Mac OS X. Granted many hits were about the C compiler that inserts a backdoor/malware, but each major OS was represented.

Last edited by jamesf; 06-03-2014 at 10:09 PM. Reason: Added more examples
 
  


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
Mac4Lin Project on Sourceforge.net infra_red_dude Linux - News 51 09-12-2010 03:24 PM
Wassup w/ this sourceforge project...? Alexvader Linux - General 2 04-08-2010 03:14 PM
Sourceforge.net project confusion montylee Programming 15 10-22-2007 08:01 AM
LXer: Rosegarden is SourceForge Project of the Month LXer Syndicated Linux News 0 01-19-2007 11:12 PM
Upload webpages/project to SourceForge Genjix General 4 03-21-2004 09:51 AM


All times are GMT -5. The time now is 05:24 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