Relocatable linking on x86-64 for i386

2011-04-04 Thread Valery Reznic
Hello. I am trying to make relocatable linking on x86-64 box for objects in 
format i386

Naive

ld -r file1.o file2.o -o output.o

produce
ld: Relocatable linking with relocations from format elf32-i386 (file1.o) to 
format elf64-x86-64 (output.o) is not supported

But even when I add --oformat situation not improved:

ld --output-format elf32-i386 -r file1.o file2.o -o output.o
ld: Relocatable linking with relocations from format elf32-i386 (file1.o) to 
format elf32-i386 (output.o) is not supported

So linker correctly recognize what input and output format should be,
but for some reason don't want do it.

Do you have any ideas if it can be done at all and how?

Thanks.
Valery

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Relocatable linking on x86-64 for i386

2011-04-04 Thread Shachar Shemesh

On 04/04/11 10:15, Valery Reznic wrote:

Hello. I am trying to make relocatable linking on x86-64 box for objects in 
format i386

Naive

ld -r file1.o file2.o -o output.o

produce
ld: Relocatable linking with relocations from format elf32-i386 (file1.o) to 
format elf64-x86-64 (output.o) is not supported

But even when I add --oformat situation not improved:

ld --output-format elf32-i386 -r file1.o file2.o -o output.o
ld: Relocatable linking with relocations from format elf32-i386 (file1.o) to 
format elf32-i386 (output.o) is not supported

So linker correctly recognize what input and output format should be,
but for some reason don't want do it.

Do you have any ideas if it can be done at all and how?
   
Can't. You're trying to link objects compiled for different machine 
codes. Tis not the linking stage that is wrong.


While it is possible to run both machine codes on your computer, they 
must run in different processes (the kernel actually treats x86 and 
amd64 codes differently when it sets up the registers for the context 
switch), and thus you cannot link them into a single executable, cannot 
dynamically load one from the other, and cannot have two threads with 
different types. Your only option for interaction is RPC of some sort 
(or recompile one of them).


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Creating a User with Access to a Single Command

2011-04-04 Thread Amichai Rotman
Hi all,

I want to create a user that will be able to only run ssh.

I thought of sudo, but I am not sure how to configure it right so he will
not be able to run anything else...

Can you help me with the settings in the /etc/sudoers?

Thanks!

Amichai.
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Creating a User with Access to a Single Command

2011-04-04 Thread Ariel Biener

That's not what you want. Please read about restricted shell.

A working example:

/etc/passwd:
ariel:x:uid:gid::/home/ariel:/bin/rbash

ls -l /bin/rbash
lrwxrwxrwx  1 root root 4 Apr 10  2006 /bin/rbash - bash

drwx-t  4 ariel mygroup 4096 Apr  1 22:50 /home/ariel

ls -al ~ariel
-r-xr-xr-x1 root  root   688 Apr  7  2010 .profile
-rw-r--r--1 root  root 0 Apr  7  2010 .inputrc
lrwxrwxrwx1 root  root 8 Apr  7  2010 .bashrc - .profile
lrwxrwxrwx1 root  root 8 Apr  7  2010 .bash_profile - .profile
-rw-r--r--1 root  root 0 Apr  7  2010 .bash_logout
lrwxrwxrwx1 root  root 8 Apr  7  2010 .bash_login - .profile
drwx--2 ariel mygroup 4096 Apr 23  2010 .ssh
-rw---1 ariel mygroup 660 Apr  1 22:50 .Xauthority

cat .profile
#! /bin/rbash

declare -r PS1='(myhost)'

unset BASH_VERSION
unset HISTFILE
unset HISTFILESIZE
unset HOSTTYPE
unset MACHTYPE
unset OSTYPE
unset _INIT_PREV_LEVEL
unset _INIT_RUN_LEVEL
unset _INIT_RUN_NPREV
unset _INIT_UTS_ISA
unset _INIT_UTS_MACHINE
unset _INIT_UTS_NODENAME
unset _INIT_UTS_PLATFORM
unset _INIT_UTS_RELEASE
unset _INIT_UTS_SYSNAME
unset _INIT_UTS_VERSION

