Linux-Development-Sys Digest #535, Volume #6     Fri, 26 Mar 99 16:14:10 EST

Contents:
  Security issues (Michael Schuerig)
  Re: RS485 & Linux: Must toggle DTR quickly (Gerard van der Sel)
  generic SCSI for ATAPI devices (SUMIT)
  Problem adding a hook into kernel (Andy Vogel)
  Re: RS485 & Linux: Must toggle DTR quickly (Tony Williams)
  Re: Using Linux TCP/IP source for an embedded uP? (John Sheehy)
  Re: Devloping Linux apps on NT? (Lewis Perin)
  Re: Building Linux ([EMAIL PROTECTED])
  Re: Devloping Linux apps on NT? ("Seyed Razavi")
  Re: Devloping Linux apps on NT? ("Seyed Razavi")
  Re: How about /dev/web? (Bill Anderson)
  Re: RS485 & Linux: Must toggle DTR quickly (Ralph Goff)
  Re: RS485 & Linux: Must toggle DTR quickly ("Tewpin Andrey (ôÀÐÉÎ áÎÄÒÅÊ)")
  Re: RS485 & Linux: Must toggle DTR quickly ("Rufus V. Smith")
  Re: How about /dev/web? (Nix)
  Re: RS485 & Linux: Must toggle DTR quickly (Stephen Tell)
  sleep_on (Wlmet)
  adding a user (Aaron Faby)
  Re: no setuid for scripts (Frank Sweetser)
  Re: Devloping Linux apps on NT? (steve mcadams)

----------------------------------------------------------------------------

From: [EMAIL PROTECTED] (Michael Schuerig)
Subject: Security issues
Date: Fri, 26 Mar 1999 17:18:23 +0100


Most of the stuff on security I've seen is concerned with administrative
issues, that I'm not particularly intersted in. Rather, I'd like to get
an idea of the programming side of things: What do I have to do to
ensure my programs aren't easily exploitable? Any pointers, where I can
get started?

Thanks,
Michael

-- 
Michael Schuerig
mailto:[EMAIL PROTECTED]
http://www.schuerig.de/michael/

------------------------------

From: Gerard van der Sel <[EMAIL PROTECTED]>
Crossposted-To: comp.arch.embedded
Subject: Re: RS485 & Linux: Must toggle DTR quickly
Date: Fri, 26 Mar 1999 15:55:29 +0100
Reply-To: [EMAIL PROTECTED]

Olav Woelfelschneider wrote:
> 
> Keywords: RS485-Network, Linux
> 
> I try to run a small RS485 network off the serial port of a PC. The PC polls
> some gadgets with microcontrollers in them.
> 
> The PC is coupled via a RS232-RS485 converter which uses DTR to
> switch between transmit and receive. (I use the half-duplex approach with
> only one pair of wires.)
> 

Well there is a software solution. Since you are using halduplex
protocol I persume that transmit is coupled with receive through the
rs485. When you get an receive interrupt from the last character you can
savely turn the transmitter of :-).
So no extra hardware is necessary
-- 
Met vriendelijke groet,

Gerard van der Sel
Mailto:[EMAIL PROTECTED]
"De dinosaurussen hadden hun komeet, wij hebben de Windows computer" -
me
"The box said: 'install on Windows 95, NT 4.0 or better'. 
So I installed it on Linux."

------------------------------

From: SUMIT <[EMAIL PROTECTED]>
Subject: generic SCSI for ATAPI devices
Date: Fri, 26 Mar 1999 08:23:47 -0800

Hi

I am running 2.0.36, trying to play around with a CD-RW drive on
the 2nd IDE-channel. I have enabled ide-scsi emulation and booting
through LILO with the following parameter.
        hdd=ide-scsi

The problem is that when I read the results back, sg_header.result
is not getting set. i.e. If a command results in Check condition,
sg_header.result should say 2. But it is still 0 though I can
see SENSE information in the sense buffer !

Any ideas ?

Thanks in advance.
Sumit

------------------------------

From: Andy Vogel <[EMAIL PROTECTED]>
Subject: Problem adding a hook into kernel
Date: Fri, 26 Mar 1999 16:53:59 GMT

Hiya,

I've added a hook into the IP source code (2.0.36) - following some
example code from other kernel mods. I defined my function hook it
netsyms.c and everything, but the problem is when I compile and boot the
kernel my new hook/variable isn't there!

When I do a "make vmlinux" the System.map that's created has my hook
listed, but a "ksyms -a" doesn't list it, and as a result my module code
can't see it.

Am I missing something simple?

Thanks
Andy


------------------------------

From: Tony Williams <[EMAIL PROTECTED]>
Crossposted-To: comp.arch.embedded
Subject: Re: RS485 & Linux: Must toggle DTR quickly
Date: Fri, 26 Mar 1999 14:59:22 +0000 (GMT)

In article <[EMAIL PROTECTED]>,
 Peter <[EMAIL PROTECTED]> wrote:
> They do give the "all sent" info but only as a status bit - you cannot
> program an interrupt from it.

> >  The main problem here is hardware: none of the 16450, 16550 and
> > other UART give the information "char completely sent", they just
> > give the information "Tx serialisator empty"...

 I had a very similar problem in "2-wire" RS-485
 comms, where each Tx/Rx only gets switched into
 Tx when required, and *must* drop back into an
 Rx'er asap.  5-byte packets into an 8-byte fifo.
 With a receiver hanging on the line you simply
 receive your own outgoing bytes, and as soon as
 the last byte ends, smack it back into Rx, and
 flush buffs. You don't actually have to read your
 own bytes, just count the ints from your own uart,
 each int being a signal that a full byte has gone.

-- 
Tony Williams.

------------------------------

From: [EMAIL PROTECTED] (John Sheehy)
Subject: Re: Using Linux TCP/IP source for an embedded uP?
Date: Fri, 26 Mar 1999 17:51:50 GMT

Christopher Browne ([EMAIL PROTECTED]) wrote:
: On 23 Mar 1999 19:52:09 GMT, Deton8 <[EMAIL PROTECTED]> wrote:
: >Would it be possible to use the Linux TCP/IP source to create an embedded
: >microprocessor's TCP/IP stack?  The commercial ones all seem to be at least
: >$5000 with the average about $15000, and I bet that the Linux driver is of
: >higher quality anyway.

: You might want to consider looking at one of the BSD variants; they are
: nearer to being "original source" for TCP/IP implementations, offer more
: liberal licensing options, and have been fairly widely used for this
: very purpose. 

If it's something small you want, you might want to check out the source for the NCSA
telnet client, TELBIN. There's a full TCP/IP stack there and as far as I know
it's public domain. You'll still need a driver for the ethernet chipset though.
You'll find it on Simtel somewhere.



------------------------------

From: Lewis Perin <[EMAIL PROTECTED]>
Subject: Re: Devloping Linux apps on NT?
Date: 26 Mar 1999 10:41:10 -0500

r d t@c s.q u e e n s u.c a (Bob Tennent) writes:

> On Thu, 25 Mar 1999 17:21:43 -0600, Bill Zimmerly wrote:
>  >> Without sounding like treason can anyone provide any useful advice on how
>  >i
>  >> can go about developing linux apps on a NT workstation?
>  >
>  >Sure, a few tips...
>  >
>  >[Sarcastic Mode On]
>  >
>  >Put a linux box right next to it on the hub and use NT's "Telnet" program!
>  >
>  >[Sarcastic Mode Off]
>  >
> I hope the telnet program on NT is better than the junk they supply on
> Windows 95.  They can't even get telnet right.  

It isn't any better, but there are free alternatives that do a
creditable job.  I prefer Teraterm; use your favorite search engine to
find it.

Cheers, Lew

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: Building Linux
Date: Fri, 26 Mar 1999 17:18:06 GMT

