mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-27 16:03:36 +01:00
Compare commits
3 Commits
wmaker-0.9
...
93b049356f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93b049356f | ||
|
|
75f353bef4 | ||
|
|
2264ed9de6 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -30,6 +30,8 @@ m4/ltversion.m4
|
|||||||
m4/lt~obsolete.m4
|
m4/lt~obsolete.m4
|
||||||
|
|
||||||
src/wconfig.h
|
src/wconfig.h
|
||||||
|
WINGs/WINGs/WINGsP.h
|
||||||
|
wrlib/wraster.h
|
||||||
|
|
||||||
# These files are generated by scripts
|
# These files are generated by scripts
|
||||||
INSTALL-WMAKER
|
INSTALL-WMAKER
|
||||||
|
|||||||
@@ -1732,36 +1732,23 @@ Bool WMWritePropListToFile(WMPropList * plist, const char *path)
|
|||||||
* file, and the last component is stripped off. the rest is the
|
* file, and the last component is stripped off. the rest is the
|
||||||
* the hierarchy to be created.
|
* the hierarchy to be created.
|
||||||
*
|
*
|
||||||
* refuses to create anything outside $WMAKER_USER_ROOT/Defaults or $WMAKER_USER_ROOT/Library
|
* refuses to create anything outside $WMAKER_USER_ROOT
|
||||||
*
|
*
|
||||||
* returns 1 on success, 0 on failure
|
* returns 1 on success, 0 on failure
|
||||||
*/
|
*/
|
||||||
int wmkdirhier(const char *path)
|
int wmkdirhier(const char *path)
|
||||||
{
|
{
|
||||||
const char *libpath;
|
const char *t;
|
||||||
char *udefpath;
|
|
||||||
int cmp;
|
|
||||||
char *thePath = NULL, buf[1024];
|
char *thePath = NULL, buf[1024];
|
||||||
size_t p, plen;
|
size_t p, plen;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
/* Only create directories under $WMAKER_USER_ROOT/Defaults or $WMAKER_USER_ROOT/Library */
|
/* Only create directories under $WMAKER_USER_ROOT */
|
||||||
libpath = wuserdatapath();
|
if ((t = wusergnusteppath()) == NULL)
|
||||||
if (strncmp(path, libpath, strlen(libpath)) == 0)
|
return 0;
|
||||||
if (path[strlen(libpath)] == '/')
|
if (strncmp(path, t, strlen(t)) != 0)
|
||||||
goto path_in_valid_tree;
|
return 0;
|
||||||
|
|
||||||
udefpath = wdefaultspathfordomain("");
|
|
||||||
cmp = strncmp(path, udefpath, strlen(udefpath));
|
|
||||||
wfree(udefpath);
|
|
||||||
if (cmp == 0)
|
|
||||||
/* Note: by side effect, 'udefpath' already contains a final '/' */
|
|
||||||
goto path_in_valid_tree;
|
|
||||||
|
|
||||||
/* If we reach this point, the path is outside the allowed tree */
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
path_in_valid_tree:
|
|
||||||
thePath = wstrdup(path);
|
thePath = wstrdup(path);
|
||||||
/* Strip the trailing component if it is a file */
|
/* Strip the trailing component if it is a file */
|
||||||
p = strlen(thePath);
|
p = strlen(thePath);
|
||||||
@@ -1784,6 +1771,7 @@ int wmkdirhier(const char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
|
strncpy(buf, t, sizeof(buf) - 1);
|
||||||
p = strlen(buf);
|
p = strlen(buf);
|
||||||
plen = strlen(thePath);
|
plen = strlen(thePath);
|
||||||
|
|
||||||
@@ -1794,7 +1782,7 @@ int wmkdirhier(const char *path)
|
|||||||
strncpy(buf, thePath, p);
|
strncpy(buf, thePath, p);
|
||||||
if (mkdir(buf, 0777) == -1 && errno == EEXIST &&
|
if (mkdir(buf, 0777) == -1 && errno == EEXIST &&
|
||||||
stat(buf, &st) == 0 && !S_ISDIR(st.st_mode)) {
|
stat(buf, &st) == 0 && !S_ISDIR(st.st_mode)) {
|
||||||
werror(_("Could not create path component %s"), buf);
|
werror(_("Could not create component %s"), buf);
|
||||||
wfree(thePath);
|
wfree(thePath);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,10 +77,8 @@ while [ $# -gt 0 ]; do
|
|||||||
|
|
||||||
-v)
|
-v)
|
||||||
shift
|
shift
|
||||||
# Version may be 'x:y:z', we keep only 'x'
|
version="$1"
|
||||||
version="`echo "$1" | sed -e 's,:.*$,,' `"
|
echo "$version" | grep -E '^[1-9][0-9]*(:[0-9]+(:[0-9]+)?)?$' > /dev/null || \
|
||||||
# the version should only be a number
|
|
||||||
echo "$version" | grep '^[1-9][0-9]*$' > /dev/null || \
|
|
||||||
arg_error "version \"$1\" is not valid"
|
arg_error "version \"$1\" is not valid"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -109,9 +107,18 @@ fi
|
|||||||
# generate the rest of the script so that other symbols will not be kept.
|
# generate the rest of the script so that other symbols will not be kept.
|
||||||
awk '
|
awk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
# Version number here uses only 1 number from the full version used in libtool
|
||||||
|
libversion="'"$version"'";
|
||||||
|
if (split(libversion, subversions, ":") > 1) {
|
||||||
|
# Calculate [CURRENT - AGE], the goal is that the number will not
|
||||||
|
# change when functions are added to the API, but it will be incremented
|
||||||
|
# when functions are removed or argument change (which breaks compat)
|
||||||
|
libversion = subversions[1] - subversions[3];
|
||||||
|
}
|
||||||
|
|
||||||
print "/* Generated version-script for ld */";
|
print "/* Generated version-script for ld */";
|
||||||
print "";
|
print "";
|
||||||
print "'"$libname$version"'";
|
print "'"$libname"'" libversion;
|
||||||
print "{";
|
print "{";
|
||||||
print " global:";
|
print " global:";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user