Re: Where is the next uid from adduser pulled from?

2007-12-17 Thread n j
 Tried looking for the adduser program, but could not find adduser.c

Just to point out that adduser is a shell script, as witnessed by:

# file /usr/sbin/adduser
/usr/sbin/adduser: Bourne shell script text executable

and the response to the original question - how does the system
generate new UIDs - is best answered by examining the get_nextuid ()
function inside adduser script.

Regards,
-- 
Nino
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Where is the next uid from adduser pulled from?

2007-12-13 Thread Jonathan McKeown
On Wednesday 12 December 2007 20:04, Andrew Pantyukhin wrote:
 On Wed, Dec 12, 2007 at 12:00:06PM -0500, Francisco Reyes wrote:
  I have scripts to add new users. However, after that any port that
  installs a user creates it with a UID after the ones I made.
 
  For example I want all employees to have uids starting at 5000, but I
  would like too port installed uids to be 2000 and up. After I add some
  users (ie say last user is 5008), the next port that installs a user and
  doesn't specify uid.. then will get 5009.
 
  Tried looking for the adduser program, but could not find adduser.c

 It's pw(8) that selects default uids and it just takes the last
 one (numerically) and uses the next one.

 Create a placeholder user with uid 5000 and let ports use uids
 5000+, but when creating new users, specify uids manually (both
 pw and adduser allow that).

Alternatively, create/edit /etc/pw.conf including

minuid 2000
maxuid 4999
reuseuids yes

This will cause automatic uses of pw(8) (such as port installations) to use 
uids between 2000 and 4999, and to ``fill in the gaps''.

When adding a user by hand, use

pw -C /dev/null

to tell pw to ignore pw.conf(5) and get the default behaviour (which is to use 
the uid one higher than the highest ever used).

adduser(8) should just DTRT, but you can make sure by adding to the flags -u 
uid_start which will use the next available uid after uid_start (which it 
identifies by testing each uid in turn for existence, not by just using pw 
usernext).

Jonathan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Where is the next uid from adduser pulled from?

2007-12-12 Thread Francisco Reyes
I have scripts to add new users. However, after that any port that installs 
a user creates it with a UID after the ones I made.


For example I want all employees to have uids starting at 5000, but I would 
like too port installed uids to be 2000 and up. After I add some users (ie 
say last user is 5008), the next port that installs a user and doesn't 
specify uid.. then will get 5009.


Tried looking for the adduser program, but could not find adduser.c

Any pointers would be greatly appreciated.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Where is the next uid from adduser pulled from?

2007-12-12 Thread Andrew Pantyukhin
On Wed, Dec 12, 2007 at 12:00:06PM -0500, Francisco Reyes wrote:
 I have scripts to add new users. However, after that any port that installs 
 a user creates it with a UID after the ones I made.
 
 For example I want all employees to have uids starting at 5000, but I would 
 like too port installed uids to be 2000 and up. After I add some users (ie 
 say last user is 5008), the next port that installs a user and doesn't 
 specify uid.. then will get 5009.
 
 Tried looking for the adduser program, but could not find adduser.c

It's pw(8) that selects default uids and it just takes the last
one (numerically) and uses the next one.

Create a placeholder user with uid 5000 and let ports use uids
5000+, but when creating new users, specify uids manually (both
pw and adduser allow that).

Good luck!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Where is the next uid from adduser pulled from?

2007-12-12 Thread Philip M. Gollucci
Francisco Reyes wrote:
 I have scripts to add new users. However, after that any port that installs
 a user creates it with a UID after the ones I made.
 
 For example I want all employees to have uids starting at 5000, but I would
 like too port installed uids to be 2000 and up. After I add some users (ie
 say last user is 5008), the next port that installs a user and doesn't
 specify uid.. then will get 5009.
 
 Tried looking for the adduser program, but could not find adduser.c
/usr/src/usr.sbin/pw

Ports call 'pw add user x', and pw add group y'


-- 

Philip M. Gollucci ([EMAIL PROTECTED])
o:703.549.2050x206
Senior System Admin - Riderway, Inc.
http://riderway.com / http://ridecharge.com
1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB  B89E 1324 9B4F EC88 A0BF

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]