First I'd like to thank everyone for their input.  It seems the most
logical way to proceed is to install Linux and work at it from inside.

Do I have to buy a distribution (Redhat, etc) or can I download it from
somewhere.  I'm really trying to start with the most basic operating
system and go from there.

Neil


[EMAIL PROTECTED] wrote:
> 
> Does Linux need to be up and running before the kernel can be built or
> can the kernel be built under Windows NT?  I want to build from scratch
> so I can learn more about the OS.
> 
> Neil

------------------------------

From: "Seyed Razavi" <[EMAIL PROTECTED]>
Subject: Re: Devloping Linux apps on NT?
Date: Fri, 26 Mar 1999 16:03:15 -0000

> Treason's an offence; you just need help, advice and councelling <Big
Grin>
>

I felt soooooo DIRTY asking but one must do as what one must do......

--
Cheers,

Seyed Razavi
[EMAIL PROTECTED]




------------------------------

From: "Seyed Razavi" <[EMAIL PROTECTED]>
Subject: Re: Devloping Linux apps on NT?
Date: Fri, 26 Mar 1999 15:58:30 -0000

Hi,

Your suggestion is a good one and exactly what I do in the office where I
have at my disposal numerous systems.

My question related to my home PC where I wish to develop C++ apps for Linux
(and Win32) but don't want to put Linux on my machine (can you imagine the
look on my girlfriends face when she tries to use here wordprocessor or mail
package ;-)

--
Cheers,

Seyed Razavi
[EMAIL PROTECTED]

Bill Zimmerly <[EMAIL PROTECTED]> wrote in message
news:7deglu$j13$[EMAIL PROTECTED]...
> > Without sounding like treason can anyone provide any useful advice on
how
> i
> > can go about developing linux apps on a NT workstation?
>
> Sure, a few tips...
>
> [Sarcastic Mode On]
>
> Put a linux box right next to it on the hub and use NT's "Telnet" program!
>
> [Sarcastic Mode Off]
>
> Seriously though, this is what I actually do on my network. I also have a
> Belkin switch whereby the NT & Linux machines share a common mouse,
> keyboard, and monitor. Press one button and I'm on Linux, press it again,
> back to NT. Works great!
>
> If you prefer an editor that's only available on NT, as I do, you can
always
> have the Editor, Telnet, and FTP running at the same time, and edit,
> compile, and test to your heart's content...
>
> - Bill
>
>
>



------------------------------

From: Bill Anderson <[EMAIL PROTECTED]>
Subject: Re: How about /dev/web?
Date: Fri, 26 Mar 1999 17:28:39 +0000

Christopher Browne wrote:
> 
> On 25 Mar 1999 14:39:55 -0500, Alexander Viro <[EMAIL PROTECTED]> wrote:
> >In article <[EMAIL PROTECTED]>,
> >Mathieu ARNOLD  <[EMAIL PROTECTED]> wrote:
> >>Alexander Viro wrote:
> >>>         What next, Java in the kernel?
> >>
> >>the kernel in java :)
> >
> >vmlinux.el, to mention another monstrosity ;-/
> 
> No, no, no.
> 
> vmlinux.scm


Whoah, a Linux Starcraft Map ;-)
(yes, I know it is also used for scheme files)


How about vmlinuz.pyc ?
__
Bill Anderson                                   Linux Administrator
MCS-Boise (ARC)                                 [EMAIL PROTECTED]
My opinions are just that; _my_ opinions.

------------------------------

From: [EMAIL PROTECTED] (Ralph Goff)
Crossposted-To: comp.arch.embedded
Subject: Re: RS485 & Linux: Must toggle DTR quickly
Date: 26 Mar 1999 09:42:29 PST


R.E. Smith in the US makes a 232 to 485 converter that will take care
of all this messy timing for you.  You just send the data.
        R.E. Smith Co.
        4311 Tylersville Rd.
        Hamilton, OH 45011
        513-874-4796

I've never used them, just seen them advertised.  Under $100.