unset PATH
unset MAIL
unset MAILCHECK
unset HISTFILESIZE
unset HISTSIZE
unset HZ
unset PS2
unset PS4

declare -rx PATH=/usr/local/restricted
declare -rx HOSTNAME=myhost.mydomain
declare -rx TZ=Israel

echo 
Welcome to gate.

The following commands can be used: telnet, ssh.


declare -rx HOME=~
=

ls -l /usr/local/restricted
lrwxrwxrwx  1 root root 12 Apr 10  2006 ssh - /usr/bin/ssh
lrwxrwxrwx  1 root root 24 Mar 13  2006 telnet - /usr/kerberos/bin/telnet

-- Ariel
 --
 Ariel Biener
 e-mail: ar...@post.tau.ac.il
 PGP: http://www.tau.ac.il/~ariel/pgp.html


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Relocatable linking on x86-64 for i386

2011-04-04 Thread Valery Reznic


--- On Mon, 4/4/11, Shachar Shemesh shac...@shemesh.biz wrote:

 From: Shachar Shemesh shac...@shemesh.biz
 Subject: Re: Relocatable linking on x86-64 for i386
 To: Valery Reznic valery_rez...@yahoo.com
 Cc: linux-il@cs.huji.ac.il
 Date: Monday, April 4, 2011, 11:13 AM
 On 04/04/11 10:15, Valery Reznic
 wrote:
  Hello. I am trying to make relocatable linking on
 x86-64 box for objects in format i386
  
  Naive
  
  ld -r file1.o file2.o -o output.o
  
  produce
  ld: Relocatable linking with relocations from format
 elf32-i386 (file1.o) to format elf64-x86-64 (output.o) is
 not supported
  
  But even when I add --oformat situation not improved:
  
  ld --output-format elf32-i386 -r file1.o file2.o -o
 output.o
  ld: Relocatable linking with relocations from format
 elf32-i386 (file1.o) to format elf32-i386 (output.o) is not
 supported
  
  So linker correctly recognize what input and output
 format should be,
  but for some reason don't want do it.
  
  Do you have any ideas if it can be done at all and
 how?
     
 Can't. You're trying to link objects compiled for different
 machine codes. Tis not the linking stage that is wrong.

I am not trying to mix i386 and x86_64 code in the same object.

I have two object files for i386 and I want to combine it into one object file 
for i386 two.

It works perfectly well on i386 box, but on x86-64 it's not.

Valery.

 
 While it is possible to run both machine codes on your
 computer, they must run in different processes (the kernel
 actually treats x86 and amd64 codes differently when it sets
 up the registers for the context switch), and thus you
 cannot link them into a single executable, cannot
 dynamically load one from the other, and cannot have two
 threads with different types. Your only option for
 interaction is RPC of some sort (or recompile one of them).
 
 Shachar
 
 -- Shachar Shemesh
 Lingnu Open Source Consulting Ltd.
 http://www.lingnu.com
 
 

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Relocatable linking on x86-64 for i386

2011-04-04 Thread shimi
On Mon, Apr 4, 2011 at 10:15 AM, Valery Reznic valery_rez...@yahoo.comwrote:

 Hello. I am trying to make relocatable linking on x86-64 box for objects in
 format i386

 Naive

 ld -r file1.o file2.o -o output.o

 produce
 ld: Relocatable linking with relocations from format elf32-i386 (file1.o)
 to format elf64-x86-64 (output.o) is not supported

 But even when I add --oformat situation not improved:

 ld --output-format elf32-i386 -r file1.o file2.o -o output.o
 ld: Relocatable linking with relocations from format elf32-i386 (file1.o)
 to format elf32-i386 (output.o) is not supported

 So linker correctly recognize what input and output format should be,
 but for some reason don't want do it.

 Do you have any ideas if it can be done at all and how?


Maybe your system is pure-64 ? (i.e. no 32 bit libs / compiler / linker
support?)

Can you compile a 32 bit with gcc -m32 ?

-- Shimi
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Relocatable linking on x86-64 for i386

2011-04-04 Thread Gleb Natapov
On Mon, Apr 04, 2011 at 02:06:18AM -0700, Valery Reznic wrote:
 
 
 --- On Mon, 4/4/11, Shachar Shemesh shac...@shemesh.biz wrote:
 
  From: Shachar Shemesh shac...@shemesh.biz
  Subject: Re: Relocatable linking on x86-64 for i386
  To: Valery Reznic valery_rez...@yahoo.com
  Cc: linux-il@cs.huji.ac.il
  Date: Monday, April 4, 2011, 11:13 AM
  On 04/04/11 10:15, Valery Reznic
  wrote:
   Hello. I am trying to make relocatable linking on
  x86-64 box for objects in format i386
   
   Naive
   
   ld -r file1.o file2.o -o output.o
   
   produce
   ld: Relocatable linking with relocations from format
  elf32-i386 (file1.o) to format elf64-x86-64 (output.o) is
  not supported
   
   But even when I add --oformat situation not improved:
   
   ld --output-format elf32-i386 -r file1.o file2.o -o
  output.o
   ld: Relocatable linking with relocations from format
  elf32-i386 (file1.o) to format elf32-i386 (output.o) is not
  supported
   
   So linker correctly recognize what input and output
  format should be,
   but for some reason don't want do it.
   
   Do you have any ideas if it can be done at all and
  how?
      
  Can't. You're trying to link objects compiled for different
  machine codes. Tis not the linking stage that is wrong.
 
 I am not trying to mix i386 and x86_64 code in the same object.
 
 I have two object files for i386 and I want to combine it into one object 
 file for i386 two.
 
 It works perfectly well on i386 box, but on x86-64 it's not.
 

ld -m  elf_i386 -r file1.o file2.o -o output.o

 Valery.
 
  
  While it is possible to run both machine codes on your
  computer, they must run in different processes (the kernel
  actually treats x86 and amd64 codes differently when it sets
  up the registers for the context switch), and thus you
  cannot link them into a single executable, cannot
  dynamically load one from the other, and cannot have two
  threads with different types. Your only option for
  interaction is RPC of some sort (or recompile one of them).
  
  Shachar
  
  -- Shachar Shemesh
  Lingnu Open Source Consulting Ltd.
  http://www.lingnu.com
  
  
 
 ___
 Linux-il mailing list
 Linux-il@cs.huji.ac.il
 http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

--
Gleb.

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Relocatable linking on x86-64 for i386

2011-04-04 Thread Valery Reznic

ld --output-format elf32-i386 -r file1.o
 file2.o -o
   output.o
ld: Relocatable linking with relocations
 from format
   elf32-i386 (file1.o) to format elf32-i386
 (output.o) is not
   supported

 
 ld -m  elf_i386 -r file1.o file2.o -o output.o
Thanks, it works!! Great!!!

Valery


 
  Valery.
  
   
   While it is possible to run both machine codes on
 your
   computer, they must run in different processes
 (the kernel
   actually treats x86 and amd64 codes differently
 when it sets
   up the registers for the context switch), and
 thus you
   cannot link them into a single executable,
 cannot
   dynamically load one from the other, and cannot
 have two
   threads with different types. Your only option
 for
   interaction is RPC of some sort (or recompile one
 of them).
   
   Shachar
   
   -- Shachar Shemesh
   Lingnu Open Source Consulting Ltd.
   http://www.lingnu.com
   
   
  
  ___
  Linux-il mailing list
  Linux-il@cs.huji.ac.il
  http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
 
 --
            
 Gleb.
 

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


MediaWiki sorting the Hebrew Alphabet

