Bug 682 - to shot command name in <sys/acct.h>
Summary: to shot command name in <sys/acct.h>
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1995-08-14 00:20 UTC by Wolfram Schneider
Modified: 1995-08-17 01:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfram Schneider 1995-08-14 00:20:01 UTC
$ more /usr/include/sys/acct.h
struct acct {
        char    ac_comm[10];    /* command name */
                        ^^
This should be 16 and a macro.

Fix: 

/usr/include/sys/acct.h:

#define AC_COMM_LEN 16
struct acct {
        char    ac_comm[AC_COMM_LEN];    /* command name */
How-To-Repeat: 
$ set /bin /sbin /usr/bin /usr/sbin /usr/libexec 
$ ls -R $* | \
  awk '{l = length($0); if (l > 10) { printf("%-16s %d\n", $0, l)}}' | \
  grep -v :

mount_cd9660     12
mount_fdesc      11
mount_kernfs     12
mount_msdos      11
mount_portal     12
mount_procfs     12
mount_union      11
lfs_cleanerd     12
locate.bigram    13
locate.code      11
locate.updatedb  15
rpc.rusersd      11
named.reload     12
named.restart    13
Comment 1 Joerg Wunsch 1995-08-14 07:18:54 UTC
As Wolfram Schneider wrote:
> 
> /usr/include/sys/acct.h:
> 
> #define AC_COMM_LEN 16
> struct acct {
>         char    ac_comm[AC_COMM_LEN];    /* command name */

What incompatibilites will this produce?  Is it just lastcomm(1)
that has to be recompiled?

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)
Comment 2 Wolfram Schneider 1995-08-14 11:20:01 UTC
J. Wunsch writes:
>As Wolfram Schneider wrote:
>> 
>> /usr/include/sys/acct.h:
>> 
>> #define AC_COMM_LEN 16
>> struct acct {
>>         char    ac_comm[AC_COMM_LEN];    /* command name */
>
>What incompatibilites will this produce?  Is it just lastcomm(1)
>that has to be recompiled?

$gfind . -name '*.[ch]' | xargs egrep -l '<sys/acct.h>' > a
$cat a
./usr.sbin/sa/usrdb.c
./usr.sbin/sa/main.c
./usr.sbin/sa/pdb.c
./usr.bin/lastcomm/lastcomm.c
./sys/kern/kern_exec.c
./sys/kern/kern_fork.c
./sys/kern/kern_proc.c
./sys/kern/kern_sig.c
./sys/kern/kern_prot.c
./sys/kern/kern_acct.c
./sys/i386/i386/trap.c
./sys/i386/i386/math_emulate.c

$xargs egrep -l ac_comm < a
./usr.sbin/sa/main.c
./usr.bin/lastcomm/lastcomm.c
./sys/kern/kern_acct.c


--
Wolfram Schneider <wosch@cs.tu-berlin.de>
<a href="http://hyperg.cs.tu-berlin.de/C~wosch">me</a>
Comment 3 jkh freebsd_committer freebsd_triage 1995-08-17 01:50:11 UTC
State Changed
From-To: open->closed

Supplied fix adopted.