Ralph


In article <[EMAIL PROTECTED]>, Olav Woelfelschneider <[EMAIL PROTECTED]> 
says:
>
>Keywords: RS485-Network, Linux
>
>I try to run a small RS485 network off the serial port of a PC. The PC polls
>some gadgets with microcontrollers in them.
>
>The PC is coupled via a RS232-RS485 converter which uses DTR to
>switch between transmit and receive. (I use the half-duplex approach with
>only one pair of wires.)
>
>So, to send some data, I turn DTR on, write() the bytes and turn DTR off
>again after the last byte fell out of the UART.
>
<snip>

------------------------------

From: "Tewpin Andrey (ôÀÐÉÎ áÎÄÒÅÊ)" <[EMAIL PROTECTED]>
Crossposted-To: comp.arch.embedded
Subject: Re: RS485 & Linux: Must toggle DTR quickly
Date: Fri, 26 Mar 1999 21:49:22 +0400


Olav Woelfelschneider ïèøåò â ñîîáùåíèè <[EMAIL PROTECTED]> ...
>Keywords: RS485-Network, Linux
>

>This is the code snipplet for that approach:
>
>  {
>    int arg;
>
>    /* DTR on */
>    ioctl(com, TIOCMGET, &arg);
>    arg|=TIOCM_DTR;
>    ioctl(com, TIOCMSET, &arg);
>
>    /* Send data */
>    if (write(com, buf, bp)!=bp) return -1;
>
>    /* Wait for transmitter to finish -- UGLY! */
>    do {
>      ioctl(com, TIOCSERGETLSR, &arg);
>    } while((arg & TIOCSER_TEMT)==0);
>
>    /* DTR off */
>    ioctl(com, TIOCMGET, &arg);
>    arg&=~TIOCM_DTR;
>    ioctl(com, TIOCMSET, &arg);
>  }

Pls, try so...

  {
   int arg;

    //
    //  m.b. off Tx FIFO? I do it for NT4, in Linux  I'm  nothing, yet.
    // And do not know as work write in last.

    /* DTR on */
    ioctl(com, TIOCMGET, &arg);
    arg|=TIOCM_DTR;
    ioctl(com, TIOCMSET, &arg);

    /* Send data */
     *(buf+bp)=0x00;   // paddle fake byte: must be 0x00
    if (write(com, buf, bp+1)!=(bp+1)) return -1;

    /* Wait for transmitter to finish -- UGLY! */
     //  do {
     //     ioctl(com, TIOCSERGETLSR, &arg);
     //  } while((arg & TIOCSER_TEMT)==0);
    //

    /* DTR off */
    ioctl(com, TIOCMGET, &arg);
    arg&=~TIOCM_DTR;
    ioctl(com, TIOCMSET, &arg);
  }

>Before I go and hack up the serial driver to include automatic DTR toggling,
>I wonder what other people might think.
>
>Any hints greatly appreciated!
>
>Thanks,
>--
>Olav "Mac" Wölfelschneider                         [EMAIL PROTECTED]
>PGP fingerprint = 06 5F 66 B3  2A AD 7D 2D  B7 19 67 3C  95 A7 9D AF
>Mer muß doch nur emol e bissje nochdenke. -- Mundstuhl


        At7




------------------------------

From: "Rufus V. Smith" <[EMAIL PROTECTED]>
Crossposted-To: comp.arch.embedded
Subject: Re: RS485 & Linux: Must toggle DTR quickly
Date: Fri, 26 Mar 1999 13:16:16 -0500

I thought that status bit could cause an interrupt in Line Status Change or
Modem Status Change.

Peter wrote in message <[EMAIL PROTECTED]>...
>They do give the "all sent" info but only as a status bit - you cannot
>program an interrupt from it.
>
>>  The main problem here is hardware: none of the 16450, 16550 and
>> other UART give the information "char completely sent", they just
>> give the information "Tx serialisator empty"...
>
>
>--
>Peter.
>
>Return address is invalid to help stop junk mail.
>E-mail replies to [EMAIL PROTECTED] but remove the X and the Y.
>Please do NOT copy usenet posts to email - it is NOT necessary.



