Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jdluhos:lsb-tests
lsb-runtime-test-official
lsb-test-core-lsbcc.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File lsb-test-core-lsbcc.patch of Package lsb-runtime-test-official
--- ./test_sets/SRC/common/vprog/vrpt.page.c.lsbcc 2007-07-24 16:19:34.000000000 -0400 +++ ./test_sets/SRC/common/vprog/vrpt.page.c 2007-07-27 14:41:28.000000000 -0400 @@ -100,7 +100,7 @@ char **argv; page_num = 1; number = 0; - while (gets(s) != NULL) + while (fgets(s, sizeof(s), stdin) != NULL) proc_line(); do_pageofpage(); @@ -121,7 +121,7 @@ get_params() DBUG_ENTER("get_params"); for (i = 0; i < NPARAM; i++) - if (gets(s) != NULL) + if (fgets(s, sizeof(s), stdin) != NULL) { if ((param[i] = (char *)malloc((size_t)(strlen(s)+1))) == NULL) { --- ./test_sets/tset/LSB.os/libdl/dlopen/Makefile.lsbcc 2007-07-24 16:19:57.000000000 -0400 +++ ./test_sets/tset/LSB.os/libdl/dlopen/Makefile 2007-07-27 14:41:55.000000000 -0400 @@ -59,7 +59,7 @@ LIBS = $(GENLIB) $(VSXLIB)/vlib.a $(LIB COPTS = DEFINES = INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +CFLOCAL = -D_POSIX_PATH_MAX=256 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(COPTS) DYNL_CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(DYNL_COPTS) LDFLAGS = --- ./test_sets/tset/LSB.os/genuts/glob/Makefile.lsbcc 2007-07-24 16:19:55.000000000 -0400 +++ ./test_sets/tset/LSB.os/genuts/glob/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -63,8 +63,8 @@ SDBFLAG = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -D_POSIX_PATH_MAX=256 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(DBUG) $(COPTS) $(SDBFLAG) LDFLAGS = --- ./test_sets/tset/LSB.os/genuts/getopt/getopt.c.lsbcc 2007-07-24 16:19:55.000000000 -0400 +++ ./test_sets/tset/LSB.os/genuts/getopt/getopt.c 2007-07-27 14:41:28.000000000 -0400 @@ -90,6 +90,10 @@ MODIFICATIONS: #undef getopt #endif +extern int optind; +extern int optopt; +extern int opterr; +extern char *optarg; #define NO_TESTS 4 /* number of tests in testset */ #define WAITTIME (5 * SPEEDFACTOR) --- ./test_sets/tset/LSB.os/genuts/wordexp/Makefile.lsbcc 2007-07-24 16:19:56.000000000 -0400 +++ ./test_sets/tset/LSB.os/genuts/wordexp/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -64,8 +64,8 @@ SDBFLAG = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -D_POSIX_PATH_MAX=256 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(DBUG) $(COPTS) $(SDBFLAG) LDFLAGS = --- ./test_sets/tset/LSB.os/ioprim/readv_L/Makefile.lsbcc 2007-07-24 16:19:56.000000000 -0400 +++ ./test_sets/tset/LSB.os/ioprim/readv_L/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -68,8 +68,8 @@ SDBFLAG = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -DIOV_MAX=1024 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(DBUG) $(COPTS) $(SDBFLAG) LDFLAGS = --- ./test_sets/tset/LSB.os/ioprim/writev_L/Makefile.lsbcc 2007-07-24 16:19:56.000000000 -0400 +++ ./test_sets/tset/LSB.os/ioprim/writev_L/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -68,8 +68,8 @@ SDBFLAG = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -DIOV_MAX=1024 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(DBUG) $(COPTS) $(SDBFLAG) LDFLAGS = --- ./test_sets/tset/LSB.os/procenv/nice/Makefile.lsbcc 2007-07-24 16:19:58.000000000 -0400 +++ ./test_sets/tset/LSB.os/procenv/nice/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -64,8 +64,8 @@ DBUG = COPTS = SDBFLAG = DEFINES = -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -DNZERO=20 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(DBUG) $(COPTS) $(SDBFLAG) LDFLAGS = --- ./test_sets/tset/LSB.os/procenv/chroot/Makefile.lsbcc 2007-07-27 14:41:28.000000000 -0400 +++ ./test_sets/tset/LSB.os/procenv/chroot/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -63,7 +63,7 @@ DBUG = COPTS = SDBFLAG = DEFINES = -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) +INCS = -I$(TETINC) -I$(VSXINC) CFLOCAL = CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(DBUG) $(COPTS) $(SDBFLAG) LDFLAGS = @@ -96,7 +96,7 @@ T.chroot: $(OFILES0) $(TCM) $(VSXLIB)/st @echo " $@ made" chroot_t4: $(OFILES4) $(LIBS) - $(CC) $(CHROOT_BUILD_FLAG) -o $@ $(OFILES4) $(LIBS) $(SYSLIBS) $(LDFLAGS) + cc $(CHROOT_BUILD_FLAG) -o $@ $(OFILES4) $(LIBS) $(SYSLIBS) $(LDFLAGS) @echo " $@ made" INSTALL: $(INSTDIR)/T.chroot $(INSTDIR)/chroot_t4 --- ./test_sets/tset/LSB.pam/testcases/pam_setcred/pam_setcred.c.lsbcc 2007-07-24 16:20:00.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_setcred/pam_setcred.c 2007-07-27 14:41:28.000000000 -0400 @@ -19,7 +19,6 @@ #include <stdio.h> #include <security/pam_appl.h> -#include <security/pam_misc.h> #include <std.h> #include <tet_api.h> --- ./test_sets/tset/LSB.pam/testcases/pam_setcred/Makefile.lsbcc 2007-07-24 16:20:00.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_setcred/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -46,7 +46,7 @@ INSTDIR = $(TET_EXECUTE)/tset/LSB.pam/te # Local (to this product only) includes, libraries, etc: LOCALINC = -LOCALLIB = -lpam -lpam_misc +LOCALLIB = -lpam # product-wide libraries for ld(1): @@ -56,8 +56,8 @@ COPTS = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -DPAM_MAX_RESP_SIZE=512 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(COPTS) VSRT_LDFLAGS = --- ./test_sets/tset/LSB.pam/testcases/pam_strerror/pam_strerror.c.lsbcc 2007-07-24 16:20:00.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_strerror/pam_strerror.c 2007-07-27 14:41:28.000000000 -0400 @@ -20,7 +20,6 @@ #include <stdio.h> #include <string.h> #include <security/pam_appl.h> -#include <security/pam_misc.h> #include <std.h> #include <tet_api.h> --- ./test_sets/tset/LSB.pam/testcases/pam_strerror/Makefile.lsbcc 2007-07-24 16:20:00.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_strerror/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -46,7 +46,7 @@ INSTDIR = $(TET_EXECUTE)/tset/LSB.pam/te # Local (to this product only) includes, libraries, etc: LOCALINC = -LOCALLIB = -lpam -lpam_misc +LOCALLIB = -lpam # product-wide libraries for ld(1): @@ -56,8 +56,8 @@ COPTS = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -D_PAM_RETURN_VALUES=32 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(COPTS) VSRT_LDFLAGS = --- ./test_sets/tset/LSB.pam/testcases/pam_fail_delay/pam_fail_delay.c.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_fail_delay/pam_fail_delay.c 2007-07-27 14:41:28.000000000 -0400 @@ -19,7 +19,6 @@ #include <stdio.h> #include <security/pam_appl.h> -#include <security/pam_misc.h> #include <time.h> #include <std.h> --- ./test_sets/tset/LSB.pam/testcases/pam_fail_delay/Makefile.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_fail_delay/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -46,7 +46,7 @@ INSTDIR = $(TET_EXECUTE)/tset/LSB.pam/te # Local (to this product only) includes, libraries, etc: LOCALINC = -LOCALLIB = -lpam -lpam_misc +LOCALLIB = -lpam # product-wide libraries for ld(1): @@ -56,8 +56,8 @@ COPTS = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -DPAM_MAX_RESP_SIZE=512 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(COPTS) VSRT_LDFLAGS = --- ./test_sets/tset/LSB.pam/testcases/pam_authenticate/pam_authenticate.c.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_authenticate/pam_authenticate.c 2007-07-27 14:41:28.000000000 -0400 @@ -20,7 +20,6 @@ #include <stdio.h> #include <security/pam_appl.h> -#include <security/pam_misc.h> #include <std.h> #include <tet_api.h> --- ./test_sets/tset/LSB.pam/testcases/pam_authenticate/Makefile.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_authenticate/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -49,7 +49,7 @@ INSTDIR = $(TET_EXECUTE)/tset/LSB.pam/te # Local (to this product only) includes, libraries, etc: LOCALINC = -LOCALLIB = -lpam -lpam_misc +LOCALLIB = -lpam # product-wide libraries for ld(1): @@ -59,8 +59,8 @@ COPTS = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -DPAM_MAX_RESP_SIZE=512 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(COPTS) VSRT_LDFLAGS = --- ./test_sets/tset/LSB.pam/testcases/pam_chauthtok/Makefile.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_chauthtok/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -49,7 +49,7 @@ INSTDIR = $(TET_EXECUTE)/tset/LSB.pam/te # Local (to this product only) includes, libraries, etc: LOCALINC = -LOCALLIB = -lpam -lpam_misc +LOCALLIB = -lpam # product-wide libraries for ld(1): @@ -59,8 +59,8 @@ COPTS = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -DPAM_MAX_RESP_SIZE=512 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(COPTS) VSRT_LDFLAGS = --- ./test_sets/tset/LSB.pam/testcases/pam_chauthtok/pam_chauthtok.c.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_chauthtok/pam_chauthtok.c 2007-07-27 14:41:28.000000000 -0400 @@ -20,7 +20,6 @@ #include <stdio.h> #include <security/pam_appl.h> -#include <security/pam_misc.h> #include <std.h> #include <tet_api.h> --- ./test_sets/tset/LSB.pam/testcases/pam_close_session/pam_close_session.c.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_close_session/pam_close_session.c 2007-07-27 14:41:28.000000000 -0400 @@ -20,7 +20,6 @@ #include <stdio.h> #include <security/pam_appl.h> -#include <security/pam_misc.h> #include <std.h> #include <tet_api.h> --- ./test_sets/tset/LSB.pam/testcases/pam_close_session/Makefile.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_close_session/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -46,7 +46,7 @@ INSTDIR = $(TET_EXECUTE)/tset/LSB.pam/te # Local (to this product only) includes, libraries, etc: LOCALINC = -LOCALLIB = -lpam -lpam_misc +LOCALLIB = -lpam # product-wide libraries for ld(1): @@ -56,8 +56,8 @@ COPTS = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -DPAM_MAX_RESP_SIZE=512 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(COPTS) VSRT_LDFLAGS = --- ./test_sets/tset/LSB.pam/testcases/pam_acct_mgmt/Makefile.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_acct_mgmt/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -49,7 +49,7 @@ INSTDIR = $(TET_EXECUTE)/tset/LSB.pam/te # Local (to this product only) includes, libraries, etc: LOCALINC = -LOCALLIB = -lpam -lpam_misc +LOCALLIB = -lpam # product-wide libraries for ld(1): @@ -59,8 +59,8 @@ COPTS = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -DPAM_MAX_RESP_SIZE=512 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(COPTS) VSRT_LDFLAGS = --- ./test_sets/tset/LSB.pam/testcases/pam_acct_mgmt/pam_acct_mgmt.c.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_acct_mgmt/pam_acct_mgmt.c 2007-07-27 14:41:28.000000000 -0400 @@ -21,7 +21,6 @@ #include <unistd.h> #include <sys/types.h> #include <security/pam_appl.h> -#include <security/pam_misc.h> #include <std.h> #include <tet_api.h> --- ./test_sets/tset/LSB.pam/testcases/pam_open_session/pam_open_session.c.lsbcc 2007-07-24 16:20:00.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_open_session/pam_open_session.c 2007-07-27 14:41:28.000000000 -0400 @@ -19,7 +19,6 @@ #include <stdio.h> #include <security/pam_appl.h> -#include <security/pam_misc.h> #include <std.h> #include <tet_api.h> --- ./test_sets/tset/LSB.pam/testcases/pam_open_session/Makefile.lsbcc 2007-07-24 16:19:59.000000000 -0400 +++ ./test_sets/tset/LSB.pam/testcases/pam_open_session/Makefile 2007-07-27 14:41:28.000000000 -0400 @@ -46,7 +46,7 @@ INSTDIR = $(TET_EXECUTE)/tset/LSB.pam/te # Local (to this product only) includes, libraries, etc: LOCALINC = -LOCALLIB = -lpam -lpam_misc +LOCALLIB = -lpam # product-wide libraries for ld(1): @@ -56,8 +56,8 @@ COPTS = DEFINES = # INCS, as seen from obj directory -INCS = -I$(TETINC) -I$(VSXINC) -I$(SYSINC) -CFLOCAL = +INCS = -I$(TETINC) -I$(VSXINC) +CFLOCAL = -DPAM_MAX_RESP_SIZE=512 CFLAGS = $(CFLOCAL) $(INCS) $(DEFINES) $(COPTS) VSRT_LDFLAGS = --- ./test_sets/tset/LSB.usersgroups/commands/misc/cpt.c.lsbcc 2007-07-24 16:20:00.000000000 -0400 +++ ./test_sets/tset/LSB.usersgroups/commands/misc/cpt.c 2007-07-27 14:41:28.000000000 -0400 @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) } /* Setup master/slave pseudo tty's */ - pt = getpt(); + pt = open("/dev/ptmx",O_RDWR|O_NOCTTY); pttyname = ptsname(pt); unlockpt(pt); slave = open(pttyname, O_RDWR); --- ./test_sets/tset/LSB.usersgroups/commands/passwd/cpt.c.lsbcc 2007-07-24 16:20:00.000000000 -0400 +++ ./test_sets/tset/LSB.usersgroups/commands/passwd/cpt.c 2007-07-27 14:41:28.000000000 -0400 @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) } /* Setup master/slave pseudo tty's */ - pt = getpt(); + pt = open("/dev/ptmx",O_RDWR|O_NOCTTY); pttyname = ptsname(pt); unlockpt(pt); slave = open(pttyname, O_RDWR); --- ./test_sets/tset/ANSI.os/streamio/ungetc/ungetc.c.lsbcc 2007-07-24 16:20:21.000000000 -0400 +++ ./test_sets/tset/ANSI.os/streamio/ungetc/ungetc.c 2007-07-27 14:41:28.000000000 -0400 @@ -257,7 +257,7 @@ test1() if (ungetc(T6_CHAR, fp) != T6_CHAR) fail = 1; - (void) gets(buf); + (void) fgets(buf, sizeof(buf), fp); val6 = buf[0]; /* don't fclose(fp) */ --- ./test_sets/tset/PTHR.os/procenv/sysconf/sysconf.c.lsbcc 2007-07-24 16:20:04.000000000 -0400 +++ ./test_sets/tset/PTHR.os/procenv/sysconf/sysconf.c 2007-07-27 14:41:28.000000000 -0400 @@ -39,6 +39,8 @@ #include "tet_api.h" #include "vsth/vsth.h" +#include <bits/local_lim.h> +#include <bits/posix_opt.h> #define NO_TESTS 12 @@ -426,7 +428,7 @@ t8_f1( int *errors, int *fails ) lval ); } #else - tet_printf("sysconf(_SC_THREAD_PRIORITY_SCHEDULING) returned %ld", + tet_printf("sysconf(_SC_THREAD_PRIORITY_SCHEDULING) returned %ld", lval); #endif } --- ./LSB.tools/userintf.c.lsbcc 2001-05-31 20:35:25.000000000 -0400 +++ ./LSB.tools/userintf.c 2008-09-10 11:06:52.000000000 -0400 @@ -434,6 +434,78 @@ MODIFICATIONS: #include <sys/mount.h> #endif +/* LSB does not allow "mount" - fake it with a system call + * this is still cheating, but at least our tests can be + * compiled with lsbcc so they are portable + */ + +public int +smount(source, target, fstype, flags, data) +char *source; +char *target; +char *fstype; +unsigned long flags; +int data; +{ + int ret; + int status; + int w; + char *options = " "; + /* losetup is already done with setup script */ + /* strcpy(options, "-oloop"); */ + if (flags & MS_RDONLY) { + options = "-oro"; + } + + pid_t cpid = fork(); + if (cpid == 0) { + setuid(0); + if (options == "-oro") { + ret = execl("/bin/mount", " ", "-t", fstype, source, target, options, (char *) 0); + } else { + ret = execl("/bin/mount", " ", "-t", fstype, source, target, (char *) 0); + } + _exit(ret); + } else if (cpid < 0) { + fprintf(stderr, "fork failed...\n"); + } else { + do { + w = waitpid(cpid, &status, WUNTRACED | WCONTINUED); + if (w == -1) { perror("waitpid"); exit(EXIT_FAILURE); } + } while (!WIFEXITED(status) && !WIFSIGNALED(status)); + return status; + } +} + +/* LSB does not allow "umount" - fake it with a system call + * this is still cheating, but at least our tests can be + * compiled with lsbcc so they are portable + */ + +public int +sumount(target) +char *target; +{ + int ret; + int status; + int w; + + pid_t cpid = fork(); + if (cpid == 0) { + setuid(0); + ret = execl("/bin/umount", " ", target, (char *) 0); + _exit(ret); + } else if (cpid < 0) { + fprintf(stderr, "fork failed...\n"); + } else { + do { + w = waitpid(cpid, &status, WUNTRACED | WCONTINUED); + if (w == -1) { perror("waitpid"); exit(EXIT_FAILURE); } + } while (!WIFEXITED(status) && !WIFSIGNALED(status)); + return status; + } +} + public int mnt_rw(spec, dir) char *spec; @@ -443,7 +515,7 @@ char *dir; #ifdef __linux__ /* file system independent mount for filesystem */ - ret = mount(spec, dir, (char *) __USERINTF_FSTYPE, MS_MGC_VAL, 0); + ret = smount(spec, dir, (char *) __USERINTF_FSTYPE, MS_MGC_VAL, 0); #else ret = mount(spec, dir, 0); #endif @@ -453,7 +525,7 @@ char *dir; errno = 0; #ifdef __linux__ /* file system independent mount for filesystem */ - ret = mount(spec, dir, __USERINTF_FSTYPE, MS_MGC_VAL, 0); + ret = smount(spec, dir, __USERINTF_FSTYPE, MS_MGC_VAL, 0); #else ret = mount(spec, dir, 0); #endif @@ -477,7 +549,7 @@ char *dir; #ifdef __linux__ /* file system independent mount for filesystem */ - ret = mount(spec, dir, __USERINTF_FSTYPE, MS_MGC_VAL|MS_RDONLY, 0); + ret = smount(spec, dir, __USERINTF_FSTYPE, MS_MGC_VAL|MS_RDONLY, 0); #else ret = mount(spec, dir, 1); #endif @@ -486,7 +558,7 @@ char *dir; (void) unmnt(spec, dir); errno = 0; #ifdef __linux__ - ret = mount(spec, dir, __USERINTF_FSTYPE, MS_MGC_VAL|MS_RDONLY, 0); + ret = smount(spec, dir, __USERINTF_FSTYPE, MS_MGC_VAL|MS_RDONLY, 0); #else ret = mount(spec, dir, 1); #endif @@ -507,7 +579,7 @@ unmnt(spec, dir) char *spec; char *dir; { - umount(dir); + sumount(dir); return 0; } @@ -589,7 +661,8 @@ int oflag; /* #define STREAMS_PTY /* uncomment if pty's use STREAMS */ #ifdef STREAMS_PTY -#include <sys/stropts.h> +#define __SID ('S' << 8) +#define I_PUSH (__SID | 2) #endif public int --- ./test_sets/tset/LSB.usersgroups/commands/passwd/uberpass.c.lsbcc 2007-07-24 16:20:00.000000000 -0400 +++ ./test_sets/tset/LSB.usersgroups/commands/passwd/uberpass.c 2007-08-14 10:50:39.000000000 -0400 @@ -22,6 +22,9 @@ #include <pwd.h> #include <sys/types.h> #include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <stddef.h> struct passwd* user_info; @@ -31,9 +34,31 @@ char **members; main(int argc, char *argv[]){ +if (argc < 3) { + printf("usage: %s -mode -request user\n", argv[0]); + exit(1); +} + +FILE * fp; +int len = 255; +char line[len]; +const char delim[] = ":"; +char *token; +int i; +long tval; + +char *sp_namp; +char *sp_pwdp; +long sp_lstchg; +long sp_min; +long sp_max; +long sp_warn; +long sp_inact; +long sp_expire; +unsigned long sp_flag; + switch (argv[1][1]){ - - + case 'U': user_info = getpwnam(argv[3]); @@ -132,41 +157,82 @@ switch (argv[1][1]){ case 'S': - shadow_info = getspnam(argv[3]); - - if (!shadow_info) { - return (1); - } + fp = fopen("/etc/shadow", "r"); + if (fp == NULL) + return (1); + + while ((fgets(line, len, fp)) != NULL) { + if (strncmp(line, argv[3], strlen(argv[3])) == 0) { + sp_namp = strtok(line, delim); + for (i = 1; i <= 7; i++) { + token = strtok(NULL, delim); + if (i > 1) { + if (token != NULL && token != "") { + tval = atol(token); + } else { + tval = -1; + } + } + switch(i) { + case 1: + sp_pwdp = (char *) malloc(sizeof(token)); + strcpy(sp_pwdp, token); + break; + case 2: + sp_lstchg = tval; + break; + case 3: + sp_min = tval; + break; + case 4: + sp_max = tval; + break; + case 5: + sp_warn = tval; + break; + case 6: + sp_inact = tval; + break; + case 7: + /* need to add one for this case */ + if (tval != -1) + tval++; + sp_expire = tval; + break; + } + } + } + } switch(argv[2][1]) { case 'e': - printf("%d\n", shadow_info->sp_expire); + printf("%d\n", sp_expire); return (0); case 'f': - printf("%d\n", shadow_info->sp_inact); + printf("%d\n", sp_inact); return (0); case 'p': - printf("%s\n", shadow_info->sp_pwdp); + printf("%s\n", sp_pwdp); return (0); case 'x': - printf("%d\n", shadow_info->sp_max); + printf("%d\n", sp_max); return (0); case 'n': - printf("%d\n", shadow_info->sp_min); + printf("%d\n", sp_min); return (0); case 'w': - printf("%d\n", shadow_info->sp_warn); + printf("%d\n", sp_warn); return (0); case 'i': - printf("%d\n", shadow_info->sp_inact); + printf("%d\n", sp_inact); return (0); default: return (1); } - + fclose(fp); default: return (1); --- ./test_sets/tset/LSB.usersgroups/commands/misc/uberpass.c.lsbcc 2007-07-24 16:20:00.000000000 -0400 +++ ./test_sets/tset/LSB.usersgroups/commands/misc/uberpass.c 2007-08-14 10:50:39.000000000 -0400 @@ -22,6 +22,9 @@ #include <pwd.h> #include <sys/types.h> #include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <stddef.h> struct passwd* user_info; @@ -31,9 +34,31 @@ char **members; main(int argc, char *argv[]){ +if (argc < 3) { + printf("usage: %s -mode -request user\n", argv[0]); + exit(1); +} + +FILE * fp; +int len = 255; +char line[len]; +const char delim[] = ":"; +char *token; +int i; +long tval; + +char *sp_namp; +char *sp_pwdp; +long sp_lstchg; +long sp_min; +long sp_max; +long sp_warn; +long sp_inact; +long sp_expire; +unsigned long sp_flag; + switch (argv[1][1]){ - - + case 'U': user_info = getpwnam(argv[3]); @@ -132,41 +157,82 @@ switch (argv[1][1]){ case 'S': - shadow_info = getspnam(argv[3]); - - if (!shadow_info) { - return (1); - } + fp = fopen("/etc/shadow", "r"); + if (fp == NULL) + return (1); + + while ((fgets(line, len, fp)) != NULL) { + if (strncmp(line, argv[3], strlen(argv[3])) == 0) { + sp_namp = strtok(line, delim); + for (i = 1; i <= 7; i++) { + token = strtok(NULL, delim); + if (i > 1) { + if (token != NULL && token != "") { + tval = atol(token); + } else { + tval = -1; + } + } + switch(i) { + case 1: + sp_pwdp = (char *) malloc(sizeof(token)); + strcpy(sp_pwdp, token); + break; + case 2: + sp_lstchg = tval; + break; + case 3: + sp_min = tval; + break; + case 4: + sp_max = tval; + break; + case 5: + sp_warn = tval; + break; + case 6: + sp_inact = tval; + break; + case 7: + /* need to add one for this case */ + if (tval != -1) + tval++; + sp_expire = tval; + break; + } + } + } + } switch(argv[2][1]) { case 'e': - printf("%d\n", shadow_info->sp_expire); + printf("%d\n", sp_expire); return (0); case 'f': - printf("%d\n", shadow_info->sp_inact); + printf("%d\n", sp_inact); return (0); case 'p': - printf("%s\n", shadow_info->sp_pwdp); + printf("%s\n", sp_pwdp); return (0); case 'x': - printf("%d\n", shadow_info->sp_max); + printf("%d\n", sp_max); return (0); case 'n': - printf("%d\n", shadow_info->sp_min); + printf("%d\n", sp_min); return (0); case 'w': - printf("%d\n", shadow_info->sp_warn); + printf("%d\n", sp_warn); return (0); case 'i': - printf("%d\n", shadow_info->sp_inact); + printf("%d\n", sp_inact); return (0); default: return (1); } - + fclose(fp); default: return (1);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor