Re: Adduser difference between 5.0 and earlier versions

2003-01-22 Thread Scot Hetzel
Here's the requested changes to make it re'ask the question on
an invalid input.

I left the code in for the default answer, but commented out.

Scot

Index: adduser.sh
===
RCS file: /home/ncvs/src/usr.sbin/adduser/adduser.sh,v
retrieving revision 1.3
diff -u -r1.3 adduser.sh
--- adduser.sh  3 Dec 2002 05:41:09 -   1.3
+++ adduser.sh  22 Jan 2003 15:38:02 -
@@ -871,4 +871,22 @@
fi
 else
input_interactive
+   while : ; do
+   echo -n Add another user? (yes/no): 
+   read _input
+#  [ -z $_input ]  _input=No
+   case $_input in
+   [Yy][Ee][Ss]|[Yy][Ee]|[Yy])
+   input_interactive
+   continue
+   ;;
+   [Nn][Oo]|[Nn])
+   echo Goodbye!
+   ;;
+   *)
+   continue
+   ;;
+   esac
+   break
+   done
 fi

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Adduser difference between 5.0 and earlier versions

2003-01-22 Thread Scot Hetzel
Use this patch, as it fixes the value of uidstart to be the next
available uid, instead of the uid of the previously added user.

Scot

Index: adduser.sh
===
RCS file: /home/ncvs/src/usr.sbin/adduser/adduser.sh,v
retrieving revision 1.3
diff -u -r1.3 adduser.sh
--- adduser.sh  3 Dec 2002 05:41:09 -   1.3
+++ adduser.sh  22 Jan 2003 18:12:02 -
@@ -871,4 +871,23 @@
fi
 else
input_interactive
+   while : ; do
+   echo -n Add another user? (yes/no): 
+   read _input
+#  [ -z $_input ]  _input=No
+   case $_input in
+   [Yy][Ee][Ss]|[Yy][Ee]|[Yy])
+   uidstart=`get_nextuid $uidstart`
+   input_interactive
+   continue
+   ;;
+   [Nn][Oo]|[Nn])
+   echo Goodbye!
+   ;;
+   *)
+   continue
+   ;;
+   esac
+   break
+   done
 fi

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Adduser difference between 5.0 and earlier versions

2003-01-21 Thread Scot W. Hetzel
I noticed that adduser in 5.0, only allows you to add one user
in interactive mode.  The previous version of adduser would ask
you if you wanted to add another user.

Attached is a patch which puts this feature back into adduser.

Scot

Index: adduser.sh
===
RCS file: /home/ncvs/src/usr.sbin/adduser/adduser.sh,v
retrieving revision 1.3
diff -u -r1.3 adduser.sh
--- adduser.sh  3 Dec 2002 05:41:09 -   1.3
+++ adduser.sh  21 Jan 2003 22:35:39 -
@@ -870,5 +870,22 @@
fi
fi
 else
-   input_interactive
+   while : ; do
+   input_interactive
+   echo -n Add another user? (yes/No): 
+   read _input
+   [ -z $_input ]  _input=No
+   case $_input in
+   [Yy][Ee][Ss]|[Yy][Ee]|[Yy])
+   continue
+   ;;
+   [Nn][Oo]|[Nn])
+   echo Goodbye!
+   ;;
+   *)
+   continue
+   ;;
+   esac
+   break
+   done
 fi

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Adduser difference between 5.0 and earlier versions

2003-01-21 Thread Mike Makonnen

The new adduser was not intended to be a feature-for-feature replacement of the
perl version. This version allows you to enter multiple accounts from a file, so
providing this type of functionality wasn't particularly important on my list of
things to do. 

But, as long as someonle else is submitting the patch, that's fine
with me :-)  I have one request though: All the other yes/no prompts will repeat
the prompt if they get anything other than what they expect, can you redo the
patch so that it repeats the prompt if it gets no input or anything other than
yes/no? For consistency's sake.

Cheers.
-- 
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
[EMAIL PROTECTED] | Fingerprint: D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9



msg50684/pgp0.pgp
Description: PGP signature