------------------------------

From: Nix <$}xin{$@esperi.demon.co.uk>
Subject: Re: How about /dev/web?
Date: 26 Mar 1999 07:11:02 +0000

[EMAIL PROTECTED] (Alexander Viro) writes:

> Wake me up when you will implement lseek() and mmap() over FTP. FTP is not
> a filesystem.

There is a system out there called `alex' which turns the world's
anonymous ftp sites into a filesystem. This has been done, at least for
Solaris (and I don't think it was Solaris-specific, either. Not sure.)

Sure, lseek and mmap are slow - they need to suck most of the file down
first - but with local caching it should be quite fast.

>               HTTP is not a filesystem.

Agreed. There isn't even any guaranteed way to get a directory. webfs is
a lost cause before it begins :)

>                                         BTW, could you tell me how to
> implement locks over these protocols?

Lockfiles can keep out other instances of the same filesystem; other
locks are not essential. nfs survived without locks for years, so could
this.

>                                       And what on the Earth "internet ready"
> is supposed to mean?

It's dog slow and flashes unnecessary adverts in your face all the time,
of course. Just like the Internet[1].

[1] unless you take precautions. And the `dog slow' is always there :(

-- 
`Anything else just amounts to repeatedly hitting yourself on the head
 with a virtual icepick, and is just about as useful.' - Linus Torvalds
 on linux-kernel

------------------------------

From: [EMAIL PROTECTED] (Stephen Tell)
Crossposted-To: comp.arch.embedded
Subject: Re: RS485 & Linux: Must toggle DTR quickly
Date: 26 Mar 1999 11:41:49 -0500

In article <[EMAIL PROTECTED]>,
Olav Woelfelschneider  <[EMAIL PROTECTED]> wrote:

>The PC is coupled via a RS232-RS485 converter which uses DTR to
>switch between transmit and receive. (I use the half-duplex approach with
>only one pair of wires.)

I went through the same thought process and code experiments that you did,
and finally just bought a half-duplex RS232-RS485 converter that does the
transmit control automaticly in hardware.

two sources of these:
http://www.bb-elec.com/
http://www.rs485.com/

>Before I go and hack up the serial driver to include automatic DTR toggling,
>I wonder what other people might think.

I think that if you want it done right, it needs to go in the driver like
this.  
-- 
-- 
Steve Tell | [EMAIL PROTECTED] | http://www.cs.unc.edu/~tell | KF4ZPF
Research Associate, Microelectronic Systems Laboratory
Computer Science Department, UNC@Chapel Hill.   W:919-962-1845

------------------------------

From: [EMAIL PROTECTED] (Wlmet)
Subject: sleep_on
Date: 23 Mar 1999 16:10:12 GMT

static inline void __sleep_on(struct wait_queue **p, int state)
{
        unsigned long flags;
        struct wait_queue wait = { current, NULL };

        if (!p)
                return;
        if (current == task[0])
                panic("task[0] trying to sleep");
        current->state = state;
        add_wait_queue(p, &wait);
        save_flags(flags);
        sti();
        schedule();
        remove_wait_queue(p, &wait);
        restore_flags(flags);
}


I am not clear on what happens here if the process loses the CPU right after 
current->state = state;

If state is not interruptible, than it seems that the process would be stuck
here.  If state is interruptible then the scheduler will restart it at
timeout(?), but then won't the scheduler make it runnable even if it is on the
wait queue?


------------------------------

From: Aaron Faby <[EMAIL PROTECTED]>
Crossposted-To: 
comp.unix.programmer,comp.programming,comp.lang.c,comp.os.linux.development.apps
Subject: adding a user
Date: Fri, 26 Mar 1999 14:24:02 -0500


==============043C3180F62756CBE2982DBE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello!

I need to write a program that can add a user and add the users password

all in one shot (by adding login and pass as arguements to the program
when
invoking). Such as: addaccount test testpass

This is to be done on a linux system.

How do I encrypt the password to add to the passwd file? Is there any
documentation on this? Thanks!

--
Aaron Faby
[EMAIL PROTECTED]
System Administrator/Technical Support
Yourlink, Inc.



==============043C3180F62756CBE2982DBE
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hello!
<p>I&nbsp;need to write a program that can add a user and add the users
password
<br>all in one shot (by adding login and pass as arguements to the program
when
<br>invoking). Such as:&nbsp;addaccount test testpass
<p>This is to be done on a linux system.
<p>How do I encrypt the password to add to the passwd file?&nbsp;Is there
any
<br>documentation on this?&nbsp;Thanks!
<pre>--&nbsp;
Aaron Faby
[EMAIL PROTECTED]
System Administrator/Technical Support
Yourlink, Inc.</pre>
&nbsp;</html>

==============043C3180F62756CBE2982DBE==


------------------------------

From: Frank Sweetser <[EMAIL PROTECTED]>
Subject: Re: no setuid for scripts
Date: 26 Mar 1999 15:43:20 -0500

Nix <$}xin{$@esperi.demon.co.uk> writes:

> Frank Sweetser <[EMAIL PROTECTED]> writes:
> 
> > [EMAIL PROTECTED] (Peter Samuelson) writes:
> > > One might be tempted to write a clever C program that just takes, as
> > > argv[1], the name of a shell script.  The program would check the
> > 
> > err...
> > 
> > ./wrapper /bin/sh
> 
> I think you'd probably need to validate it against a list of acceptable
> scripts, yes :)

sudo, IOW =)

-- 
Frank Sweetser rasmusin at wpi.edu fsweetser at blee.net  | PGP key available
paramount.ind.wpi.edu RedHat 5.2 kernel 2.2.3        i586 | at public servers
    switch (ref $@) {
    OverflowError =>
        warn "Dam needs to be drained";
    DomainError =>
        warn "King needs to be trained";
    NuclearWarError =>
        die;
    }
             -- Larry Wall in <[EMAIL PROTECTED]>

------------------------------

From: [EMAIL PROTECTED] (steve mcadams)
Subject: Re: Devloping Linux apps on NT?
Date: Fri, 26 Mar 1999 20:02:48 GMT
Reply-To: [EMAIL PROTECTED]

[Posted & mailed, snipped, quoted is ">"]
"Seyed Razavi" <[EMAIL PROTECTED]> wrote:

>Without sounding like treason can anyone provide any useful advice on how i
>can go about developing linux apps on a NT workstation?

I don't see it as a matter of alleigiance.  What are you using on NT?
I use DevStudio.  If you want to continue to use it (or whatever your
current toolset is) while starting development on Linux, there are two
ways you can go.

One way is how I'm set up now.  I'm running NT Server  4.0 and Linux
SuSE 5.3 on my development system.  When Linux is running I have my NT
drives mounted as their drive letters.  For example the drive that NT
sees as "E:" I have mapped on Linux to \E so it's easy for me to
remember from system to system.  I do my editing and base function
development on NT using DevStudio.  All you have to do in this kind of
setup is edit \etc\fstab and mount the drives as vfat filesystems. 

The other way only applies if you have two systems; under Linux you
need to set up samba to mount the NT drive, again as vfat.  Under NT
you need to set up the necessary permissions through UserManager; you
may also need to apply a registry patch to NT to get it to permit
clear-text password entry from remote systems, if you choose to do so
- otherwise you may need to do something-or-other to Linux to get
around the encrypted password problem.  

Just do your editing on NT, functional testing if your code is
cross-system, then zip over to Linux and recompile then do your
debugging there where you'll be using it. 
________________________________________________________________________________________
"All-Purpose Disclaimer: i be fool, you no listen me." 
http://www.codetools.com/showcase

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to