From bugmaster at FreeBSD.org Mon May 5 11:07:14 2008 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon May 5 11:07:28 2008 Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org Message-ID: <200805051107.m45B7DG8070858@freefall.freebsd.org> Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/25542 standards /bin/sh: null char in quoted string o stand/54410 standards one-true-awk not POSIX compliant (no extended REs) o stand/82654 standards C99 long double math functions are missing o stand/94729 standards [libc] fcntl() throws undocumented ENOTTY 4 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s bin/14925 standards getsubopt isn't poisonous enough o stand/21519 standards sys/dir.h should be deprecated some more o bin/24390 standards Replacing old dir-symlinks when using /bin/ln s stand/24590 standards timezone function not compatible witn Single Unix Spec f stand/25777 standards [kernel] [patch] atime not updated on exec a docs/26003 standards getgroups(2) lists NGROUPS_MAX but not syslimits.h o kern/27835 standards [libc] execve() doesn't conform to execve(2) spec in s s stand/36076 standards Implementation of POSIX fuser command o stand/39256 standards snprintf/vsnprintf aren't POSIX-conformant for strings p stand/41576 standards POSIX compliance of ln(1) o stand/44425 standards getcwd() succeeds even if current dir has perm 000. o stand/46119 standards Priority problems for SCHED_OTHER using pthreads o stand/54833 standards [pcvt] more pcvt deficits o stand/54839 standards [pcvt] pcvt deficits p stand/55112 standards glob.h, glob_t's gl_pathc should be "size_t", not "int o stand/56476 standards cd9660 unicode support simple hack o stand/58676 standards grantpt(3) alters storage used by ptsname(3) s stand/62858 standards malloc(0) not C99 compliant s kern/64875 standards [libc] [patch] [request] add a system call: fdatasync( o stand/66357 standards make POSIX conformance problem ('sh -e' & '+' command- o stand/66531 standards [libc] [patch] _gettemp uses a far smaller set of file o stand/70813 standards [PATCH] ls(1) not Posix compliant o stand/72006 standards floating point formating in non-C locales o stand/79056 standards regex(3) regression tests a stand/80293 standards sysconf() does not support well-defined unistd values o stand/81287 standards [PATCH]: fingerd(8) might send a line not ending in CR o stand/83845 standards [libm] [patch] add log2() and log2f() support for libm a stand/86484 standards [PATCH] mkfifo(1) uses wrong permissions o stand/92360 standards [headers] [patch] Missing TAB3 in kernel headers o stand/92362 standards [headers] [patch] Missing SIGPOLL in kernel headers o kern/93705 standards [headers] [patch] ENODATA and EGREGIOUS (for glibc com o stand/96016 standards [headers] clock_getres et al should be in o stand/96236 standards [PATCH] [POSIX] sed.1 incorrectly describes a function p stand/99517 standards Missing SIGRTMIN and SIGRTMAX signals o stand/99960 standards [Patch] make(1): Add -p flag o stand/100017 standards [Patch] Add fuser(1) functionality to fstat(1) o stand/104743 standards [headers] [patch] Wrong values for _POSIX_ minimal lim o stand/107561 standards [libc] [patch] [request] Missing SUS function tcgetsid o kern/114578 standards [libc] wide character printing using swprintf(dst, n, o stand/116081 standards make does not work with the directive sinclude o stand/116221 standards [kernel] [patch] [request] SUS issue -- FreeBSD has no o bin/116413 standards incorrect getconf(1) handling of unsigned constants gi o stand/116826 standards [PATCH] sh support for POSIX character classes o stand/118047 standards SUGGESTION: /etc/printcap vs mergemaster o stand/119804 standards [timedef] [patch] Invalid (long)date format in pl_PL.I o stand/120947 standards xsm ignores system.xsm and .xsmstartup o stand/121921 standards [patch] Add leap second support to at(1), atrun(8) o stand/122051 standards Add posix_spawn(3) 48 problems total. From disposable_freebsd at therag.org Thu May 8 06:50:01 2008 From: disposable_freebsd at therag.org (Will) Date: Thu May 8 06:50:04 2008 Subject: standards/123516: Daily Security Logs Not Reporting Failed Logins Message-ID: <200805080644.m486i26e076101@www.freebsd.org> >Number: 123516 >Category: standards >Synopsis: Daily Security Logs Not Reporting Failed Logins >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 08 06:50:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Will >Release: 7.0 >Organization: >Environment: FreeBSD Dogbert.NameBrandHandle.Net 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: My daily mails have stoped reporting failed logins when there are failed logins in /etc/auth.log I have traced this down as a formatting issue in the yestarday variable of /etc/periodic/800.loginfail When egrep runs it is using the yesterday variable which reads: "May 7 " The log files are being written to start "May 7 " This causes the egrep to fail, thus not displaying any logs >How-To-Repeat: When I look at the syntax of the yestarday variable date command, it outputs the correct format when run from the command line. /etc/periodic/security/800.loginfail: yesterday=`date -v-1d "+%b %e"` ------------------- Script Output: "May 7" Command Line Output: "May 7" >Fix: >Release-Note: >Audit-Trail: >Unformatted: From vwe at FreeBSD.org Thu May 8 08:35:34 2008 From: vwe at FreeBSD.org (vwe@FreeBSD.org) Date: Thu May 8 08:35:36 2008 Subject: conf/123516: [periodic] Daily Security Logs Not Reporting Failed Logins Message-ID: <200805080835.m488ZXfR006440@freefall.freebsd.org> Old Synopsis: Daily Security Logs Not Reporting Failed Logins New Synopsis: [periodic] Daily Security Logs Not Reporting Failed Logins Responsible-Changed-From-To: freebsd-standards->freebsd-bugs Responsible-Changed-By: vwe Responsible-Changed-When: Thu May 8 08:26:10 UTC 2008 Responsible-Changed-Why: reclassify http://www.freebsd.org/cgi/query-pr.cgi?pr=123516 From bugmaster at FreeBSD.org Mon May 12 11:07:06 2008 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon May 12 11:07:19 2008 Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org Message-ID: <200805121107.m4CB76gf038162@freefall.freebsd.org> Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/25542 standards /bin/sh: null char in quoted string o stand/54410 standards one-true-awk not POSIX compliant (no extended REs) o stand/82654 standards C99 long double math functions are missing o stand/94729 standards [libc] fcntl() throws undocumented ENOTTY 4 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s bin/14925 standards getsubopt isn't poisonous enough o stand/21519 standards sys/dir.h should be deprecated some more o bin/24390 standards Replacing old dir-symlinks when using /bin/ln s stand/24590 standards timezone function not compatible witn Single Unix Spec f stand/25777 standards [kernel] [patch] atime not updated on exec a docs/26003 standards getgroups(2) lists NGROUPS_MAX but not syslimits.h o kern/27835 standards [libc] execve() doesn't conform to execve(2) spec in s s stand/36076 standards Implementation of POSIX fuser command o stand/39256 standards snprintf/vsnprintf aren't POSIX-conformant for strings p stand/41576 standards POSIX compliance of ln(1) o stand/44425 standards getcwd() succeeds even if current dir has perm 000. o stand/46119 standards Priority problems for SCHED_OTHER using pthreads o stand/54833 standards [pcvt] more pcvt deficits o stand/54839 standards [pcvt] pcvt deficits p stand/55112 standards glob.h, glob_t's gl_pathc should be "size_t", not "int o stand/56476 standards cd9660 unicode support simple hack o stand/58676 standards grantpt(3) alters storage used by ptsname(3) s stand/62858 standards malloc(0) not C99 compliant s kern/64875 standards [libc] [patch] [request] add a system call: fdatasync( o stand/66357 standards make POSIX conformance problem ('sh -e' & '+' command- o stand/66531 standards [libc] [patch] _gettemp uses a far smaller set of file o stand/70813 standards [PATCH] ls(1) not Posix compliant o stand/72006 standards floating point formating in non-C locales o stand/79056 standards regex(3) regression tests a stand/80293 standards sysconf() does not support well-defined unistd values o stand/81287 standards [PATCH]: fingerd(8) might send a line not ending in CR o stand/83845 standards [libm] [patch] add log2() and log2f() support for libm a stand/86484 standards [PATCH] mkfifo(1) uses wrong permissions o stand/92360 standards [headers] [patch] Missing TAB3 in kernel headers o stand/92362 standards [headers] [patch] Missing SIGPOLL in kernel headers o kern/93705 standards [headers] [patch] ENODATA and EGREGIOUS (for glibc com o stand/96016 standards [headers] clock_getres et al should be in o stand/96236 standards [PATCH] [POSIX] sed.1 incorrectly describes a function p stand/99517 standards Missing SIGRTMIN and SIGRTMAX signals o stand/99960 standards [Patch] make(1): Add -p flag o stand/100017 standards [Patch] Add fuser(1) functionality to fstat(1) o stand/104743 standards [headers] [patch] Wrong values for _POSIX_ minimal lim o stand/107561 standards [libc] [patch] [request] Missing SUS function tcgetsid o kern/114578 standards [libc] wide character printing using swprintf(dst, n, o stand/116081 standards make does not work with the directive sinclude o stand/116221 standards [kernel] [patch] [request] SUS issue -- FreeBSD has no o bin/116413 standards incorrect getconf(1) handling of unsigned constants gi o stand/116826 standards [PATCH] sh support for POSIX character classes o stand/118047 standards SUGGESTION: /etc/printcap vs mergemaster o stand/119804 standards [timedef] [patch] Invalid (long)date format in pl_PL.I o stand/120947 standards xsm ignores system.xsm and .xsmstartup o stand/121921 standards [patch] Add leap second support to at(1), atrun(8) o stand/122051 standards Add posix_spawn(3) 48 problems total. From giffunip at tutopia.com Wed May 14 23:00:11 2008 From: giffunip at tutopia.com (Pedro F. Giffuni) Date: Wed May 14 23:00:13 2008 Subject: standards/123688: POSIX standard changes in unistd.h and grp.h Message-ID: <200805142256.m4EMusA9030237@www.freebsd.org> >Number: 123688 >Category: standards >Synopsis: POSIX standard changes in unistd.h and grp.h >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed May 14 23:00:11 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Pedro F. Giffuni >Release: 6.3-Release (amd64) >Organization: >Environment: not-relevant >Description: Bruno Haible did a port of glibc to FreeBSD; in the process he found important differences between glibc and FreeBSD's libc. I looked at some of them to see how they related to POSIX documentation and I found arguments for adopting this changes: Note about - getgrouplist() declaration is moved to . - initgroups() declaration is moved to . - setgroups() declaration is moved to . - mknod() declaration is moved to Note about : - setgrent() return type changes from int to void. Of course the documentation for those 5 functions would also have to change >How-To-Repeat: The complete changes are mentioned here: http://sourceware.org/ml/libc-alpha/2002-10/msg00326.html but of course things have changed between 2002 and now and some changes, like moving valloc(),in there would break BSD tradition. >Fix: >Release-Note: >Audit-Trail: >Unformatted: From matteo at FreeBSD.org Sat May 17 09:16:47 2008 From: matteo at FreeBSD.org (matteo@FreeBSD.org) Date: Sat May 17 09:16:49 2008 Subject: standards/121568: [patch] ln(1): wrong "ln -s" behaviour Message-ID: <200805170916.m4H9GkNE081226@freefall.freebsd.org> Synopsis: [patch] ln(1): wrong "ln -s" behaviour Responsible-Changed-From-To: freebsd-bugs->freebsd-standards Responsible-Changed-By: matteo Responsible-Changed-When: Sab 17 Mag 2008 09:16:16 UTC Responsible-Changed-Why: This sounds more a standards' issue to me. http://www.freebsd.org/cgi/query-pr.cgi?pr=121568 From bugmaster at FreeBSD.org Mon May 19 11:07:01 2008 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon May 19 11:07:57 2008 Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org Message-ID: <200805191107.m4JB70mg011733@freefall.freebsd.org> Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/25542 standards /bin/sh: null char in quoted string o stand/54410 standards one-true-awk not POSIX compliant (no extended REs) o stand/82654 standards C99 long double math functions are missing o stand/94729 standards [libc] fcntl() throws undocumented ENOTTY 4 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s bin/14925 standards getsubopt isn't poisonous enough o stand/21519 standards sys/dir.h should be deprecated some more o bin/24390 standards Replacing old dir-symlinks when using /bin/ln s stand/24590 standards timezone function not compatible witn Single Unix Spec f stand/25777 standards [kernel] [patch] atime not updated on exec a docs/26003 standards getgroups(2) lists NGROUPS_MAX but not syslimits.h o kern/27835 standards [libc] execve() doesn't conform to execve(2) spec in s s stand/36076 standards Implementation of POSIX fuser command o stand/39256 standards snprintf/vsnprintf aren't POSIX-conformant for strings p stand/41576 standards POSIX compliance of ln(1) o stand/44425 standards getcwd() succeeds even if current dir has perm 000. o stand/46119 standards Priority problems for SCHED_OTHER using pthreads o stand/54833 standards [pcvt] more pcvt deficits o stand/54839 standards [pcvt] pcvt deficits p stand/55112 standards glob.h, glob_t's gl_pathc should be "size_t", not "int o stand/56476 standards cd9660 unicode support simple hack o stand/58676 standards grantpt(3) alters storage used by ptsname(3) s stand/62858 standards malloc(0) not C99 compliant s kern/64875 standards [libc] [patch] [request] add a system call: fdatasync( o stand/66357 standards make POSIX conformance problem ('sh -e' & '+' command- o stand/66531 standards [libc] [patch] _gettemp uses a far smaller set of file o stand/70813 standards [PATCH] ls(1) not Posix compliant o stand/72006 standards floating point formating in non-C locales o stand/79056 standards [feature request] [atch] regex(3) regression tests a stand/80293 standards sysconf() does not support well-defined unistd values o stand/81287 standards [PATCH]: fingerd(8) might send a line not ending in CR o stand/83845 standards [libm] [patch] add log2() and log2f() support for libm a stand/86484 standards [PATCH] mkfifo(1) uses wrong permissions o stand/92360 standards [headers] [patch] Missing TAB3 in kernel headers o stand/92362 standards [headers] [patch] Missing SIGPOLL in kernel headers o kern/93705 standards [headers] [patch] ENODATA and EGREGIOUS (for glibc com o stand/96016 standards [headers] clock_getres et al should be in o stand/96236 standards [PATCH] [POSIX] sed.1 incorrectly describes a function p stand/99517 standards Missing SIGRTMIN and SIGRTMAX signals o stand/99960 standards [Patch] make(1): Add -p flag o stand/100017 standards [Patch] Add fuser(1) functionality to fstat(1) o stand/104743 standards [headers] [patch] Wrong values for _POSIX_ minimal lim o stand/107561 standards [libc] [patch] [request] Missing SUS function tcgetsid o kern/114578 standards [libc] wide character printing using swprintf(dst, n, o stand/116081 standards make does not work with the directive sinclude o stand/116221 standards [kernel] [patch] [request] SUS issue -- FreeBSD has no o bin/116413 standards incorrect getconf(1) handling of unsigned constants gi o stand/116826 standards [PATCH] sh support for POSIX character classes o stand/118047 standards SUGGESTION: /etc/printcap vs mergemaster o stand/119804 standards [timedef] [patch] Invalid (long)date format in pl_PL.I o stand/120947 standards xsm ignores system.xsm and .xsmstartup o stand/121568 standards [patch] ln(1): wrong "ln -s" behaviour o stand/121921 standards [patch] Add leap second support to at(1), atrun(8) o stand/122051 standards Add posix_spawn(3) o stand/123688 standards POSIX standard changes in unistd.h and grp.h 50 problems total. From bugmaster at FreeBSD.org Mon May 26 11:06:56 2008 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon May 26 11:07:49 2008 Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org Message-ID: <200805261106.m4QB6tuT065052@freefall.freebsd.org> Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/25542 standards sh(1) null char in quoted string o stand/54410 standards one-true-awk not POSIX compliant (no extended REs) o stand/82654 standards C99 long double math functions are missing o stand/94729 standards [libc] fcntl() throws undocumented ENOTTY 4 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s bin/14925 standards getsubopt isn't poisonous enough o stand/21519 standards sys/dir.h should be deprecated some more o bin/24390 standards ln(1) Replacing old dir-symlinks when using /bin/ln s stand/24590 standards timezone function not compatible witn Single Unix Spec f stand/25777 standards [kernel] [patch] atime not updated on exec a docs/26003 standards getgroups(2) lists NGROUPS_MAX but not syslimits.h o kern/27835 standards [libc] execve() doesn't conform to execve(2) spec in s s stand/36076 standards Implementation of POSIX fuser command o stand/39256 standards snprintf/vsnprintf aren't POSIX-conformant for strings p stand/41576 standards POSIX compliance of ln(1) o stand/44425 standards getcwd() succeeds even if current dir has perm 000. o stand/46119 standards Priority problems for SCHED_OTHER using pthreads o stand/54833 standards [pcvt] more pcvt deficits o stand/54839 standards [pcvt] pcvt deficits p stand/55112 standards glob.h, glob_t's gl_pathc should be "size_t", not "int o stand/56476 standards cd9660 unicode support simple hack o stand/58676 standards grantpt(3) alters storage used by ptsname(3) s stand/62858 standards malloc(0) not C99 compliant s kern/64875 standards [libc] [patch] [request] add a system call: fdatasync( o stand/66357 standards make POSIX conformance problem ('sh -e' & '+' command- o stand/66531 standards [libc] [patch] _gettemp uses a far smaller set of file o stand/70813 standards [PATCH] ls(1) not Posix compliant o stand/72006 standards floating point formating in non-C locales o stand/79056 standards [feature request] [atch] regex(3) regression tests a stand/80293 standards sysconf() does not support well-defined unistd values o stand/81287 standards [PATCH]: fingerd(8) might send a line not ending in CR o stand/83845 standards [libm] [patch] add log2() and log2f() support for libm a stand/86484 standards [PATCH] mkfifo(1) uses wrong permissions o stand/92360 standards [headers] [patch] Missing TAB3 in kernel headers o stand/92362 standards [headers] [patch] Missing SIGPOLL in kernel headers o kern/93705 standards [headers] [patch] ENODATA and EGREGIOUS (for glibc com o stand/96016 standards [headers] clock_getres et al should be in o stand/96236 standards [PATCH] [POSIX] sed.1 incorrectly describes a function p stand/99517 standards Missing SIGRTMIN and SIGRTMAX signals o stand/99960 standards [Patch] make(1): Add -p flag o stand/100017 standards [Patch] Add fuser(1) functionality to fstat(1) o stand/104743 standards [headers] [patch] Wrong values for _POSIX_ minimal lim o stand/107561 standards [libc] [patch] [request] Missing SUS function tcgetsid o kern/114578 standards [libc] wide character printing using swprintf(dst, n, o stand/116081 standards make does not work with the directive sinclude o stand/116221 standards [kernel] [patch] [request] SUS issue -- FreeBSD has no o bin/116413 standards incorrect getconf(1) handling of unsigned constants gi o stand/116826 standards [PATCH] sh support for POSIX character classes o stand/118047 standards SUGGESTION: /etc/printcap vs mergemaster o stand/119804 standards [timedef] [patch] Invalid (long)date format in pl_PL.I o stand/120947 standards xsm ignores system.xsm and .xsmstartup o stand/121568 standards [patch] ln(1): wrong "ln -s" behaviour o stand/121921 standards [patch] Add leap second support to at(1), atrun(8) o stand/122051 standards Add posix_spawn(3) o stand/123688 standards POSIX standard changes in unistd.h and grp.h 50 problems total. From gavin at FreeBSD.org Thu May 29 13:30:07 2008 From: gavin at FreeBSD.org (Gavin Atkinson) Date: Thu May 29 13:30:14 2008 Subject: standards/55112: glob.h, glob_t's gl_pathc should be "size_t", not "int". Message-ID: <200805291330.m4TDU64j011800@freefall.freebsd.org> The following reply was made to PR standards/55112; it has been noted by GNATS. From: Gavin Atkinson To: bug-followup@FreeBSD.org Cc: Subject: Re: standards/55112: glob.h, glob_t's gl_pathc should be "size_t", not "int". Date: Thu, 29 May 2008 14:21:48 +0100 This is fixed in -HEAD and RELENG_7, but from the sound of it may not be MFCable to RELENG_6 due to ABI changes. Can anyone confirm that this is the case, and if so, close it? From stefan at fafoe.narf.at Fri May 30 17:44:33 2008 From: stefan at fafoe.narf.at (Stefan Farfeleder) Date: Fri May 30 17:44:38 2008 Subject: $LINENO within functions Message-ID: <20080530172711.GA1056@lizard.fafoe.narf.at> Hi, SUSv3 says the following about $LINENO: "Set by the shell to a decimal number representing the current sequential line number (numbered starting with 1) within a script or function before it executes each command. If the user unsets or resets LINENO , the variable may lose its special meaning for the life of the shell. If the shell is not currently executing a script or function, the value of LINENO is unspecified. This volume of IEEE Std 1003.1-2001 specifies the effects of the variable only for systems supporting the User Portability Utilities option." My initial interpretation of "or function" was that it means $LINENO within a function should be relative to the function's beginning line. Now I'm not so sure anymore. Bash release 2.05b changed the expansion of $LINENO within functions to absolute numbering, stating this is required by POSIX. But then I wonder about the meaning of "or function". Does it mean functions in interactive scripts? Because for functions in shell scripts the mentioning of both "script" and "function" seems redundant. Stefan From olli at lurza.secnetix.de Fri May 30 18:21:39 2008 From: olli at lurza.secnetix.de (Oliver Fromme) Date: Fri May 30 18:21:41 2008 Subject: $LINENO within functions In-Reply-To: <20080530172711.GA1056@lizard.fafoe.narf.at> Message-ID: <200805301821.m4UILYq5021979@lurza.secnetix.de> Stefan Farfeleder wrote: > SUSv3 says the following about $LINENO: > > "Set by the shell to a decimal number representing the current > sequential line number (numbered starting with 1) within a script or > function before it executes each command. If the user unsets or resets > LINENO , the variable may lose its special meaning for the life of the > shell. If the shell is not currently executing a script or function, the > value of LINENO is unspecified. This volume of IEEE Std 1003.1-2001 > specifies the effects of the variable only for systems supporting the > User Portability Utilities option." > > My initial interpretation of "or function" was that it means $LINENO > within a function should be relative to the function's beginning line. > Now I'm not so sure anymore. Bash release 2.05b changed the expansion > of $LINENO within functions to absolute numbering, stating this is > required by POSIX. But then I wonder about the meaning of "or > function". Does it mean functions in interactive scripts? Because for > functions in shell scripts the mentioning of both "script" and > "function" seems redundant. When reading the SUSv3 text, my interpretation is the same as your initial interpretation. FWIW, Solaris' POSIX shell (ksh) behaves like FreeBSD's sh, not like bash. Same for zsh. So bash seems to be pretty much alone in its inter- pretation of SUSv3. I also think that it should not make a difference whether a function definition is entered interactively or read from a script -- $LINENO should always expand to the same value at the same line number within that function. It shouldn't depend on where the function definition comes from. I think that's what the people from the SUS/POSIX committee wanted to say. Therefore my opinion is that FreeBSD's current behaviour is fine, and bash is wrong. By the way, SUSv3 also mentions $LINENO in the Shell Command Language Rationale (xrat/xcu_chap02) in the explanation of the $PS4 variable used for debugging with "set -x": === QUOTE === PS4 This variable is used for shell debugging. For example, the following script: PS4='[${LINENO}]+ ' set -x echo Hello writes the following to standard error: [3]+ echo Hello === /QUOTE === I'm not sure which behaviour makes more sense here. It depends on how you look at it, I guess. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Gesch?ftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M?n- chen, HRB 125758, Gesch?ftsf?hrer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "If you aim the gun at your foot and pull the trigger, it's UNIX's job to ensure reliable delivery of the bullet to where you aimed the gun (in this case, Mr. Foot)." -- Terry Lambert, FreeBSD-hackers mailing list. From kostikbel at gmail.com Fri May 30 18:47:15 2008 From: kostikbel at gmail.com (Kostik Belousov) Date: Fri May 30 18:47:21 2008 Subject: $LINENO within functions In-Reply-To: <20080530172711.GA1056@lizard.fafoe.narf.at> References: <20080530172711.GA1056@lizard.fafoe.narf.at> Message-ID: <20080530181242.GC21317@deviant.kiev.zoral.com.ua> On Fri, May 30, 2008 at 07:27:12PM +0200, Stefan Farfeleder wrote: > Hi, > > SUSv3 says the following about $LINENO: > > "Set by the shell to a decimal number representing the current > sequential line number (numbered starting with 1) within a script or > function before it executes each command. If the user unsets or resets > LINENO , the variable may lose its special meaning for the life of the > shell. If the shell is not currently executing a script or function, the > value of LINENO is unspecified. This volume of IEEE Std 1003.1-2001 > specifies the effects of the variable only for systems supporting the > User Portability Utilities option." > > My initial interpretation of "or function" was that it means $LINENO > within a function should be relative to the function's beginning line. > Now I'm not so sure anymore. Bash release 2.05b changed the expansion > of $LINENO within functions to absolute numbering, stating this is > required by POSIX. But then I wonder about the meaning of "or > function". Does it mean functions in interactive scripts? Because for > functions in shell scripts the mentioning of both "script" and > "function" seems redundant. I do not know whether you need this data, but ksh93 and pdksh exhibit the same behaviour as bash. For the rev. 1.1 of lineno.0, I got 2 3 6 7 12 13 foo foo 2 On the other hand, zsh produces 2 3 1 2 12 13 foo foo 2 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 195 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-standards/attachments/20080530/8d8fb43d/attachment.pgp From kostikbel at gmail.com Fri May 30 18:47:16 2008 From: kostikbel at gmail.com (Kostik Belousov) Date: Fri May 30 18:47:21 2008 Subject: $LINENO within functions In-Reply-To: <20080530181242.GC21317@deviant.kiev.zoral.com.ua> References: <20080530172711.GA1056@lizard.fafoe.narf.at> <20080530181242.GC21317@deviant.kiev.zoral.com.ua> Message-ID: <20080530181529.GD21317@deviant.kiev.zoral.com.ua> On Fri, May 30, 2008 at 09:12:42PM +0300, Kostik Belousov wrote: > On Fri, May 30, 2008 at 07:27:12PM +0200, Stefan Farfeleder wrote: > > Hi, > > > > SUSv3 says the following about $LINENO: > > > > "Set by the shell to a decimal number representing the current > > sequential line number (numbered starting with 1) within a script or > > function before it executes each command. If the user unsets or resets > > LINENO , the variable may lose its special meaning for the life of the > > shell. If the shell is not currently executing a script or function, the > > value of LINENO is unspecified. This volume of IEEE Std 1003.1-2001 > > specifies the effects of the variable only for systems supporting the > > User Portability Utilities option." > > > > My initial interpretation of "or function" was that it means $LINENO > > within a function should be relative to the function's beginning line. > > Now I'm not so sure anymore. Bash release 2.05b changed the expansion > > of $LINENO within functions to absolute numbering, stating this is > > required by POSIX. But then I wonder about the meaning of "or > > function". Does it mean functions in interactive scripts? Because for > > functions in shell scripts the mentioning of both "script" and > > "function" seems redundant. > > I do not know whether you need this data, but ksh93 and pdksh exhibit > the same behaviour as bash. For the rev. 1.1 of lineno.0, I got > > 2 > 3 > 6 > 7 > 12 > 13 > foo > foo > 2 > > On the other hand, zsh produces > > 2 > 3 > 1 > 2 > 12 > 13 > foo > foo > 2 Oh, and /usr/xpg4/bin/sh on the fully patches Solaris 10 output is identical with the zsh one. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 195 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-standards/attachments/20080530/41df0234/attachment.pgp From stefan at fafoe.narf.at Fri May 30 19:30:01 2008 From: stefan at fafoe.narf.at (Stefan Farfeleder) Date: Fri May 30 19:30:05 2008 Subject: $LINENO within functions In-Reply-To: <20080530181529.GD21317@deviant.kiev.zoral.com.ua> References: <20080530172711.GA1056@lizard.fafoe.narf.at> <20080530181242.GC21317@deviant.kiev.zoral.com.ua> <20080530181529.GD21317@deviant.kiev.zoral.com.ua> Message-ID: <20080530192929.GB1056@lizard.fafoe.narf.at> On Fri, May 30, 2008 at 09:15:29PM +0300, Kostik Belousov wrote: > On Fri, May 30, 2008 at 09:12:42PM +0300, Kostik Belousov wrote: > > On Fri, May 30, 2008 at 07:27:12PM +0200, Stefan Farfeleder wrote: > > > Hi, > > > > > > SUSv3 says the following about $LINENO: > > > > > > "Set by the shell to a decimal number representing the current > > > sequential line number (numbered starting with 1) within a script or > > > function before it executes each command. If the user unsets or resets > > > LINENO , the variable may lose its special meaning for the life of the > > > shell. If the shell is not currently executing a script or function, the > > > value of LINENO is unspecified. This volume of IEEE Std 1003.1-2001 > > > specifies the effects of the variable only for systems supporting the > > > User Portability Utilities option." > > > > > > My initial interpretation of "or function" was that it means $LINENO > > > within a function should be relative to the function's beginning line. > > > Now I'm not so sure anymore. Bash release 2.05b changed the expansion > > > of $LINENO within functions to absolute numbering, stating this is > > > required by POSIX. But then I wonder about the meaning of "or > > > function". Does it mean functions in interactive scripts? Because for > > > functions in shell scripts the mentioning of both "script" and > > > "function" seems redundant. > > > > I do not know whether you need this data, but ksh93 and pdksh exhibit > > the same behaviour as bash. For the rev. 1.1 of lineno.0, I got > > > > 2 > > 3 > > 6 > > 7 > > 12 > > 13 > > foo > > foo > > 2 > > > > On the other hand, zsh produces > > > > 2 > > 3 > > 1 > > 2 > > 12 > > 13 > > foo > > foo > > 2 > > Oh, and /usr/xpg4/bin/sh on the fully patches Solaris 10 output is identical > with the zsh one. Yes, the current implementation has a +1 offset compared to zsh. The reason is that $LINENO can occur on the same line as the function name itself (ie. zsh prints 0 for 'f() { echo $LINENO }' which contradicts the specification).