olddoc/Makefile.in
src/Makefile.in
tests/Makefile.in
+GPATH
+GRTAGS
+GSYMS
+GTAGS
+2008-02-17 Koji Arai <arai@users.sourceforge.jp>
+
+ * src/lhext.c (extract_one) could not extract files under readonly directories, like:
+
+ dr-xr-xr-x 2 arai arai 4096 Jan 5 03:30 foo/
+ -rw-r--r-- 1 arai arai 0 Jan 5 03:30 foo/bar
+
+ * tests/Makefile.am: added a test for above.
+
+ * tests/lha-test.in: ditto.
+
+ * tests/lha-test18: ditto.
+
+2008-02-05 Koji Arai <arai@users.sourceforge.jp>
+
+ * config.h. configure.ac: added a configure option
+ --with-additional-suffixes for SuSE Linux.
+
+ * src/lharc.c (open_old_archive): make it possible to add archive
+ suffixes.
+
+ * src/lharc.c (print_version): show the configure option by the
+ --version option.
+
2007-09-09 Koji Arai <arai@users.sourceforge.jp>
* src/header.c: `put_longword()' should be used the ANSI-C declaration.
# Process this file with autoconf to produce a configure script.
-AC_INIT([LHa for UNIX], 1.14i-ac20080117, arai@users.sourceforge.jp, lha)
+AC_INIT([LHa for UNIX], 1.14i-ac20080217, arai@users.sourceforge.jp, lha)
AC_DEFINE_UNQUOTED(LHA_CONFIGURE_OPTIONS, "$ac_configure_args",
[specified options for the configure script.])
AC_CANONICAL_HOST
if (hdr->extend_type == EXTEND_UNIX
|| hdr->extend_type == EXTEND_OS68K
|| hdr->extend_type == EXTEND_XOSK) {
-#ifdef NOT_COMPATIBLE_MODE
- /* Please need your modification in this space. */
-#ifdef __DJGPP__
- if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) != UNIX_FILE_SYMLINK)
- chmod(name, hdr->unix_mode);
-#endif /* __DJGPP__ */
-#else
- if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) != UNIX_FILE_SYMLINK)
+
+ if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) != UNIX_FILE_SYMLINK) {
chmod(name, hdr->unix_mode);
-#endif
+ }
+
if (!getuid()){
uid_t uid = hdr->unix_uid;
gid_t gid = hdr->unix_gid;
error("Unknown file type: \"%s\". use `f' option to force extract.", name);
}
- if (!output_to_stdout)
- adjust_info(name, hdr);
+ if (!output_to_stdout) {
+ if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) != UNIX_FILE_DIRECTORY)
+ adjust_info(name, hdr);
+ }
return read_size;
}
}
/*
- * restore directory information (time stamp).
+ * restore directory information (timestamp, permission and uid/gid).
* added by A.Iriyama 2003.12.12
*/
-typedef struct lhdDirectoryInfo_t {
- struct lhdDirectoryInfo_t *next;
+typedef struct LzHeaderList_t {
+ struct LzHeaderList_t *next;
LzHeader hdr;
} LzHeaderList;
lha-test16-l1.lzh \
lha-test16-l2.lzh \
lha-test17 \
+ lha-test18 \
lha-test51 \
lha-test51-2G.lzh \
lha-test52-4G.lzh
#!/bin/bash
+print_usage()
+{
+ cat <<EOF
+usage: $0 [-n] [test number]
+
+option:
+ -n: do not cleanup.
+EOF
+ exit
+}
+
for _opt
do
case $_opt in
+ --help) print_usage ;;
-n) no_cleanup=true; shift ;;
*) perform_number=$1; shift ;;
esac
: ${builddir=$(cd @builddir@ && pwd)}
if [[ x$no_cleanup = x ]]; then
- trap '_stat=$?; rm -rf test-*; exit $_stat' 0 1 2 3 15
+ trap '_stat=$?; chmod -R 755 test-* 2>/dev/null;
+ rm -rf test-*; exit $_stat' 0 1 2 3 15
fi
typeset -i i # for loop
cleanup()
{
if [[ x$no_cleanup = x ]]; then
+ chmod -R 755 test-tmp* 2>/dev/null
rm -rf test-tmp*
fi
}
testsuite lha-test15
testsuite lha-test16
testsuite lha-test17
+ testsuite lha-test18
# followings will take a long time
if [[ $perform_number = all ]]; then
testsuite lha-test51 # extract 2G over files
--- /dev/null
+# -*- shell-script -*-
+message restore directory permission
+
+echo -------------------------------------------------------------------
+
+mkdir -p test-tmp1/test1/test2 &&
+cp -r test-1 test-tmp1/test1/test2 &&
+chmod 444 test-tmp1 &&
+chmod 644 test-tmp1/test1 &&
+chmod 666 test-tmp1/test1/test2 &&
+chmod 755 test-tmp1/test1/test2/test-1
+ check $? $LINENO
+
+$lha c test-tmp1.lzh test-tmp1
+ check $? $LINENO
+
+$lha xw=test-tmp2 test-tmp1.lzh
+ check $? $LINENO
+
+diff -r test-tmp2/test-tmp1 test-tmp1
+ check $? $LINENO
+
+ls -ld test-tmp2/test-tmp1 | grep '^dr--r--r--' &&
+ls -ld test-tmp2/test-tmp1/test1 | grep '^drw-r--r--' &&
+ls -ld test-tmp2/test-tmp1/test1/test2 | grep '^drw-rw-rw-' &&
+ls -ld test-tmp2/test-tmp1/test1/test2/test-1 | grep '^drwxr-xr-x'
+ check $? $LINENO