[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Username length inconsistencies.



> > Installation script for my program (WXftp) will break :)
> > It checks whether it is running by "root" user.
> > dh_testroot from debhelper does exactly the same, btw.
> 
> Ugh.
> 
> TTBOMK, it's generally better to test for uid 0 than any particular
> username, so dh_testroot should probably have something like the following
> patch applied:
> 
> --- /usr/bin/dh_testroot	Tue Mar 31 14:50:14 1998
> +++ dh_testroot_new	Mon Jun  1 12:12:24 1998
> @@ -5,6 +5,6 @@
>  PATH=debian:$PATH:/usr/lib/debhelper
>  . dh_lib
>  
> -if  [ "`whoami`" != root ]; then
> +if  [ "`id -u`" != 0 ]; then
>  	error "You must run this as root."
>  fi
> 
> Are there any problems with doing things this way?

Well, this way is probably OK for dh_testroot, but "id -u" is absolutely 
non-portable thing across different UNIX platforms... :( 

Alex Y.

-- 
   _ 
 _( )_
(     (o___           +-------------------------------------------+
 |      _ 7           |            Alexander Yukhimets            |
  \    (")            |       http://pages.nyu.edu/~aqy6633/      |
  /     \ \           +-------------------------------------------+


--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: