shell variable security
by tony.chamberlain@lemko.com
I guess I was asking in general how you can be sure your variables are safe.
Maybe it is more complicated than that? I really have just heard warnings from
everyone, so I was taking pre-emptive measures.
I tried a few things myself too and also could not get that problem.
I tried making a file called test and doing things like
K="$1"
echo $K
and then calling
test "hello\";date"
a nd
FIL="$1"
ls $FIL
but that seemed to be OK
16 years, 7 months
How to force a (SATA) drive to be sda and the PATA one sdb
by Alfredo Ferrari
Hi
I have the following problem:
a) a laptop with a SATA drive
b) a modular bay in the same laptop where I can fit a DVD, a battery
or a PATA drive
If the PATA drive is there Fedora 7 recognizes it as /dev/sda and the SATA
one as /dev/sdb. Without the PATA one, the SATA one is obviously /dev/sda.
I would like to find a way to force the SATA one to be /dev/sda
always: using labels is only mitigating the issue of the (main) disk
flipping name, since some partitions are mounted via autofs which does not
accept labels, and others are Windows ones which again cannot be mounted
by labels at least to my knowledge.
In short, is there any mean (kernel parameter?) to force the SATA drive
come first? BTW on Fedora Core 6 this issue was never present.
Thanks a lot
Alfredo Ferrari
--
+----------------------------------------------------------------------------+
| Alfredo Ferrari || Tel.: +41.22.767.6119 |
| C.E.R.N. || Fax.: +41.22.767.7555 |
| European Laboratory for Particle Physics|| |
| AB Division / ATB Group || e-mail: |
| 1211 Geneva 23 || Alfredo.Ferrari(a)cern.ch |
| Switzerland || Alfredo.Ferrari(a)mi.infn.it |
+----------------------------------------------------------------------------+
16 years, 7 months
shell variable security
by tony.chamberlain@lemko.com
I have to write some BASH scripts.
We have all heard about security problems with shell variables
(i.e. when entering a name someone enters something like "Tony; rm -rf /root/*" )
so that if the BASH scripts echoes it will will do something like echo Tony; rm -rf /root/*.
Now we have honest users here, but I still want to do some checks. If I read in or get a shell variable from a user
I could do something like
echo "$VAR" | grep '[^a-zA-Z/_-]'
if [ $? -eq 0 ]
then
echo "You have entered a bad character"
exit 1
fi
but that still runs into the problem like above with the echo. I also could do
case "$VAR" in
\;|\:) echo "you have a bad character"
;;
esac
but I am not sure that is best either. Is there anyway to validate shell variables?
I know Javascript, etc., has something like url_encode()
16 years, 7 months
Question about versions
by Anderson, Mike
My question maybe rather simple, but I could not find the answer.
Does Fedora have the capabilities of running in server mode or is it
only for desktops?
Mike
16 years, 7 months
Rescuing files from a LVM partition
by Andrew Stewart
I have two servers running FC3. The first machine (called Orca) has died
due to what is likely a problem on the logic board or power supply.
Unfortunately there are some critical files that I need to rescue from the
lone drive on Orca. I retrieved the hd and threw it into an external
casing, and hooked it up to my Mac.. Only to find that the drive is
formatted with an "Linux LVM partition". I started doing a little homework
and now have a basic understanding of what this exactly means.
So, after running through a couple different ideas, I decided the easiest
solution probably lies with connecting Orca's hd up to the second server
(called Beluga). This time I could use the various lvm commands to see
which logical volumes, volume groups, and physical volumes existed on the
machine. Because both machines contained a single harddrive, each with FC3
installed (and thus a large root partition and a smaller swap partition), I
would expect to see something along the lines of two logical groups, each
containing two logical volumes and one physical volume. Oddly enough, only
a single volume group appeared (VolGroup00). The reason for this turns out
to be because on their 'home' machines, the two hard drives have a single
volume group.. The problem being that both are named VolGroup00 and so when
both drives are mounted, only VolGroup00 from Beluga is present.
I found some old threads where people had similar problems, and discovered
that one solution is to somehow deactivate the 'home' volume and rename its
volume group (to something like VolGroup01) before connecting the second
drive.. Which should then appear as VolGroup00 and thus allow you to mount
its logical volume via mount /dev/VolGroup00/LogVol01 (which would roughly
correspond to /dev/sbd2.. The root partition on the second drive). I went
about attempting this with little success. It then occurred to me I could
just go into the boot sequence and boot off the second drive (it didn't
really occur to me that this slightly older machine supported booting off a
usb device). Doh!
Unfortunately I mucked up the volume groups and logical volumes on the
second drive, but I don't think the damage is irreparable (after all, it's
just the LVM info that is muddled, not the actual physical data). So, I'm
hoping that if I post the output of vgscan, lvscan, and pvscan, maybe
someone out there savvy with LVM commands can help me put things in the
right order.
I don't much care whether I go with renaming one of the volume groups to
allow both to coexist (let's call it plan B), or whether I just put the
external drive from Orca back into order so that I might boot off of it as
the sole drive (plan A)... Though I feel that plan A is the safer option in
order to leave Beluga's home drive alone.
[root@beluga ~]# pvscan
PV /dev/sdb2 VG VolGroup01 lvm2 [74.40 GB / 74.40 GB free]
PV /dev/sda2 VG VolGroup00 lvm2 [279.34 GB / 160.00 MB free]
Total: 2 [353.74 GB] / in use: 2 [353.74 GB] / in no VG: 0 [0 ]
[root@beluga ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup01" using metadata type lvm2
Found volume group "VolGroup00" using metadata type lvm2
[root@beluga ~]# lvscan
ACTIVE '/dev/VolGroup00/LogVol00' [277.25 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
As you can see, a VolGroup01 does exist... With a physical volume /dev/sdb2
associated with it ...as a result of my experimenting. I'm just not sure
how to get the corresponding logical volumes for that volume group. Lvscan
would then look something like...
[root@beluga ~]# lvscan
ACTIVE '/dev/VolGroup00/LogVol00' [277.25 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
ACTIVE '/dev/VolGroup01/LogVol00' [74.40 GB] inherit
ACTIVE '/dev/VolGroup01/LogVol01' [probably 1.94 GB] inherit
I think I ran either a vgreduce at some point, so I might have to do an
lvcreate or something like that? Unfortunately I don't understand LVM as
much as I'd like to, and am slightly confused with how it works. Can anyone
out there lend me a hand?
Thanks in advance,
Andrew
16 years, 7 months
fedora 7 - dmesg
by ann kok
Hi all
I got the following from dmesg in my fedora 7 desktop.
ls it normal?
Thank you
BUG: warning at kernel/softirq.c:138/local_bh_enable()
(Not tainted)
[<c042b0cf>] local_bh_enable+0x45/0x92
[<c06002bd>] cond_resched_softirq+0x2c/0x42
[<c059adf3>] release_sock+0x4f/0x9d
[<c05c670d>] tcp_sendmsg+0x90b/0x9f9
[<c05dec95>] inet_sendmsg+0x3b/0x45
[<c0598731>] sock_aio_write+0xf6/0x102
[<c04754ee>] do_sync_write+0xc7/0x10a
[<c0436e71>] autoremove_wake_function+0x0/0x35
[<c0475d47>] vfs_write+0xbc/0x154
[<c0476342>] sys_write+0x41/0x67
[<c0404f70>] syscall_call+0x7/0xb
=======================
____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
16 years, 7 months
Re: [NFS] nfs write problems
by Bob Kryger
Sure, easily. I gziped a capture of a single test.
http://www.panix.com/~bobk/typescript.gz
the program is a simple one...
#include <stdio.h>
main()
{
unsigned long long k=0;
unsigned char byte;
while(!feof(stdin))
{
byte=getc(stdin);
if(byte!=0)
printf("nonzero (0%o) found at byte %d\n",byte,k);
k++;
}
printf("file size = %d bytes\n",k);
}
J. Bruce Fields wrote:
> On Wed, Oct 03, 2007 at 06:21:51AM -0400, Bob Kryger wrote:
>
>> Trond Myklebust wrote:
>>
>>> Feel free to describe your test in a bit more detail. Without more
>>> information, we obviously can't rule out the existence of an NFS bug,
>>>
>>>
>> I was trying to be thorough, I hope I succeeded.
>>
>
> The dd test sounded simple enough, but if you could include a transcript
> of the commands you ran (together with the C code of any test programs)
> just to be sure, that might help.
>
> --b.
>
>
>
16 years, 7 months
F7 and WoW?
by Chris
Before I run off and remove my kids Windows2000 OS for Fedora, will F7
play WoW? HE wants to play Wow really bad but also wants to try out
Linux.
--
Best regards,
Chris
Registerd Linux user number 448639
16 years, 7 months
FC7 dies: kernel: general protection fault: 0000 [2] SMP
by Zhou, Chenggang
Most recent kernel where this bug did not occur: Not before (new machine,
can only install Linux Version higher than 2.6.18)
Distribution: Fedora Core 7 (F-7-x86_64-DVD.iso, download from FC official
website)
Hardware Environment:
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 5000+
Mother board: ASUS M2N6 (Video card, Sound card and Attansic L1 Gigabyte
network interface integreted)
Hard Drive: 160G SATA
Memory: 4 GB
Monitor, keyboard and mouse: through KVM
Software Environment:
System default. Services: ssh, ftp (firewall and SElinux are disabled)
Problem Description and Steps to reproduce:
1. At first, I installed a test version of RH AS5 (kernel 2.6.18). The
kernel did not contain the driver of the network interface (Attansic L1), so
I installed a third-party driver. However, the system frequently halted
under such conditions: (1). Memory usage exceed 3.5GB (by command 'top');
(2). kill running mpi jobs (i.e. killall vasp); (3). upload large files
(larger than 1GB) when a ssh (putty) window or a VNC window is open. (4).
for sometimes, no any interfere, died itself. Mention that once the system
halted (without any error information), there will be no any response unless
I press the reset button.
So I shifted to Fedora Core 7 after 1 month's pain... but problem is still
there.
2. Error triger: (1). uploading large files (an iso file, larger than 1GB).
The system will freeze randomly during the transfer period; (2) If
fortunately, I can finish up the transfer, I mount the iso file and them
excute a install script, the system freezes. Both these two trigers will let
a Putty window give error messages like:
[blade@fc05 test]$
Message from syslogd@ at Tue Oct 2 23:31:06 2007 ...
fc05 kernel: Oops: 0000 [1] SMP
Message from syslogd@ at Tue Oct 2 23:31:06 2007 ...
fc05 kernel: CR2: fffffffffab23e78
Message from syslogd@ at Tue Oct 2 23:33:00 2007 ...
fc05 kernel: general protection fault: 0000 [2] SMP
-------------------
I am not sure if this is a kernel bug. I submit the problem to kernel.org a
while ago and I also want to get some help from this mailing list. Thanks.
--
******************************************************
Zhou, Chenggang
Ph. D. Candidate.
Inst. of Theo. Chem. & Comput. Mat. Sci.
China Uni. of Geosciences, Wuhan, China P.R.C.
Lumo Street 388#,Wuhan,Hubei,China P.R.C. 430074
Cell Phone: 86-27-6104-8010
Office Phone: 86-27-6788-3049
Fax Number: 86-27-6788-3431
Email address: cgzhou(a)cug.edu.cn
******************************************************
16 years, 7 months