new pw(8) feature - home directory permissions.

2002-12-18 Thread Kutulu
(I apologize in advance if this is too mundane for -hackers...)

After seeing multiple people on IRC ask how to specify the permissions for the home 
directory 
adduser(8) creates, I went in and added that feature to pw(8).

A diff is attached.  As this is my first FreeBSD diff ever, comments from veteran 
hackers are 
highly requested.  If this is something people find useful, I will also go into 
adduser(8) and 
add support for the new flag there, and of course, edit the man pages.

In particular, I want someone who knows what they're doing to make sure I have my 
types and 
signs and such correct.  I also don't like 'f' as the name of the option but the 
obvious ones 
('m' and 'p') are taken.

Thanks,

--Mike Edenfield




diff -ur pw.old/pw.c pw/pw.c
--- pw.old/pw.c Sat Apr  6 00:19:11 2002
+++ pw/pw.c Thu Dec 19 01:41:56 2002
@@ -106,7 +106,7 @@
static const char *opts[W_NUM][M_NUM] =
{
{ /* user */
-   V:C:qn:u:c:d:e:p:g:G:mk:s:oL:i:w:h:Db:NPy:Y,
+   V:C:qn:u:c:d:e:f:p:g:G:mk:s:oL:i:w:h:Db:NPy:Y,
V:C:qn:u:rY,
V:C:qn:u:c:d:e:p:g:G:ml:k:s:w:L:h:FNPY,
V:C:qn:u:FPa7,
@@ -306,6 +306,7 @@
\t-u uid user id\n
\t-c comment user name/comment\n
\t-d directory   home directory\n
+   \t-f perms   permissions for home dir\n
\t-e dateaccount expiry date\n
\t-p datepassword expiry date\n
\t-g grp initial group\n
@@ -321,6 +322,7 @@
\t-V etcdir  alternate /etc location\n
\t-D set user defaults\n
\t-b dir default home root dir\n
+   \t-f perms   default home dir permissions\n
\t-e period  default expiry period\n
\t-p period  default password change period\n
\t-g group   default group\n
diff -ur pw.old/pw.h pw/pw.h
--- pw.old/pw.h Sat Apr  6 00:19:11 2002
+++ pw/pw.h Thu Dec 19 01:49:01 2002
@@ -81,6 +81,7 @@
char*newmail;   /* Mail to send to new accounts */
char*logfile;   /* Where to log changes */
char*home;  /* Where to create home directory */
+   mode_t  homeperms;  /* What permission to give home directory */
char*shelldir;  /* Where shells are located */
char**shells;   /* List of shells */
char*shell_default; /* Default shell */
@@ -97,6 +98,7 @@
 #define _PATH_PW_CONF  /etc/pw.conf
 #define _UC_MAXLINE1024
 #define _UC_MAXSHELLS  32
+#define _UC_DEFPERMS   S_IRWXU || S_IRGRP || S_IROTH
 
 struct userconf *read_userconfig(char const * file);
 int write_userconfig(char const * file);
diff -ur pw.old/pw_conf.c pw/pw_conf.c
--- pw.old/pw_conf.cSat Apr  6 00:19:11 2002
+++ pw/pw_conf.cThu Dec 19 02:02:25 2002
@@ -32,6 +32,7 @@
 #include string.h
 #include ctype.h
 #include fcntl.h
+#include sys/stat.h
 
 #include pw.h
 
@@ -47,6 +48,7 @@
_UC_NEWMAIL,
_UC_LOGFILE,
_UC_HOMEROOT,
+   _UC_HOMEPERMS,
_UC_SHELLPATH,
_UC_SHELLS,
_UC_DEFAULTSHELL,
@@ -90,6 +92,7 @@
NULL,   /* Mail to send to new accounts */
/var/log/userlog, /* Where to log changes */
/home,/* Where to create home directory */
+   _UC_DEFPERMS,   /* Permissions to give home directory */
/bin, /* Where shells are located */
system_shells,  /* List of shells (first is default) */
bourne_shell,   /* Default shell */
@@ -114,6 +117,7 @@
\n# Mail this file to new user (/etc/newuser.msg or no)\n,
\n# Log add/change/remove information in this file\n,
\n# Root directory in which $HOME directory is created\n,
+   \n# Permissions given to newly-created $HOME directory\n,
\n# Colon separated list of directories containing valid shells\n,
\n# Comma separated list of available shells (without paths)\n,
\n# Default shell (without path)\n,
@@ -139,6 +143,7 @@
newmail,
logfile,
home,
+   homeperms,
shellpath,
shells,
defaultshell,
@@ -294,6 +299,10 @@
config.home = (q == NULL || !boolean_val(q, 1))
? /home : newstr(q);
break;
+   case _UC_HOMEPERMS:
+   if ((q = 

Missing vendor info for generic Realtek clone (FBSD4.6)

2002-10-18 Thread Kutulu
I recently inherited a very old Compaq Presario which I decided to put
FreeBSD on.  The network card is a generic 10/100 card (it's so generic the
company name isn't anywhere on the card OR in the manual), but searching
google on the model number turns up a Windows and Linux driver and some DOS
real-mode utilities.

The card turns out to be based on the RealTek RTL8139 chipset, so I added
the rl driver and the miibus device to my kernel and rebuilt.  pccardd,
however, tells me that the vendor information is (null)((null)).
`pccardc dumpcis` also shows absolutely nothing, just a terminator.  I've
used `pccardc pccardmem` to set the pccard base memory locations to 0xd,
0xd4000, 0xd8000, and 0xdc000, all produce the same results.  I also tried
forcing pccardc to activate the card using `pccardc enabler` and the IRQ,
I/O port, and base memory location I read off the card using the real mode
DOS utilties, but I get a device is not confugured error.

I'm pretty sure my issue is that I'm not pointing the pccard system to the
right memory location, but I am now out of ideas on how to do so.  I have
the source code to the Linux realtek driver and what appears to be a snippet
from a Redhat 7.0 pcmcia.conf file from this card's vendor, but I have
managed to avoid knowing anything about Linux thus far and want to stay that
way :)

What steps can I take to locate the correct pccard configuration to use this
card?

Thanks for your time,

--Mike Edenfield ([EMAIL PROTECTED])


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