2011-04-04 Thread Ira Abramov
On several sites I manage I have this problem - Category pages display
articles and subcategories sorted absolutely wrong. As far as I can tell
this is only a Hebrew issue. Anyone got a clue? Someone told me it may
be a question of DB collation or something, but I don't want to touch
anything irreversibly without knowing exactly what would happen.


Example:
http://ecowiki.site.co.il/%D7%A7%D7%98%D7%92%D7%95%D7%A8%D7%99%D7%94:%D7%9E%D7%A2%D7%A8%D7%9B%D7%95%D7%AA

-- 
King of the wild things
Ira Abramov
http://ira.abramov.org/email/

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Relocatable linking on x86-64 for i386

2011-04-04 Thread Ehud Karni
On Mon, 4 Apr 2011 13:15:39 Gleb Natapov wrote:

   On 04/04/11 10:15, Valery Reznic wrote:
Hello. I am trying to make relocatable linking on
   x86-64 box for objects in format i386

 ld -m  elf_i386 -r file1.o file2.o -o output.o

If you use gcc for compiling you can do  gcc -m32 arguments
to compile and link.

In fact you can do: gcc -m32 file1.o file2.o -o output.o
instead of calling ld directly.

Ehud.


--
 Ehud Karni   Tel: +972-3-7966-561  /\
 Mivtach - Simon  Fax: +972-3-7976-561  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D http://www.keyserver.net/Better Safe Than Sorry

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: MediaWiki sorting the Hebrew Alphabet

2011-04-04 Thread Herouth Maoz

Quoting Ira Abramov lists-linux...@ira.abramov.org:


Quoting Herouth Maoz, from the post of Mon, 04 Apr:


Which database are you using? As far as I know, both PostgreSQL and
MySQL are dependent on the usual libraries for their sorting algorithms,
and therefore on the variable LC_COLLATE.


using MySQL and the collation is settable after the fact, but I'm not
sure which table/column to change and to what.


As far as I can gather, you can sort with a specific collation, but  
this would mean going through the entire application and changing the  
SQL statements to use the COLLATE operator. I wouldn't go that way. I  
believe in order to solve the problem you have to set up your database  
with the proper collation to begin with - dump the database to text,  
re-create it with proper character set and collation, and then reload  
it.


I think utf8 and utf8_general_ci are supposed to work properly for  
Hebrew. You can always test it by creating a little database somewhere  
with the settings you expect to work, create a table, insert a few  
words in Hebrew, and select it with order by.


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: MediaWiki sorting the Hebrew Alphabet

2011-04-04 Thread Herouth Maoz

Quoting Ira Abramov lists-linux...@ira.abramov.org:


On several sites I manage I have this problem - Category pages display
articles and subcategories sorted absolutely wrong. As far as I can tell
this is only a Hebrew issue. Anyone got a clue? Someone told me it may
be a question of DB collation or something, but I don't want to touch
anything irreversibly without knowing exactly what would happen.


Which database are you using? As far as I know, both PostgreSQL and  
MySQL are dependent on the usual libraries for their sorting  
algorithms, and therefore on the variable LC_COLLATE.


I'm not sure, though, whether it's something you can change in  
runtime. Last time that I tried, PostgreSQL took the value of the  
environment variable at the time of creation of a database cluster,  
which meant that changing it would require backing up, re-creating the  
cluster, and reloading the database. I'm less familiar with mySQL and  
how it relates to said environment variable.


Herouth

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


VLC can read it but I cannot?

2011-04-04 Thread Gabor Szabo
I have a CD with a short video film on it. I can see the video using
VLC but when I try to copy the
VIDEO_TS I get an error:


ls -al /media/cdrom/
ls: cannot access /media/cdrom/.: Permission denied
ls: cannot access /media/cdrom/..: Permission denied
ls: cannot access /media/cdrom/VIDEO_TS: Permission denied
total 0
d? ? ? ? ?? .
d? ? ? ? ?? ..
?? ? ? ? ?? VIDEO_TS
gabor@localhost:~$ ls -al /media/cdrom/VIDEO_TS
ls: cannot access /media/cdrom/VIDEO_TS: Permission denied


sudo ls -la /media/cdrom/
ls: cannot access /media/cdrom/VIDEO_TS: Permission denied
total 6
dr--r--r-- 3 4294967295 4294967295   88 2006-09-26 16:23 .
drwxr-xr-x 4 root   root   4096 2011-04-04 23:00 ..
?? ? ?  ? ?? VIDEO_TS
gabor@localhost:~$ sudo ls -la /media/cdrom/VIDEO_TS
ls: cannot access /media/cdrom/VIDEO_TS: Permission denied

Any idea why is that and how could I copy the video?


BTW running Ubuntu 10.10 and this is a personal video.

Gabor

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: VLC can read it but I cannot?

2011-04-04 Thread shimi
On Tue, Apr 5, 2011 at 12:56 AM, Gabor Szabo szab...@gmail.com wrote:

 I have a CD with a short video film on it. I can see the video using
 VLC but when I try to copy the
 VIDEO_TS I get an error:


 ls -al /media/cdrom/
 ls: cannot access /media/cdrom/.: Permission denied
 ls: cannot access /media/cdrom/..: Permission denied
 ls: cannot access /media/cdrom/VIDEO_TS: Permission denied
 total 0
 d? ? ? ? ?? .
 d? ? ? ? ?? ..
 ?? ? ? ? ?? VIDEO_TS
 gabor@localhost:~$ ls -al /media/cdrom/VIDEO_TS
 ls: cannot access /media/cdrom/VIDEO_TS: Permission denied


 sudo ls -la /media/cdrom/
 ls: cannot access /media/cdrom/VIDEO_TS: Permission denied
 total 6
 dr--r--r-- 3 4294967295 4294967295   88 2006-09-26 16:23 .
 drwxr-xr-x 4 root   root   4096 2011-04-04 23:00 ..
 ?? ? ?  ? ?? VIDEO_TS
 gabor@localhost:~$ sudo ls -la /media/cdrom/VIDEO_TS
 ls: cannot access /media/cdrom/VIDEO_TS: Permission denied

 Any idea why is that and how could I copy the video?


You could unmount /media/cdrom and just dd the whole device into an iso
file. Maybe it's even how VLC plays it :)

-- Shimi
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: VLC can read it but I cannot?

2011-04-04 Thread ik
How did you mount the CD ?

When you write
$ mount

What are the information you have on it ?

Ido
LINESIP - Opening the source for communication
http://www.linesip.com
http://www.linesip.co.il




On Tue, Apr 5, 2011 at 00:56, Gabor Szabo szab...@gmail.com wrote:

 I have a CD with a short video film on it. I can see the video using
 VLC but when I try to copy the
 VIDEO_TS I get an error:


 ls -al /media/cdrom/
 ls: cannot access /media/cdrom/.: Permission denied
 ls: cannot access /media/cdrom/..: Permission denied
 ls: cannot access /media/cdrom/VIDEO_TS: Permission denied
 total 0
 d? ? ? ? ?? .
 d? ? ? ? ?? ..
 ?? ? ? ? ?? VIDEO_TS
 gabor@localhost:~$ ls -al /media/cdrom/VIDEO_TS
 ls: cannot access /media/cdrom/VIDEO_TS: Permission denied


 sudo ls -la /media/cdrom/
 ls: cannot access /media/cdrom/VIDEO_TS: Permission denied
 total 6
 dr--r--r-- 3 4294967295 4294967295   88 2006-09-26 16:23 .
 drwxr-xr-x 4 root   root   4096 2011-04-04 23:00 ..
 ?? ? ?  ? ?? VIDEO_TS
 gabor@localhost:~$ sudo ls -la /media/cdrom/VIDEO_TS
 ls: cannot access /media/cdrom/VIDEO_TS: Permission denied

 Any idea why is that and how could I copy the video?


 BTW running Ubuntu 10.10 and this is a personal video.

 Gabor

 ___
 Linux-il mailing list
 Linux-il@cs.huji.ac.il
 http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il