Global and User package database

2011-12-15 Thread Mehmet Erol Sanliturk
Dear All ,


In the new PkgNG :

https://github.com/pkgng/pkgng/blob/master/pkg/add.c


the following statement is written :

if (geteuid() != 0) {
warnx(adding packages can only be done as root);
return (EX_NOPERM);
}


Instead of the above statement , is it possible to use a statement
as follows ( which it may be defined as a function to be called from all
the related
functions / programs ) :



if (geteuid() == 0) {

 package_db_path = ... global path name ... , etc. ;


 PKGDB_PLACE  =  PKGDB_DEFAULT ...  etc.


} else
 {


 package_db_path = ... local path name , ie.
 in $HOME about user path name ... , etc. ;

  PKGDB_PLACE  =  PKGDB_USER ... etc.

  }

if (pkgdb_open(db, PKGDB_PLACE) != EPKG_OK) {
 return (EX_IOERR);
}


( Replace PKGDB_PLACE by a suitable name ... )


In that way , it will be possible to install packages into user home
directory ,
instead of global package directory .

For security concerns , user-installed packages will not be usable globally
, or
convenient only for the user .



Thank you very much .

Mehmet Erol Sanliturk
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Global and User package database

2011-12-15 Thread Baptiste Daroussin
On Thu, Dec 15, 2011 at 02:10:57PM -0500, Mehmet Erol Sanliturk wrote:
 Dear All ,
 
 
 In the new PkgNG :
 
 https://github.com/pkgng/pkgng/blob/master/pkg/add.c
 
 
 the following statement is written :
 
 if (geteuid() != 0) {
 warnx(adding packages can only be done as root);
 return (EX_NOPERM);
 }
 
 
 Instead of the above statement , is it possible to use a statement
 as follows ( which it may be defined as a function to be called from all
 the related
 functions / programs ) :
 
 
 
 if (geteuid() == 0) {
 
  package_db_path = ... global path name ... , etc. ;
 
 
  PKGDB_PLACE  =  PKGDB_DEFAULT ...  etc.
 
 
 } else
  {
 
 
  package_db_path = ... local path name , ie.
  in $HOME about user path name ... , etc. ;
 
   PKGDB_PLACE  =  PKGDB_USER ... etc.
 
   }
 
 if (pkgdb_open(db, PKGDB_PLACE) != EPKG_OK) {
  return (EX_IOERR);
 }
 
 
 ( Replace PKGDB_PLACE by a suitable name ... )
 
 
 In that way , it will be possible to install packages into user home
 directory ,
 instead of global package directory .
 
 For security concerns , user-installed packages will not be usable globally
 , or
 convenient only for the user .
 
 
 
 Thank you very much .
 
 Mehmet Erol Sanliturk

This is an interesting idea, but it deserves more thinking about it, because it
could have more impacts.

Could you please fill an issue on the github so that we won't forget the idea
and will be able to discuss it.

I don't think we will propose that feature for 1.0 but maybe it could be
discussed for 2.0 :)

regards,
Bapt


pgpuuX6rf9FAs.pgp
Description: PGP signature


Re: Global and User package database

2011-12-15 Thread Mehmet Erol Sanliturk
On Thu, Dec 15, 2011 at 4:06 PM, Baptiste Daroussin b...@freebsd.orgwrote:

 On Thu, Dec 15, 2011 at 02:10:57PM -0500, Mehmet Erol Sanliturk wrote:
  Dear All ,
 
 
  In the new PkgNG :
 
  https://github.com/pkgng/pkgng/blob/master/pkg/add.c
 
 
  the following statement is written :
 
  if (geteuid() != 0) {
  warnx(adding packages can only be done as root);
  return (EX_NOPERM);
  }
 
 
  Instead of the above statement , is it possible to use a statement
  as follows ( which it may be defined as a function to be called from all
  the related
  functions / programs ) :
 
 
 
  if (geteuid() == 0) {
 
   package_db_path = ... global path name ... , etc. ;
 
 
   PKGDB_PLACE  =  PKGDB_DEFAULT ...  etc.
 
 
  } else
   {
 
 
   package_db_path = ... local path name , ie.
   in $HOME about user path name ... , etc. ;
 
PKGDB_PLACE  =  PKGDB_USER ... etc.
 
}
 
  if (pkgdb_open(db, PKGDB_PLACE) != EPKG_OK) {
   return (EX_IOERR);
  }
 
 
  ( Replace PKGDB_PLACE by a suitable name ... )
 
 
  In that way , it will be possible to install packages into user home
  directory ,
  instead of global package directory .
 
  For security concerns , user-installed packages will not be usable
 globally
  , or
  convenient only for the user .
 
 
 
  Thank you very much .
 
  Mehmet Erol Sanliturk

 This is an interesting idea, but it deserves more thinking about it,
 because it
 could have more impacts.

 Could you please fill an issue on the github so that we won't forget the
 idea
 and will be able to discuss it.

 I don't think we will propose that feature for 1.0 but maybe it could be
 discussed for 2.0 :)

 regards,
 Bapt




The issue has been created .

During program writing , design and implementation at the beginning is much
more easier than modifications
performed after a completed design and implementation .


Thank you very much .

Mehmet Erol Sanliturk
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Global and User package database

2011-12-15 Thread Baptiste Daroussin
On Thu, Dec 15, 2011 at 10:13:19PM -0500, Mehmet Erol Sanliturk wrote:
 On Thu, Dec 15, 2011 at 4:06 PM, Baptiste Daroussin b...@freebsd.orgwrote:
 
  On Thu, Dec 15, 2011 at 02:10:57PM -0500, Mehmet Erol Sanliturk wrote:
   Dear All ,
  
  
   In the new PkgNG :
  
   https://github.com/pkgng/pkgng/blob/master/pkg/add.c
  
  
   the following statement is written :
  
   if (geteuid() != 0) {
   warnx(adding packages can only be done as root);
   return (EX_NOPERM);
   }
  
  
   Instead of the above statement , is it possible to use a statement
   as follows ( which it may be defined as a function to be called from all
   the related
   functions / programs ) :
  
  
  
   if (geteuid() == 0) {
  
package_db_path = ... global path name ... , etc. ;
  
  
PKGDB_PLACE  =  PKGDB_DEFAULT ...  etc.
  
  
   } else
{
  
  
package_db_path = ... local path name , ie.
in $HOME about user path name ... , etc. ;
  
 PKGDB_PLACE  =  PKGDB_USER ... etc.
  
 }
  
   if (pkgdb_open(db, PKGDB_PLACE) != EPKG_OK) {
return (EX_IOERR);
   }
  
  
   ( Replace PKGDB_PLACE by a suitable name ... )
  
  
   In that way , it will be possible to install packages into user home
   directory ,
   instead of global package directory .
  
   For security concerns , user-installed packages will not be usable
  globally
   , or
   convenient only for the user .
  
  
  
   Thank you very much .
  
   Mehmet Erol Sanliturk
 
  This is an interesting idea, but it deserves more thinking about it,
  because it
  could have more impacts.
 
  Could you please fill an issue on the github so that we won't forget the
  idea
  and will be able to discuss it.
 
  I don't think we will propose that feature for 1.0 but maybe it could be
  discussed for 2.0 :)
 
  regards,
  Bapt
 
 
 
 
 The issue has been created .
 
 During program writing , design and implementation at the beginning is much
 more easier than modifications
 performed after a completed design and implementation .
 
 

It is no more the begining of pkgng for long :)

Yes that is what we do, and because pkgng is very close to the doors we won't
break its design now, while we are ready to do it for 2.0 :)

regards,
Bapt


pgpbCiKsfQIxw.pgp
Description: PGP signature